From 9cbe6df807d826945814fcd3b4aa8aa09b3121dd Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Tue, 17 Feb 2026 09:47:10 +0100 Subject: [PATCH] Modificato aggiornamento dimensioni split a causa di una variazione delle dimensioni del frame --- WebWindowComplex/Models/Area.cs | 33 ++++++++++++++++--- WebWindowComplex/Models/Frame.cs | 7 ++-- WebWindowComplex/WebWindowComplex.csproj | 5 ++- .../WebWindowConfigurator.csproj | 6 +++- 4 files changed, 41 insertions(+), 10 deletions(-) diff --git a/WebWindowComplex/Models/Area.cs b/WebWindowComplex/Models/Area.cs index 72c2a3f..bf1bf16 100644 --- a/WebWindowComplex/Models/Area.cs +++ b/WebWindowComplex/Models/Area.cs @@ -1,4 +1,5 @@ using System.ComponentModel.Design; +using System.Linq; using WebWindowComplex.Json; using static WebWindowComplex.Json.WindowConst; @@ -288,7 +289,21 @@ namespace WebWindowComplex.Models } } else - SearchAreaList(node.AreaList.ElementAt(i), dim, nameDim); + { + Frame? f = node.ParentWindow.AreaList.First(); + double dimAvail = 0; + if (nameDim.Equals("Width")) + dimAvail = dim - f.ElementDimensionList.ElementAt(1).dDimension + - f.ElementDimensionList.Last().dDimension + + f.ElementDimensionList.ElementAt(1).dOverlap + + f.ElementDimensionList.Last().dOverlap; + else + dimAvail = dim - f.ElementDimensionList.First().dDimension + - f.ElementDimensionList.ElementAt(f.ElementDimensionList.Count - 2).dDimension + + f.ElementDimensionList.First().dOverlap + + f.ElementDimensionList.ElementAt(f.ElementDimensionList.Count - 2).dOverlap; + SearchAreaList(node.AreaList.ElementAt(i), dimAvail, nameDim); + } } } } @@ -335,7 +350,8 @@ namespace WebWindowComplex.Models else { for (int i = 1; i < sash.SashList.Count; i++) - dim = dim + sash.SashList[i].ElementDimensionList.Last().dOverlap; + dim = dim + sash.SashList[i].ElementDimensionList.Last().dOverlap + + sash.SashList.First().ElementDimensionList.Last().dOverlap; } double res = dim - sum; if (res > 0) @@ -345,7 +361,7 @@ namespace WebWindowComplex.Models sashDim.SetDimension(sashDim.dDimension + res / countAbsolute); } } - else + else if (res < 0) { foreach (var sashDim in sash.SashList) { @@ -371,14 +387,23 @@ namespace WebWindowComplex.Models { Split split = (Split)area; List splitList = new List(); + double sum = 0; if (nameDim.Equals("Width")) + { splitList = split.SplitVertList; + foreach (var item in split.ElemDimVertList) + sum = sum + item.dDimension; + } else + { splitList = split.SplitHorizList; + foreach (var item in split.ElemDimHorizList) + sum = sum + item.dDimension; + } int countAbsolute = splitList.Where(x => x.MeasureType.Equals(MeasureTypes.ABSOLUTE)).Count(); if (countAbsolute != 0 && countAbsolute == splitList.Count) { - double sum = splitList.Sum(x => x.dDimension); + sum = sum + splitList.Sum(x => x.dDimension); double res = 0; res = dim - sum; if (res > 0) diff --git a/WebWindowComplex/Models/Frame.cs b/WebWindowComplex/Models/Frame.cs index b96adcd..92c3454 100644 --- a/WebWindowComplex/Models/Frame.cs +++ b/WebWindowComplex/Models/Frame.cs @@ -182,7 +182,7 @@ namespace WebWindowComplex.Models if (m_Shape != (Shapes)value) { Shapes oldShape = m_Shape; - Shapes SelShape = (Shapes)value; + m_Shape = (Shapes)value; // salvo vecchie dimensioni List oldDimensionList = new List(DimensionList); // verifico parametri Dimension @@ -190,7 +190,7 @@ namespace WebWindowComplex.Models //double widthVal = oldDimensionList.Where(x => x.sName.Equals("Width")).Select(x => x.dValue).First(); double widthVal = oldDimensionList.Where(x => x.sName.Equals("Width")).Select(x => x.dDimension).First(); // aggiungo Dimensioni - switch (SelShape) + switch (m_Shape) { case Shapes.RECTANGLE: case Shapes.ARC_FULL: @@ -277,7 +277,7 @@ namespace WebWindowComplex.Models SearchSash(sashList, this); // aggiungo Joint m_JointList.Clear(); - switch (SelShape) + switch (m_Shape) { case Shapes.RECTANGLE: case Shapes.RIGHTCHAMFER: @@ -353,7 +353,6 @@ namespace WebWindowComplex.Models // break; // } //} - m_Shape = SelShape; } } } diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 0a02c32..a64879d 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.2.1617 + 3.1.2.1709 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -158,6 +158,9 @@ + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index bd76ea0..d585018 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.2.1617 + 3.1.2.1709 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -139,6 +139,10 @@ + + + +