From ffdaedd26f7ae26f49ad2d83b35b294608d2614f Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 23 Dec 2025 16:16:51 +0100 Subject: [PATCH] inizio gestione threshold con update componenti, continuo timeEstim --- .../EgwCoreLib.Lux.Core.csproj | 4 +- .../RestPayload/WorkLoadDetailDTO.cs | 12 +- .../EgwCoreLib.Lux.Data.csproj | 2 +- .../Services/ConfigDataService.cs | 31 ++- Lux.API/Lux.API.csproj | 2 +- Lux.UI.Client/Lux.UI.Client.csproj | 2 +- Lux.UI/Components/Compo/OfferRowMan.razor.cs | 21 +- Lux.UI/Components/Compo/OrderRowMan.razor | 8 +- .../Compo/WorkLoad/PartStatus.razor | 2 +- .../Components/Compo/WorkLoad/TimeEstim.razor | 185 +++++++++++------- .../Compo/WorkLoad/TimeEstim.razor.cs | 19 ++ Lux.UI/Lux.UI.csproj | 4 +- Resources/ChangeLog.html | 2 +- Resources/VersNum.txt | 2 +- Resources/manifest.xml | 2 +- 15 files changed, 207 insertions(+), 91 deletions(-) diff --git a/EgwCoreLib.Lux.Core/EgwCoreLib.Lux.Core.csproj b/EgwCoreLib.Lux.Core/EgwCoreLib.Lux.Core.csproj index a74b52ec..95821d45 100644 --- a/EgwCoreLib.Lux.Core/EgwCoreLib.Lux.Core.csproj +++ b/EgwCoreLib.Lux.Core/EgwCoreLib.Lux.Core.csproj @@ -21,8 +21,8 @@ - - + + diff --git a/EgwCoreLib.Lux.Core/RestPayload/WorkLoadDetailDTO.cs b/EgwCoreLib.Lux.Core/RestPayload/WorkLoadDetailDTO.cs index 4a6d687f..120bdf02 100644 --- a/EgwCoreLib.Lux.Core/RestPayload/WorkLoadDetailDTO.cs +++ b/EgwCoreLib.Lux.Core/RestPayload/WorkLoadDetailDTO.cs @@ -60,13 +60,21 @@ namespace EgwCoreLib.Lux.Core.RestPayload #region Public Properties /// - /// Elenco Macchine + /// Elenco Macchine in formato stringa join /// - public string ListMachines + public string ListMachinesJoin { get => string.Join(", ", machineCalcResults.Select(x => x.Name).OrderBy(x => x).ToList()); } + /// + /// Elenco effettivo macchine + /// + public List ListMachines + { + get => machineCalcResults.Select(x => x.Name).OrderBy(x => x).ToList(); + } + /// /// Elenco delle etichette parts non OK /// diff --git a/EgwCoreLib.Lux.Data/EgwCoreLib.Lux.Data.csproj b/EgwCoreLib.Lux.Data/EgwCoreLib.Lux.Data.csproj index caf99854..e832a7f7 100644 --- a/EgwCoreLib.Lux.Data/EgwCoreLib.Lux.Data.csproj +++ b/EgwCoreLib.Lux.Data/EgwCoreLib.Lux.Data.csproj @@ -27,7 +27,7 @@ - + diff --git a/EgwCoreLib.Lux.Data/Services/ConfigDataService.cs b/EgwCoreLib.Lux.Data/Services/ConfigDataService.cs index 832d4ae3..bf1e194a 100644 --- a/EgwCoreLib.Lux.Data/Services/ConfigDataService.cs +++ b/EgwCoreLib.Lux.Data/Services/ConfigDataService.cs @@ -1,4 +1,5 @@ -using EgwCoreLib.Lux.Core.RestPayload; +using Egw.Window.Data; +using EgwCoreLib.Lux.Core.RestPayload; using EgwCoreLib.Lux.Data.Controllers; using EgwCoreLib.Lux.Data.DbModel.Config; using EgwMultiEngineManager.Data; @@ -85,6 +86,34 @@ namespace EgwCoreLib.Lux.Data.Services return result; } + /// + /// Restituisce il dizionario dei profili + relativa lista soglie da cache REDIS + /// + /// + public Dictionary> ProfileThreshDict(Constants.EXECENVIRONMENTS execEnvironment) + { + Dictionary> result = new Dictionary>(); + // recupero profili per ciclare... + List profList = ProfileList(execEnvironment); + foreach (var prof in profList) + { + // leggo obj da redis cache + var currKey = $"{redisBaseKey}:{execEnvironment}:PROF:THRESH:{prof}"; + RedisValue rawData = redisDb.StringGet(currKey); + // prendo solo i valori validi (Name <> FamilyName) + if (rawData.HasValue) + { + var currList = JsonConvert.DeserializeObject>($"{rawData}") ?? new List(); + if (currList.Any()) + { + result.Add(prof, currList); + } + } + } + return result; + } + + #endregion Public Methods #region Private Fields diff --git a/Lux.API/Lux.API.csproj b/Lux.API/Lux.API.csproj index 294562a0..b65453fc 100644 --- a/Lux.API/Lux.API.csproj +++ b/Lux.API/Lux.API.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 0.9.2512.2312 + 0.9.2512.2316 diff --git a/Lux.UI.Client/Lux.UI.Client.csproj b/Lux.UI.Client/Lux.UI.Client.csproj index b47e51af..9385f618 100644 --- a/Lux.UI.Client/Lux.UI.Client.csproj +++ b/Lux.UI.Client/Lux.UI.Client.csproj @@ -9,7 +9,7 @@ - + diff --git a/Lux.UI/Components/Compo/OfferRowMan.razor.cs b/Lux.UI/Components/Compo/OfferRowMan.razor.cs index 9d9bd0ad..38eeeac8 100644 --- a/Lux.UI/Components/Compo/OfferRowMan.razor.cs +++ b/Lux.UI/Components/Compo/OfferRowMan.razor.cs @@ -1,3 +1,4 @@ +using Egw.Window.Data; using EgwCoreLib.Lux.Core; using EgwCoreLib.Lux.Core.RestPayload; using EgwCoreLib.Lux.Data.DbModel.Config; @@ -669,6 +670,14 @@ namespace Lux.UI.Components.Compo private List AvailHardwareList = new(); private List AvailMaterialList = new List(); private List AvailProfileList = new List(); + private Dictionary> AvailThresholdDict = new Dictionary>(); + + + private Dictionary> AvailThreshold { get; set; } = new Dictionary>() + { + {"Profilo78", new List() { new Threshold(3, "Bottom"), new Threshold(1, "Threshold")}}, + {"ProfiloSaomad", new List(){ new Threshold(3, "Bottom"), new Threshold(2, "BottomWaterdrip"), new Threshold(1, "Threshold")}} + }; /// /// Base path x network share files @@ -1188,14 +1197,15 @@ namespace Lux.UI.Components.Compo private void PrepareWindowData(string currJwd) { // preparo conf oggetti x controllo - SetupList = SetupList = new BaseListPayload() + SetupList = new BaseListPayload() { ColorMaterial = AvailColorMaterialList, FamilyHardware = AvailFamilyHardwareList, Glass = AvailGlassList, Hardware = AvailHardwareList, Material = AvailMaterialList, - Profile = AvailProfileList + Profile = AvailProfileList, + Threshold = AvailThreshold }; CurrData = new LivePayload() { @@ -1223,6 +1233,11 @@ namespace Lux.UI.Components.Compo rawProfiles = CDService.ProfileList(cEnvir, "Default"); } AvailProfileList = rawProfiles; +#if false + // dizionario dei profili soglia + AvailThresholdDict = CDService.ProfileThreshDict(cEnvir); +#endif + var rawHw = CDService.HwModelList(cEnvir, "HW.AGB"); // hw filtro solo validi... AllConfHardware = rawHw @@ -1439,7 +1454,7 @@ namespace Lux.UI.Components.Compo private bool ShowBom(OfferRowModel reqItem) { bool answ = false; - if (DisplayMode == Enums.DisplayMode.Edit) + if (DisplayMode == EgwCoreLib.Lux.Core.Enums.DisplayMode.Edit) { switch (reqItem.Envir) { diff --git a/Lux.UI/Components/Compo/OrderRowMan.razor b/Lux.UI/Components/Compo/OrderRowMan.razor index bfef4fb8..2a094eec 100644 --- a/Lux.UI/Components/Compo/OrderRowMan.razor +++ b/Lux.UI/Components/Compo/OrderRowMan.razor @@ -239,7 +239,7 @@ else
(@item.Original.UnitCost.ToString("C2"))
*@ - + @(item.WorkLoad?.NumMachines ?? 0) @@ -463,7 +463,7 @@ else if (WorkLoadRecord != null)
Workable Parts: @WorkLoadRecord.NumOk
- @WorkLoadRecord.ListMachines + @WorkLoadRecord.ListMachinesJoin
@@ -493,7 +493,7 @@ else if (WorkLoadRecord != null)
Vincolated Parts: @WorkLoadRecord.NumKo
- @WorkLoadRecord.ListMachines + @WorkLoadRecord.ListMachinesJoin
Unworkable Parts: @WorkLoadRecord.NumKo
- @WorkLoadRecord.ListMachines + @WorkLoadRecord.ListMachinesJoin
Impianti considerati
- @DetailRecord.ListMachines + @DetailRecord.ListMachinesJoin
diff --git a/Lux.UI/Components/Compo/WorkLoad/TimeEstim.razor b/Lux.UI/Components/Compo/WorkLoad/TimeEstim.razor index b3f025c0..3dbfc284 100644 --- a/Lux.UI/Components/Compo/WorkLoad/TimeEstim.razor +++ b/Lux.UI/Components/Compo/WorkLoad/TimeEstim.razor @@ -15,7 +15,7 @@
Impianti considerati
- @DetailRecord.ListMachines + @DetailRecord.ListMachinesJoin
@@ -24,80 +24,125 @@
diff --git a/Lux.UI/Components/Compo/WorkLoad/TimeEstim.razor.cs b/Lux.UI/Components/Compo/WorkLoad/TimeEstim.razor.cs index 2c17a5d0..d6671dd3 100644 --- a/Lux.UI/Components/Compo/WorkLoad/TimeEstim.razor.cs +++ b/Lux.UI/Components/Compo/WorkLoad/TimeEstim.razor.cs @@ -21,8 +21,27 @@ namespace Lux.UI.Components.Compo.WorkLoad #endregion Public Properties + private string selUid = ""; + + protected string MainCss + { + get => string.IsNullOrEmpty(selUid) ? "col-12" : "col-6"; + } + #region Public Classes + protected List ListTargetMachine + { + get + { + var answ = DetailRecord.ListMachines; + // aggiungo la macchina EXT... + answ.Add("EXT"); + return answ; + } + } + + /// /// Definizione richiesta di bilanciamento per il calcolo /// diff --git a/Lux.UI/Lux.UI.csproj b/Lux.UI/Lux.UI.csproj index 9f476827..3082f343 100644 --- a/Lux.UI/Lux.UI.csproj +++ b/Lux.UI/Lux.UI.csproj @@ -5,7 +5,7 @@ enable enable aspnet-Lux.UI-a758c101-a2f4-4e38-977d-1c4887dbbd50 - 0.9.2512.2312 + 0.9.2512.2316 @@ -17,7 +17,7 @@ - + diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html index da7282a5..848a0ad2 100644 --- a/Resources/ChangeLog.html +++ b/Resources/ChangeLog.html @@ -1,6 +1,6 @@ LUX - Web Windows MES -

Versione: 0.9.2512.2312

+

Versione: 0.9.2512.2316


Note di rilascio:
  • diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt index db4ff637..c06c6685 100644 --- a/Resources/VersNum.txt +++ b/Resources/VersNum.txt @@ -1 +1 @@ -0.9.2512.2312 +0.9.2512.2316 diff --git a/Resources/manifest.xml b/Resources/manifest.xml index aba1c5ec..13b14879 100644 --- a/Resources/manifest.xml +++ b/Resources/manifest.xml @@ -1,6 +1,6 @@ - 0.9.2512.2312 + 0.9.2512.2316 http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html false