diff --git a/WebWindowComplex/Models/Area.cs b/WebWindowComplex/Models/Area.cs index b0d4921..719d4eb 100644 --- a/WebWindowComplex/Models/Area.cs +++ b/WebWindowComplex/Models/Area.cs @@ -106,7 +106,7 @@ namespace WebWindowComplex.Models // Creo area sash di default Sash SashArea = Sash.CreateSash(ParentArea); // ricerco tra tutti gli hw disponibili... - + string sShape = FindSashShape(); var listHwValid = Sash .m_HardwareCompleteList @@ -116,41 +116,45 @@ namespace WebWindowComplex.Models { // seleziono la famiglia del primo hw trovato... SashArea.SetSelFamilyHardware(listHwValid.FamilyName); - SashArea.ReqRefreshShape(); +#if false + SashArea.ReqRefreshShape(); +#endif + SashArea.RefreshHardwareList(); if (SashArea.HardwareList.Count == 0) { - answ = true; + //answ = true; + SashArea.SetSelHardwareFromId("000000"); } else { SashArea.SetSelHardwareFromId(SashArea.HardwareList.First().Id); - // Salvo gli oggetti già presenti e li cancello da AreaList - List ContentArea = new List(); - ContentArea.Add(AreaList[0]); - AreaList.Remove(AreaList[0]); - // Aggiungo area - AreaList.Add(SashArea); - if (SashArea.nSashQty == 1) - { - // Inserisco il riempimento precedente - AreaList[0].AreaList.Add(ContentArea[0]); - AreaList[0].AreaList[0].SetParentArea(AreaList[0]); - } - else - { - // All'area Sash aggiunto uno Splitted per ogni anta - for (int i = 1; i < SashArea.nSashQty; i++) - { - AreaList[0].AreaList.Add(Splitted.CreateSplitted(SashArea)); - } - Fill fill2 = (Fill)ContentArea[0]; - for (int i = 1; i < SashArea.nSashQty; i++) - { - AreaList[0].AreaList[1].AreaList.Add(Fill.CreateFill(AreaList[0].AreaList[1], fill2.FillType)); - } - } - ParentWindow.OnUpdatePreview(ParentWindow.sSerialized()); } + // Salvo gli oggetti già presenti e li cancello da AreaList + List ContentArea = new List(); + ContentArea.Add(AreaList[0]); + AreaList.Remove(AreaList[0]); + // Aggiungo area + AreaList.Add(SashArea); + if (SashArea.nSashQty == 1) + { + // Inserisco il riempimento precedente + AreaList[0].AreaList.Add(ContentArea[0]); + AreaList[0].AreaList[0].SetParentArea(AreaList[0]); + } + else + { + // All'area Sash aggiunto uno Splitted per ogni anta + for (int i = 1; i < SashArea.nSashQty; i++) + { + AreaList[0].AreaList.Add(Splitted.CreateSplitted(SashArea)); + } + Fill fill2 = (Fill)ContentArea[0]; + for (int i = 1; i < SashArea.nSashQty; i++) + { + AreaList[0].AreaList[1].AreaList.Add(Fill.CreateFill(AreaList[0].AreaList[1], fill2.FillType)); + } + } + ParentWindow.OnUpdatePreview(ParentWindow.sSerialized()); } return answ; } diff --git a/WebWindowComplex/Models/Sash.cs b/WebWindowComplex/Models/Sash.cs index 2cbd581..767a381 100644 --- a/WebWindowComplex/Models/Sash.cs +++ b/WebWindowComplex/Models/Sash.cs @@ -540,7 +540,11 @@ namespace WebWindowComplex.Models public void SetSelFamilyHardware(string sFamilyHw) { m_SelFamilyHardware = sFamilyHw; - ReqRefreshShape(); + // se ho la shape aggiorno elenco HW + if (!string.IsNullOrEmpty(m_CurrShape)) + { + RefreshHardwareList(); + } RefreshHardwareOptionList(); SetFirstHardware(); } @@ -773,7 +777,6 @@ namespace WebWindowComplex.Models .Select(x => x.FamilyName) .FirstOrDefault(); SetSelFamilyHardware(item ?? ""); - //SelFamilyHardware = item ?? ""; } return SelFamilyHardware; } diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index abdef19..227d29a 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -27,6 +27,12 @@ namespace WebWindowComplex [Parameter] public SelectPayload? CurrSelection { get; set; } = null; + /// + /// Richiesta update da JWD (SVG, calcoli vari...) + /// + [Parameter] + public EventCallback> EC_DoUpdate { get; set; } + /// /// Richiesta chiusura JWD (+ refresh) /// se torna true --> richiesta salvataggio @@ -41,12 +47,6 @@ namespace WebWindowComplex [Parameter] public EventCallback EC_OnSelectedTemplate { get; set; } - /// - /// Richiesta update da JWD (SVG, calcoli vari...) - /// - [Parameter] - public EventCallback> EC_DoUpdate { get; set; } - /// /// Sollevo evento errore validazione con una lista di errori rilevati /// @@ -78,6 +78,31 @@ namespace WebWindowComplex } } + /// + /// Cerca e aggiorna la sash + /// + /// area corrente che si sta valutando + /// id della sash che si sta cercando + /// nuova sash + /// + public Area SearchSash(Area currentArea, int idSearch, Sash newSash) + { + if (currentArea.GroupId == idSearch && currentArea.AreaType.Equals(AreaTypes.SASH)) + { + currentArea = newSash; + return currentArea; + } + foreach (Area child in currentArea.AreaList) + { + Area found = SearchSash(child, idSearch, newSash); + if (found != null) + { + return found; + } + } + return null; + } + #endregion Public Methods #region Protected Fields @@ -107,8 +132,6 @@ namespace WebWindowComplex get => m_ItemTableList; } - protected string m_SelSVG { get; set; } = ""; - /// /// Componente SVG da mostrare /// @@ -130,10 +153,8 @@ namespace WebWindowComplex protected string SelColorMaterial { get; set; } = ""; protected string SelFamilyHardware { get; set; } = ""; protected string SelGlass { get; set; } = ""; - protected string SelProfile { get; set; } = ""; - protected string SelMaterial { get; set; } = ""!; - + protected string SelProfile { get; set; } = ""; protected TemplateSelectDTO? SelTemplateDTO { get; set; } = null; protected List SplitList @@ -584,7 +605,7 @@ namespace WebWindowComplex DictShape = LiveData.DictShape, SvgPreview = LiveData.SvgPreview }; - m_SelSVG = LiveData.SvgPreview; + // Aggiornati parametri di ingresso selezionati UpdateSelParameter(); JsonWindow WindowFromJson = new JsonWindow("", "", "", ""); @@ -667,7 +688,7 @@ namespace WebWindowComplex } } updateSvg = true; - } + } #endif if (SashList.Count > 0) { @@ -727,7 +748,7 @@ namespace WebWindowComplex if (LiveData.DictShape.Count > 0) { // Inserisco le forme ricevuto nei sash group - foreach(var item in LiveData.DictShape) + foreach (var item in LiveData.DictShape) { Sash sashNewShape = SashList.Where(x => x.GroupId == item.Key).ToList().First(); sashNewShape.SashShape = item.Value; @@ -845,9 +866,26 @@ namespace WebWindowComplex #region Private Methods + /// + /// Metodo per aggiungere una Sash + /// + /// + /// + private async Task AddSashIntoSplit(DataAreaSplitted Args) + { + Splitted currSplitted = Args.splitted; + bError = currSplitted.AddFirstSash(); + await DoPreviewSvg(); + } + private void AddSashToFrame(Frame f) { bError = f.AddFirstSash(); + // ricalcolo liste + UpdateLists(); + // richiedo update shape + List reqList = SashList.Select(x => x.GroupId).ToList(); + _ = DoReqShape(reqList); } private void AddSplitToFrame(Frame f) @@ -1027,18 +1065,6 @@ namespace WebWindowComplex await DoPreviewSvg(); } - /// - /// Metodo per aggiungere una Sash - /// - /// - /// - private async Task AddSashIntoSplit(DataAreaSplitted Args) - { - Splitted currSplitted = Args.splitted; - bError = currSplitted.AddFirstSash(); - await DoPreviewSvg(); - } - /// /// Metodo per copiare una Sash intera /// @@ -1255,6 +1281,28 @@ namespace WebWindowComplex FrameWindow = newFrame; await DoPreviewSvg(); } + + /// + /// Aggiornamento opzioni dato update sash + /// + /// nuova sash + /// + private async Task UpdateHwOptions(Sash newSash) + { + await DoReqOptHardware(); + } + + /// + /// Aggiornamento Sash e Frame + /// + /// nuova sash + /// + private async Task UpdateSash(Sash newSash) + { + SearchSash(FrameWindow, newSash.GroupId, newSash); + await DoPreviewSvg(); + } + /// /// Aggiornamento Shape x ogni Group di Sash della finestra /// @@ -1270,7 +1318,7 @@ namespace WebWindowComplex foreach (var item in SashList) { await DoReqShape(item.GroupId); - } + } #endif } @@ -1284,56 +1332,10 @@ namespace WebWindowComplex List reqList = new List() { groupId }; await DoReqShape(reqList); #if false - await DoReqShape(groupId); + await DoReqShape(groupId); #endif } - /// - /// Aggiornamento Sash e Frame - /// - /// nuova sash - /// - private async Task UpdateSash(Sash newSash) - { - SearchSash(FrameWindow, newSash.GroupId, newSash); - await DoPreviewSvg(); - } - - /// - /// Aggiornamento opzioni dato update sash - /// - /// nuova sash - /// - private async Task UpdateHwOptions(Sash newSash) - { - await DoReqOptHardware(); - } - - /// - /// Cerca e aggiorna la sash - /// - /// area corrente che si sta valutando - /// id della sash che si sta cercando - /// nuova sash - /// - public Area SearchSash(Area currentArea, int idSearch, Sash newSash) - { - if (currentArea.GroupId == idSearch && currentArea.AreaType.Equals(AreaTypes.SASH)) - { - currentArea = newSash; - return currentArea; - } - foreach (Area child in currentArea.AreaList) - { - Area found = SearchSash(child, idSearch, newSash); - if (found != null) - { - return found; - } - } - return null; - } - #endregion Private Methods } } \ No newline at end of file diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index bd74c69..63f768a 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.2314 + 2.7.10.2317 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -93,6 +93,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index e459d3c..7e103b8 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.2314 + 2.7.10.2317 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -168,6 +168,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + +