diff --git a/Test.UI.Client/Test.UI.Client.csproj b/Test.UI.Client/Test.UI.Client.csproj index 81d27a4..9033ca5 100644 --- a/Test.UI.Client/Test.UI.Client.csproj +++ b/Test.UI.Client/Test.UI.Client.csproj @@ -9,7 +9,7 @@ - + diff --git a/Test.UI/Components/Pages/EditJWD.razor b/Test.UI/Components/Pages/EditJWD.razor index 3b1d466..9ea528b 100644 --- a/Test.UI/Components/Pages/EditJWD.razor +++ b/Test.UI/Components/Pages/EditJWD.razor @@ -68,7 +68,7 @@ diff --git a/Test.UI/Components/Pages/EditJWD.razor.cs b/Test.UI/Components/Pages/EditJWD.razor.cs index 1ad2670..5b21eb7 100644 --- a/Test.UI/Components/Pages/EditJWD.razor.cs +++ b/Test.UI/Components/Pages/EditJWD.razor.cs @@ -14,7 +14,6 @@ namespace Test.UI.Components.Pages { public partial class EditJWD : IDisposable { - #region Public Fields public string InitialJwd = ""; @@ -29,6 +28,37 @@ namespace Test.UI.Components.Pages #region Public Methods + /// + /// Comparatore euqlity obj dizionario + /// + /// + /// + /// + /// + /// + public bool DictionariesEqual(Dictionary dict1, Dictionary dict2) + { + // Handle null cases + if (dict1 == null || dict2 == null) + return dict1 == dict2; + + // Quick size check + if (dict1.Count != dict2.Count) + return false; + + // Compare each key-value pair + foreach (var kvp in dict1) + { + if (!dict2.TryGetValue(kvp.Key, out TValue value)) + return false; // Key missing in dict2 + + if (!EqualityComparer.Default.Equals(kvp.Value, value)) + return false; // Value mismatch + } + + return true; + } + public void Dispose() { DLService.CalcDonePipe.EA_NewMessage -= CalcDonePipe_EA_NewMessage; @@ -46,6 +76,7 @@ namespace Test.UI.Components.Pages protected string currJwd = "..."; protected Dictionary m_CurrArgs = new Dictionary(); protected string prevJwd = ""; + /// /// Configurazione elenchi anagrafiche /// @@ -79,6 +110,7 @@ namespace Test.UI.Components.Pages }; protected List AvailHardwareList { get; set; } = new List(); + protected List AvailMaterialList { get; set; } = new List() { new string("Pino"), @@ -93,6 +125,7 @@ namespace Test.UI.Components.Pages }; protected List AvailTemplateList { get; set; } = new List(); + [Inject] protected IConfiguration Config { get; set; } = null!; @@ -153,13 +186,19 @@ namespace Test.UI.Components.Pages private string CalcUid = "CurrWindow"; private string cFileHardware = "Hardware/Setup.json"; private string cFileTemplate = "Data/Setup.json"; + private string colorMassUpdate; private TemplateSelectDTO? currSel = null; private string currSvg = ""; + private string familyHWMassUpdate; private string GenericBasePath = ""; + private string glassMassUpdate; + private Hardware hardwareMassUpdate; private string imgBasePath = ""; + private string materialMassUpdate; private string outClose = ""; private string outSave = ""; + private string profileMassUpdate; private string subChannel = ""; private string windowUid = "CurrWindow"; @@ -204,6 +243,29 @@ namespace Test.UI.Components.Pages subChannel = Config.GetValue("ServerConf:SvgChannel") ?? ""; } + private async Task ExecRequest(Dictionary CurrArgs) + { + outClose = ""; + outSave = ""; + // verifico se contiene JWD, lo aggiorno + if (CurrArgs.ContainsKey("Jwd")) + { + currJwd = CurrArgs["Jwd"]; + CurrData.CurrJwd = currJwd; + } + // se il SSE variato --> invio + if (!currJwd.Equals(prevJwd) || !DictionariesEqual(m_CurrArgs, CurrArgs)) + { + m_CurrArgs = CurrArgs; + prevJwd = currJwd; + CalcRequestDTO calcRequestDTO = new CalcRequestDTO(); + calcRequestDTO.EnvType = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW; + calcRequestDTO.DictExec = m_CurrArgs; + // chiamo la chiamata POST alla API, che manda la richiesta via REDIS + await ICService.CallRestPost($"{apiUrl}/{GenericBasePath}", $"{calcTag}/{CalcUid}", calcRequestDTO); + } + } + /// /// Rilettura dati /// @@ -241,30 +303,6 @@ namespace Test.UI.Components.Pages await Task.Delay(100); } - private async Task SaveJWD(Dictionary CurrArgs) - { - outClose = ""; - outSave = ""; - m_CurrArgs = CurrArgs; - // verifico se contiene JWD, lo aggiorno - if (CurrArgs.ContainsKey("Jwd")) - { - currJwd = CurrArgs["Jwd"]; - CurrData.CurrJwd = currJwd; - } - - // se il SSE variato --> invio - if (!currJwd.Equals(prevJwd)) - { - prevJwd = currJwd; - CalcRequestDTO calcRequestDTO = new CalcRequestDTO(); - calcRequestDTO.EnvType = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW; - calcRequestDTO.DictExec = m_CurrArgs; - // chiamo la chiamata POST alla API, che manda la richiesta via REDIS - await ICService.CallRestPost($"{apiUrl}/{GenericBasePath}", $"{calcTag}/{CalcUid}", calcRequestDTO); - } - } - private void SetTemplate(TemplateSelectDTO selTemp) { string rawVal = ""; @@ -277,18 +315,12 @@ namespace Test.UI.Components.Pages SelTemplate = new Template(selTemp.Index, selTemp.Description, selTemp.SVGFileName, rawVal); } - #endregion Private Methods - private void updateInfoJwd(string currSer, string? newFamilyHardware, Hardware? newHardware, string? newColorMaterial, string? newMaterial, string? newGlass, string? newProfile) { var newJwd = SerialMan.MassUpdate(currSer, newFamilyHardware, newHardware, newColorMaterial, newMaterial, newGlass, newProfile); CurrData.CurrJwd = newJwd; } - private string familyHWMassUpdate; - private Hardware hardwareMassUpdate; - private string materialMassUpdate; - private string colorMassUpdate; - private string glassMassUpdate; - private string profileMassUpdate; + + #endregion Private Methods } } \ No newline at end of file diff --git a/Test.UI/Components/Pages/Gerarchia.razor b/Test.UI/Components/Pages/Gerarchia.razor index bfd60ee..6501d4c 100644 --- a/Test.UI/Components/Pages/Gerarchia.razor +++ b/Test.UI/Components/Pages/Gerarchia.razor @@ -14,7 +14,7 @@ IN_SelMaterial="@SelMaterial" IN_GlassList="@AvailGlassList" IN_SelGlass="@SelGlass" - EC_OnUpdate="SaveJWD" + EC_req="SaveJWD" EC_OnSelectedTemplate="SetTemplate" LiveSVG="@currSvg"> diff --git a/Test.UI/Test.UI.csproj b/Test.UI/Test.UI.csproj index ead5cf7..7368494 100644 --- a/Test.UI/Test.UI.csproj +++ b/Test.UI/Test.UI.csproj @@ -34,11 +34,11 @@ - - + + - + diff --git a/WebAedificaConfigurator/WebAedificaConfigurator.csproj b/WebAedificaConfigurator/WebAedificaConfigurator.csproj index 9e3b60b..b74113a 100644 --- a/WebAedificaConfigurator/WebAedificaConfigurator.csproj +++ b/WebAedificaConfigurator/WebAedificaConfigurator.csproj @@ -12,8 +12,8 @@ - - + + diff --git a/WebWindowComplex/Compo/CardSashGroup.razor b/WebWindowComplex/Compo/CardSashGroup.razor index 7445425..82a0e57 100644 --- a/WebWindowComplex/Compo/CardSashGroup.razor +++ b/WebWindowComplex/Compo/CardSashGroup.razor @@ -94,7 +94,7 @@
- @if (CurrItem.HardwareList == null || CurrItem.HardwareList.Count == 0) { diff --git a/WebWindowComplex/Compo/CardSashGroup.razor.cs b/WebWindowComplex/Compo/CardSashGroup.razor.cs index 995c11a..3c045ee 100644 --- a/WebWindowComplex/Compo/CardSashGroup.razor.cs +++ b/WebWindowComplex/Compo/CardSashGroup.razor.cs @@ -5,6 +5,8 @@ namespace WebWindowComplex.Compo { public partial class CardSashGroup { + #region Public Properties + /// /// Indice della sash corrente rispetto alla lista sash /// @@ -17,18 +19,6 @@ namespace WebWindowComplex.Compo [Parameter] public Sash CurrItem { get; set; } = null!; - /// - /// Lista di sash - /// - [Parameter] - public List SashList { get; set; } = null!; - - /// - /// Evento per cambiare tutti i fill - /// - [Parameter] - public EventCallback EC_RemoveArea { get; set; } - /// /// Evento per cambiare tutti i Joints /// @@ -48,10 +38,10 @@ namespace WebWindowComplex.Compo public EventCallback EC_CopyContentSash { get; set; } /// - /// Evento per cambiare tutti i Joints + /// Evento per cambiare tutti i fill /// [Parameter] - public EventCallback EC_UpdateSash { get; set; } + public EventCallback EC_RemoveArea { get; set; } /// /// Evento per tornare nella pagine Tree @@ -59,6 +49,48 @@ namespace WebWindowComplex.Compo [Parameter] public EventCallback EC_ReqClose { get; set; } + /// + /// Evento per cambiare tutti i Joints + /// + [Parameter] + public EventCallback EC_UpdateSash { get; set; } + + /// + /// Evento per segnalare cambio hw e richiesta calcolo + /// + [Parameter] + public EventCallback EC_UpdateSashHardware { get; set; } + + /// + /// Lista di sash + /// + [Parameter] + public List SashList { get; set; } = null!; + + #endregion Public Properties + + #region Protected Properties + + /// + /// + /// + protected string SelHwType + { + get => CurrItem.SelHardwareFromId; + set + { + if (CurrItem.SelHardwareFromId != value) + { + CurrItem.SelHardwareFromId = value; + _ = EC_UpdateSashHardware.InvokeAsync(CurrItem); + } + } + } + + #endregion Protected Properties + + #region Protected Methods + /// /// Sollevo evento per rimuovere area /// @@ -69,6 +101,10 @@ namespace WebWindowComplex.Compo await EC_RemoveArea.InvokeAsync(currArea); } + #endregion Protected Methods + + #region Private Methods + /// /// Sollevo evento richiesta per cambiare tutti i Joint /// @@ -101,6 +137,14 @@ namespace WebWindowComplex.Compo await EC_CopyContentSash.InvokeAsync(Args); } + /// + /// Sollevo evento per tornare alla pagina Tree + /// + private void ReqClose() + { + _ = EC_ReqClose.InvokeAsync(true); + } + /// /// Report aggiornamento joint /// @@ -118,14 +162,6 @@ namespace WebWindowComplex.Compo } } - /// - /// Sollevo evento per tornare alla pagina Tree - /// - private void ReqClose() - { - _ = EC_ReqClose.InvokeAsync(true); - } - + #endregion Private Methods } - } \ No newline at end of file diff --git a/WebWindowComplex/DTO/LivePayload.cs b/WebWindowComplex/DTO/LivePayload.cs index f1f3da8..db8e240 100644 --- a/WebWindowComplex/DTO/LivePayload.cs +++ b/WebWindowComplex/DTO/LivePayload.cs @@ -23,6 +23,16 @@ namespace WebWindowComplex.DTO /// public string SvgPreview { get; set; } = string.Empty; + /// + /// Shape da verifica JWD + /// + public string Shape { get; set; } = string.Empty; + + /// + /// XML opzioni HW da verifica JWD + /// + public string OptionsXml { get; set; } = string.Empty; + #endregion Public Properties #region Public Methods @@ -41,6 +51,10 @@ namespace WebWindowComplex.DTO return false; if (SvgPreview != item.SvgPreview) return false; + if (Shape != item.Shape) + return false; + if (OptionsXml != item.OptionsXml) + return false; return true; } diff --git a/WebWindowComplex/TableComp.razor b/WebWindowComplex/TableComp.razor index 1095e49..1689d5c 100644 --- a/WebWindowComplex/TableComp.razor +++ b/WebWindowComplex/TableComp.razor @@ -145,7 +145,17 @@ } else { - + + } } else if (currStep == CompileStep.Fill) diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index 6c8478f..768d747 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -42,10 +42,10 @@ namespace WebWindowComplex public EventCallback EC_OnSelectedTemplate { get; set; } /// - /// Richiesta refresh SVG da JWD + /// Richiesta update da JWD (SVG, calcoli vari...) /// [Parameter] - public EventCallback> EC_OnUpdate { get; set; } + public EventCallback> EC_DoUpdate { get; set; } /// /// Sollevo evento errore validazione con una lista di errori rilevati @@ -448,7 +448,7 @@ namespace WebWindowComplex Dictionary Args = new Dictionary(); Args.Add("Mode", $"{(int)Enums.QuestionModes.PREVIEW}"); Args.Add("Jwd", CurrJwd); - await EC_OnUpdate.InvokeAsync(Args); + await EC_DoUpdate.InvokeAsync(Args); } } } @@ -471,10 +471,10 @@ namespace WebWindowComplex { prevJwd = CurrJwd; Dictionary Args = new Dictionary(); - Args.Add("Mode", $"{(int)Enums.QuestionModes.HARDWAREMODELLIST}"); - Args.Add("SubMode", $"{(int)Enums.QuestionSubModes.HARDWAREOPTIONS}"); + Args.Add("Mode", $"{(int)Enums.QuestionModes.HARDWARE}"); + Args.Add("SubMode", $"{(int)Enums.QuestionHwSubModes.HARDWAREOPTIONS}"); Args.Add("Jwd", CurrJwd); - await EC_OnUpdate.InvokeAsync(Args); + await EC_DoUpdate.InvokeAsync(Args); } } } @@ -497,10 +497,10 @@ namespace WebWindowComplex { prevJwd = CurrJwd; Dictionary Args = new Dictionary(); - Args.Add("Mode", $"{(int)Enums.QuestionModes.HARDWAREMODELLIST}"); - Args.Add("SubMode", $"{(int)Enums.QuestionSubModes.LIST}"); + Args.Add("Mode", $"{(int)Enums.QuestionModes.HARDWARE}"); + Args.Add("SubMode", $"{(int)Enums.QuestionHwSubModes.SASHSHAPE}"); Args.Add("Jwd", CurrJwd); - await EC_OnUpdate.InvokeAsync(Args); + await EC_DoUpdate.InvokeAsync(Args); } } } @@ -509,7 +509,7 @@ namespace WebWindowComplex /// Metodo di reset dei dati a quelli del template /// protected async Task DoReset() - { + { // Da fare } @@ -579,6 +579,8 @@ namespace WebWindowComplex prevLiveData = new LivePayload() { CurrJwd = LiveData.CurrJwd, + OptionsXml = LiveData.OptionsXml, + Shape = LiveData.Shape, SvgPreview = LiveData.SvgPreview }; m_SelSVG = LiveData.SvgPreview; @@ -991,7 +993,7 @@ namespace WebWindowComplex Dictionary Args = new Dictionary(); Args.Add("Mode", $"{(int)Enums.QuestionModes.PREVIEW}"); Args.Add("Jwd", e.sJwd); - EC_OnUpdate.InvokeAsync(Args); + _ = EC_DoUpdate.InvokeAsync(Args); } /// @@ -1185,6 +1187,16 @@ namespace WebWindowComplex await DoPreviewSvg(); } + /// + /// Aggiornamento opzioni dato update sash + /// + /// nuova sash + /// + private async Task UpdateHwOptions(Sash newSash) + { + await DoReqOptHardware(); + } + /// /// Cerca e aggiorna la sash /// diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index c1610e4..8a8a518 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.2018 + 2.7.10.2117 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -18,10 +18,10 @@ - + - + @@ -31,3 +31,11 @@ + + + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 00264b9..18da0ef 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.2018 + 2.7.10.2117 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -26,10 +26,10 @@ - + - + @@ -101,6 +101,14 @@ + + + + + + + + diff --git a/WebWindowTest/WebWindowTest.csproj b/WebWindowTest/WebWindowTest.csproj index 04868e5..e549dc0 100644 --- a/WebWindowTest/WebWindowTest.csproj +++ b/WebWindowTest/WebWindowTest.csproj @@ -12,10 +12,10 @@ - + - +