From 2aa207d0d7a73395e63686fc756911e27536fbbf Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Wed, 4 Mar 2026 14:48:23 +0100 Subject: [PATCH] - Gestione soglia quando viene eliminata anta - Gestione spessore split in anta o meno --- WebWindowComplex/Compo/AreaSash.razor.cs | 6 +-- WebWindowComplex/Compo/CardFill.razor.cs | 2 +- WebWindowComplex/Compo/CardFrame.razor.cs | 2 +- WebWindowComplex/Compo/CardSashGroup.razor.cs | 12 +++-- WebWindowComplex/Models/Frame.cs | 52 ++++++++++++++----- WebWindowComplex/Models/Split.cs | 11 ++-- WebWindowComplex/Models/SplitDimension.cs | 20 +++++-- WebWindowComplex/WebWindowComplex.csproj | 5 +- .../WebWindowConfigurator.csproj | 4 +- 9 files changed, 83 insertions(+), 31 deletions(-) diff --git a/WebWindowComplex/Compo/AreaSash.razor.cs b/WebWindowComplex/Compo/AreaSash.razor.cs index 61d504e..6e97cdd 100644 --- a/WebWindowComplex/Compo/AreaSash.razor.cs +++ b/WebWindowComplex/Compo/AreaSash.razor.cs @@ -197,7 +197,7 @@ namespace WebWindowComplex.Compo private Task ChangeAllJoints(Json.WindowConst.Joints JointType) { foreach (var item in CurrSashDim.JointList) - item.SetSelJointType(JointType); + item.SelJointType = JointType; return EC_UpdateSashDim.InvokeAsync(CurrSashDim); } @@ -260,12 +260,12 @@ namespace WebWindowComplex.Compo { case Openings.TILTTURN_LEFT: { - item.SetOpeningType(Openings.TURNONLY_LEFT); + item.SelOpeningType = Openings.TURNONLY_LEFT; break; } case Openings.TILTTURN_RIGHT: { - item.SetOpeningType(Openings.TURNONLY_RIGHT); + item.SelOpeningType = Openings.TURNONLY_RIGHT; break; } default: diff --git a/WebWindowComplex/Compo/CardFill.razor.cs b/WebWindowComplex/Compo/CardFill.razor.cs index 6ce6aa9..473968e 100644 --- a/WebWindowComplex/Compo/CardFill.razor.cs +++ b/WebWindowComplex/Compo/CardFill.razor.cs @@ -49,7 +49,7 @@ namespace WebWindowComplex.Compo /// protected Task ChangeOneFill(FillTypes reqFillType) { - CurrFill.SetFillType(reqFillType); + CurrFill.SelFillType = reqFillType; return EC_UpdateFill.InvokeAsync(CurrFill); } diff --git a/WebWindowComplex/Compo/CardFrame.razor.cs b/WebWindowComplex/Compo/CardFrame.razor.cs index a497069..b7a6559 100644 --- a/WebWindowComplex/Compo/CardFrame.razor.cs +++ b/WebWindowComplex/Compo/CardFrame.razor.cs @@ -201,7 +201,7 @@ namespace WebWindowComplex.Compo { foreach (Joint joint in CurrFrameWindow.JointList) { - joint.SetSelJointType(JointType); + joint.SelJointType = JointType; } var args = new DataUpdateFrame() { currFrame = CurrFrameWindow, svgNoHw = false }; return EC_UpdateFrame.InvokeAsync(args); diff --git a/WebWindowComplex/Compo/CardSashGroup.razor.cs b/WebWindowComplex/Compo/CardSashGroup.razor.cs index 6534975..2d1724b 100644 --- a/WebWindowComplex/Compo/CardSashGroup.razor.cs +++ b/WebWindowComplex/Compo/CardSashGroup.razor.cs @@ -1,3 +1,4 @@ +using Egw.Window.Data; using Microsoft.AspNetCore.Components; using WebWindowComplex.Models; using static WebWindowComplex.Json.WindowConst; @@ -117,9 +118,9 @@ namespace WebWindowComplex.Compo { CurrSashGroup.SashBottomRailQty = value; if (CurrSashGroup.SashBottomRailQty > 0) - CurrSashGroup.SetSashBottomRail(true); + CurrSashGroup.SashBottomRail = true; else - CurrSashGroup.SetSashBottomRail(false); + CurrSashGroup.SashBottomRail = false; var args = new DataUpdateSash() { currSash = CurrSashGroup @@ -204,7 +205,12 @@ namespace WebWindowComplex.Compo protected async Task RemoveArea() { CurrSashGroup.Remove(); - FrameWindow.SetSelThresholdFromName(FrameWindow.ThresholdList.FirstOrDefault(x => x.Name != "Threshold")?.Name); + if (FrameWindow.SelThreshold.Name.Contains("Threshold") && SashList.IndexOf(CurrSashGroup) == 0) + { + Threshold? updThreshold = FrameWindow.ThresholdList.FirstOrDefault(x => x.Name != "Threshold"); + if(updThreshold != null) + FrameWindow.SelThresholdFromName = updThreshold.Name; + } var args = new DataUpdateFrame() { currFrame = FrameWindow, diff --git a/WebWindowComplex/Models/Frame.cs b/WebWindowComplex/Models/Frame.cs index 9df4b76..5ae90f4 100644 --- a/WebWindowComplex/Models/Frame.cs +++ b/WebWindowComplex/Models/Frame.cs @@ -90,20 +90,27 @@ namespace WebWindowComplex.Models m_SelThreshold = newThreshold; else m_SelThreshold = new Threshold(3, "Bottom"); - string profileName = ""; - if (m_SelThreshold.Name.Equals("Threshold")) - profileName = "Frame_Sash_Threshold"; - else - profileName = "Frame_Sash_Bottom"; - ElementDimensionList.First().SetNameElement(profileName); - ElementDimensionList.First().SetMinDimension(Window.m_ParameterList.GetValueOrDefault(profileName + "_DimMin")); - ElementDimensionList.First().SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(profileName + "_DimMax")); - ElementDimensionList.First().SetDimension(Window.m_ParameterList.GetValueOrDefault(profileName + "_DimStd")); - string overlapName = "Sash_Bottom_Overlap"; - ElementDimensionList.First().SetOverlapElement(Window.m_ParameterList.GetValueOrDefault(overlapName)); - if (AreaList.Count > 0) + UpdateElemDimension(); + } + } + + public string SelThresholdFromName + { + get{ + return m_SelThreshold.Name; + } + set + { + // verifica ci sia un valore... + if (!string.IsNullOrEmpty(value) && m_ThresholdList != null && m_ThresholdList.Count > 0) { - SearchAreaList(this, AvailHeightArea(), "Height"); + m_SelThreshold = m_ThresholdList.Where(x => x.Name.Equals(value)).First(); + UpdateElemDimension(); + } + else + { + m_SelThreshold = m_ThresholdList!.FirstOrDefault() ?? new Threshold(3, "Bottom"); + UpdateElemDimension(); } } } @@ -722,6 +729,25 @@ namespace WebWindowComplex.Models } } + internal void UpdateElemDimension() + { + string profileName = ""; + if (m_SelThreshold.Name.Equals("Threshold")) + profileName = "Frame_Sash_Threshold"; + else + profileName = "Frame_Sash_Bottom"; + ElementDimensionList.First().SetNameElement(profileName); + ElementDimensionList.First().SetMinDimension(Window.m_ParameterList.GetValueOrDefault(profileName + "_DimMin")); + ElementDimensionList.First().SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(profileName + "_DimMax")); + ElementDimensionList.First().SetDimension(Window.m_ParameterList.GetValueOrDefault(profileName + "_DimStd")); + string overlapName = "Sash_Bottom_Overlap"; + ElementDimensionList.First().SetOverlapElement(Window.m_ParameterList.GetValueOrDefault(overlapName)); + if (AreaList.Count > 0) + { + SearchAreaList(this, AvailHeightArea(), "Height"); + } + } + #endregion Internal Methods #region Private Fields diff --git a/WebWindowComplex/Models/Split.cs b/WebWindowComplex/Models/Split.cs index 46784a4..16439ba 100644 --- a/WebWindowComplex/Models/Split.cs +++ b/WebWindowComplex/Models/Split.cs @@ -34,28 +34,31 @@ namespace WebWindowComplex.Models m_bSplitStartVert = value; m_ElemDimVertList.Clear(); m_ElemDimHorizList.Clear(); + double thickness = 78; + if (ParentArea.ParentArea is Sash) + thickness = 60; if (value) { for (int i = 0; i < nSplitQtyVert; i++) { - m_ElemDimVertList.Add(new SplitElementDimension(this, i + 1, 78, 0)); + m_ElemDimVertList.Add(new SplitElementDimension(this, i + 1, thickness, 0)); } for (int subArea = 0; subArea < m_SplitVertList.Count; subArea++) { for (int index = 0; index < nSplitQtyHoriz; index++) - m_ElemDimHorizList.Add(new SplitElementDimension(this, index + 1, 78, subArea + 1)); + m_ElemDimHorizList.Add(new SplitElementDimension(this, index + 1, thickness, subArea + 1)); } } else { for (int i = 0; i < nSplitQtyHoriz; i++) { - m_ElemDimHorizList.Add(new SplitElementDimension(this, i + 1, 78, 0)); + m_ElemDimHorizList.Add(new SplitElementDimension(this, i + 1, thickness, 0)); } for (int subArea = 0; subArea < m_SplitHorizList.Count; subArea++) { for (int index = 0; index < nSplitQtyVert; index++) - m_ElemDimVertList.Add(new SplitElementDimension(this, index + 1, 78, subArea + 1)); + m_ElemDimVertList.Add(new SplitElementDimension(this, index + 1, thickness, subArea + 1)); } } } diff --git a/WebWindowComplex/Models/SplitDimension.cs b/WebWindowComplex/Models/SplitDimension.cs index 2a404b5..c87ead2 100644 --- a/WebWindowComplex/Models/SplitDimension.cs +++ b/WebWindowComplex/Models/SplitDimension.cs @@ -289,13 +289,19 @@ namespace WebWindowComplex.Models if (bIsVertListDim) { splitList = m_Parent.SplitVertList; - splitElemList = m_Parent.ElemDimVertList; + if (Parent.bSplitStartVert) + splitElemList = m_Parent.ElemDimVertList; + else + splitElemList = m_Parent.ElemDimVertList.Where(x => x.nSubArea == 1).ToList(); dimSplitGroup = CalculateWidthSplitGroup(frame, frame.AvailWidthArea(), new AreaFound(-1, false)).m_Dimension; } else { splitList = m_Parent.SplitHorizList; - splitElemList = m_Parent.ElemDimHorizList; + if (Parent.bSplitStartVert) + splitElemList = m_Parent.ElemDimHorizList.Where(x => x.nSubArea == 1).ToList(); + else + splitElemList = m_Parent.ElemDimHorizList; dimSplitGroup = (CalculateHeightSplitGroup(frame, frame.AvailHeightArea(), new AreaFound(-1, false))).m_Dimension; } AreaDimension ad = new AreaDimension(dDimension, SelMeasureType, Parent); @@ -606,13 +612,19 @@ namespace WebWindowComplex.Models if (bIsVertListDim) { splitList = m_Parent.SplitVertList; - splitElemList = m_Parent.ElemDimVertList; + if (Parent.bSplitStartVert) + splitElemList = m_Parent.ElemDimVertList; + else + splitElemList = m_Parent.ElemDimVertList.Where(x => x.nSubArea == 1).ToList(); dimSplitGroup = CalculateWidthSplitGroup(frame, frame.AvailWidthArea(), new AreaFound(-1, false)).m_Dimension; } else { splitList = m_Parent.SplitHorizList; - splitElemList = m_Parent.ElemDimHorizList; + if (Parent.bSplitStartVert) + splitElemList = m_Parent.ElemDimHorizList; + else + splitElemList = m_Parent.ElemDimHorizList.Where(x => x.nSubArea == 1).ToList(); dimSplitGroup = (CalculateHeightSplitGroup(frame, frame.AvailHeightArea(), new AreaFound(-1, false))).m_Dimension; } AreaDimension ad = new AreaDimension(dDimension, SelMeasureType, Parent); diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 0ebabf6..e776bc8 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.3.318 + 3.1.3.414 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -266,6 +266,9 @@ + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 87e651f..f394bb7 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.3.318 + 3.1.3.414 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -221,6 +221,8 @@ + +