From 6636eacc044c61dcfe9bf8598e9c2c1030b55251 Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Mon, 2 Feb 2026 16:59:25 +0100 Subject: [PATCH] - Impostato calcolo per dimensione solo luce - Aggiunto reset lista profili elementi - Aggiunta richiesta lista profili elementi per gli split --- Test.UI/Components/Pages/EditJWD.razor.cs | 48 ++++- WebWindowComplex/Compo/AreaSash.razor | 6 - WebWindowComplex/Compo/AreaSash.razor.cs | 29 --- WebWindowComplex/Compo/CardFrame.razor.cs | 18 +- WebWindowComplex/Compo/CardSashGroup.razor | 4 + WebWindowComplex/Compo/CardSashGroup.razor.cs | 60 +++++- WebWindowComplex/Compo/CardSplit.razor | 38 ++-- WebWindowComplex/Compo/CardSplit.razor.cs | 19 +- WebWindowComplex/Compo/EditElement.razor.cs | 10 +- WebWindowComplex/Compo/EditSplitElement.razor | 6 +- .../Compo/EditSplitElement.razor.cs | 8 + WebWindowComplex/Json/JsonUtility.cs | 20 +- WebWindowComplex/LayoutConst.cs | 6 +- WebWindowComplex/Models/Area.cs | 2 +- WebWindowComplex/Models/Frame.cs | 104 +--------- WebWindowComplex/Models/Sash.cs | 31 ++- WebWindowComplex/Models/SashDimension.cs | 51 ++--- WebWindowComplex/Models/Split.cs | 37 ++-- WebWindowComplex/TableComp.razor | 1 + WebWindowComplex/TableComp.razor.cs | 64 +++++- WebWindowComplex/WebWindowComplex.csproj | 142 +------------- .../WebWindowConfigurator.csproj | 184 +----------------- 22 files changed, 335 insertions(+), 553 deletions(-) diff --git a/Test.UI/Components/Pages/EditJWD.razor.cs b/Test.UI/Components/Pages/EditJWD.razor.cs index 9cd526e..c7e0d11 100644 --- a/Test.UI/Components/Pages/EditJWD.razor.cs +++ b/Test.UI/Components/Pages/EditJWD.razor.cs @@ -250,7 +250,34 @@ namespace Test.UI.Components.Pages {"Sash_Slide_Movable_Side_DimStd", 80}, {"Sash_Slide_Movable_Top_DimMax", 90}, {"Sash_Slide_Movable_Top_DimMin", 70}, - {"Sash_Slide_Movable_Top_DimStd", 80} + {"Sash_Slide_Movable_Top_DimStd", 80}, + {"Frame_BottomRail_Overlap", 33.2}, + {"French_In_Overlap", 26}, + {"Mixed_Bottom_Overlap", 26}, + {"Mixed_Split_Bottom_Overlap", 41}, + {"Mixed_Split_Top_Overlap", 41}, + {"Mixed_Top_Overlap", 41}, + {"NO_Mixed_Bottom_Overlap", 26}, + {"NO_Mixed_Split_Bottom_Overlap", 41}, + {"NO_Mixed_Split_Top_Overlap", 41}, + {"NO_Slide_MovableBack_Threshold_Overlap", 0}, + {"NO_Slide_Threshold_Overlap", 0}, + {"Sash_Active_Overlap", 26}, + {"Sash_BottomRail_Overlap", 24.5}, + {"Sash_Bottom_Overlap", 26}, + {"Sash_Horizontal_Bottom_Overlap", 26}, + {"Sash_Horizontal_Top_Overlap", 41}, + {"Sash_Threshold_Overlap", 18}, + {"Sash_Top_Overlap", 41}, + {"Sash_Vertical_Overlap", 41}, + {"Slide_Active_Overlap", 80}, + {"Slide_Bottom_Overlap", 0}, + {"Slide_Fixed_Overlap", -5}, + {"Slide_MovableBack_Bottom_Overlap", 0}, + {"Slide_MovableBack_Threshold_Overlap", 0}, + {"Slide_Movable_Overlap", -5}, + {"Slide_Threshold_Overlap", 0}, + {"Slide_Top_Overlap", -12} }; private Dictionary ParamProfiloSaomad = new Dictionary() @@ -427,13 +454,20 @@ namespace Test.UI.Components.Pages break; case DataAction.ResetDictShape: - CurrData.DictShape = new Dictionary(); - break; - + { + CurrData.DictShape = new Dictionary(); + break; + } case DataAction.ResetHwOpt: - CurrData.DictOptionsXml = new Dictionary(); - break; - + { + CurrData.DictOptionsXml = new Dictionary(); + break; + } + case DataAction.ResetDimElem: + { + CurrData.ProfElementList = new List(); + break; + } default: break; } diff --git a/WebWindowComplex/Compo/AreaSash.razor b/WebWindowComplex/Compo/AreaSash.razor index a347404..42056c6 100644 --- a/WebWindowComplex/Compo/AreaSash.razor +++ b/WebWindowComplex/Compo/AreaSash.razor @@ -83,12 +83,6 @@
-
- -
-
- -
} diff --git a/WebWindowComplex/Compo/AreaSash.razor.cs b/WebWindowComplex/Compo/AreaSash.razor.cs index 05fa97e..149a2a1 100644 --- a/WebWindowComplex/Compo/AreaSash.razor.cs +++ b/WebWindowComplex/Compo/AreaSash.razor.cs @@ -280,35 +280,6 @@ namespace WebWindowComplex.Compo await EC_UpdateSash.InvokeAsync(args); } - /// - /// Metodo per cambiare l'anta su cui è presente la maniglia - /// - /// - private async Task ChangeTypeDimension() - { - if (CurrSashDim.SelMeasureType.Equals(MeasureTypes.ABSOLUTE)) - { - CurrSashDim.bDimensionLight = !CurrSashDim.bDimensionLight; - if (CurrSashDim.bDimensionLight) - { - CurrSashDim.dDimension = CurrSashDim.dDimension - - CurrSashDim.ElementDimensionList.ElementAt(1).dDimension - - CurrSashDim.ElementDimensionList.ElementAt(3).dDimension; - } - else - { - CurrSashDim.dDimension = CurrSashDim.dDimension + - CurrSashDim.ElementDimensionList.ElementAt(1).dDimension + - CurrSashDim.ElementDimensionList.ElementAt(3).dDimension; - } - DataUpdateProfile args = new DataUpdateProfile() - { - sash = CurrSashGroup - }; - await EC_UpdateSash.InvokeAsync(args); - } - } - /// /// Copio contenuto anta da indexCopy a IndexModify /// diff --git a/WebWindowComplex/Compo/CardFrame.razor.cs b/WebWindowComplex/Compo/CardFrame.razor.cs index c5c4dfd..ee3f71f 100644 --- a/WebWindowComplex/Compo/CardFrame.razor.cs +++ b/WebWindowComplex/Compo/CardFrame.razor.cs @@ -79,7 +79,8 @@ namespace WebWindowComplex.Compo CurrFrameWindow.SelShapeIndex = value; // richiesta reset dict shape _ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetDictShape}); - foreach(var s in SashList) + _ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetDimElem }); + foreach (var s in SashList) { s.SelHardwareFromId = "000000"; } @@ -88,8 +89,8 @@ namespace WebWindowComplex.Compo currFrame = CurrFrameWindow, svgNoHw = true }; - _ = EC_UpdateFrame.InvokeAsync(args); _ = EC_ReqElement.InvokeAsync(CurrFrameWindow); + _ = EC_UpdateFrame.InvokeAsync(args); } } } @@ -155,13 +156,14 @@ namespace WebWindowComplex.Compo private async Task AddSash() { CurrFrameWindow.AddFirstSash(); + _ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetDimElem }); var args = new DataUpdateFrame() { currFrame = CurrFrameWindow, svgNoHw = true }; - await EC_UpdateFrame.InvokeAsync(args); await EC_ReqElement.InvokeAsync(CurrFrameWindow); + await EC_UpdateFrame.InvokeAsync(args); } /// @@ -171,16 +173,17 @@ namespace WebWindowComplex.Compo private async Task AddSplit() { CurrFrameWindow.AddSplit(); + _ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetDimElem }); var args = new DataUpdateFrame() { currFrame = CurrFrameWindow, svgNoHw = true }; await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req=LayoutConst.DataAction.ResetDictShape}); - await EC_ReqOptionHw.InvokeAsync(CurrFrameWindow); - await EC_UpdateFrame.InvokeAsync(args); + if(SashList.Count > 0) + await EC_ReqOptionHw.InvokeAsync(CurrFrameWindow); await EC_ReqElement.InvokeAsync(CurrFrameWindow); - + await EC_UpdateFrame.InvokeAsync(args); } /// @@ -224,14 +227,15 @@ namespace WebWindowComplex.Compo if (updRec != null) { currRec = updRec; + _ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetDimElem }); var args = new DataUpdateFrame() { currFrame = CurrFrameWindow, svgNoHw = true }; await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetDictShape }); - await EC_UpdateFrame.InvokeAsync(args); await EC_ReqElement.InvokeAsync(CurrFrameWindow); + await EC_UpdateFrame.InvokeAsync(args); } } diff --git a/WebWindowComplex/Compo/CardSashGroup.razor b/WebWindowComplex/Compo/CardSashGroup.razor index b1025c6..b9ace2a 100644 --- a/WebWindowComplex/Compo/CardSashGroup.razor +++ b/WebWindowComplex/Compo/CardSashGroup.razor @@ -14,6 +14,10 @@ + @*
+ + +
*@ }
diff --git a/WebWindowComplex/Compo/CardSashGroup.razor.cs b/WebWindowComplex/Compo/CardSashGroup.razor.cs index 9e51a7f..a40d56e 100644 --- a/WebWindowComplex/Compo/CardSashGroup.razor.cs +++ b/WebWindowComplex/Compo/CardSashGroup.razor.cs @@ -90,15 +90,15 @@ namespace WebWindowComplex.Compo if (CurrSashGroup.nSashQty != value) { CurrSashGroup.nSashQty = value; + _ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetDimElem }); var args = new DataUpdateSash() { currSash = CurrSashGroup, svgNoHw = true }; - _ = EC_UpdateSashGroup.InvokeAsync(args); - _ = EC_ReqOptionHw.InvokeAsync(CurrSashGroup); _ = EC_ReqElement.InvokeAsync(CurrSashGroup); + _ = EC_ReqOptionHw.InvokeAsync(CurrSashGroup); } } } @@ -210,10 +210,44 @@ namespace WebWindowComplex.Compo }; // richiesta reset dict shape await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req=DataAction.ResetDictShape}); + await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDimElem}); await EC_UpdateFrame.InvokeAsync(args); await EC_ReqClose.InvokeAsync(true); } + /// + /// Metodo per cambiare l'anta su cui è presente la maniglia + /// + /// + //private async Task ChangeTypeDimension() + //{ + // CurrSashGroup.bIsDimensionLight = !CurrSashGroup.bIsDimensionLight; + // foreach(var CurrSashDim in CurrSashGroup.SashList) + // { + // if(CurrSashDim.SelMeasureType is MeasureTypes.ABSOLUTE) + // { + // if (CurrSashGroup.bIsDimensionLight) + // { + // CurrSashDim.SetDimensionLight(CurrSashDim.dDimension - + // CurrSashDim.ElementDimensionList.ElementAt(1).dDimension - + // CurrSashDim.ElementDimensionList.ElementAt(3).dDimension); + // } + // else + // { + // CurrSashDim.SetDimensionLight(CurrSashDim.dDimension + + // CurrSashDim.ElementDimensionList.ElementAt(1).dDimension + + // CurrSashDim.ElementDimensionList.ElementAt(3).dDimension); + // } + // } + // } + // DataUpdateSash args = new DataUpdateSash() + // { + // currSash = CurrSashGroup, + // noSvg = false + // }; + // await EC_UpdateSashGroup.InvokeAsync(args); + //} + /// /// Metodo per scegliere tipo di misura /// @@ -241,6 +275,7 @@ namespace WebWindowComplex.Compo /// protected async Task UpdateSashDimension(SashDimension updateSD) { + _ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetDimElem }); var currRec = CurrSashGroup.SashList.First(x => x.nSashId == updateSD.nSashId); if(currRec != null) { @@ -249,8 +284,8 @@ namespace WebWindowComplex.Compo { currSash = CurrSashGroup }; - await EC_UpdateSashGroup.InvokeAsync(args); await EC_ReqElement.InvokeAsync(CurrSashGroup); + await EC_UpdateSashGroup.InvokeAsync(args); } } @@ -261,6 +296,7 @@ namespace WebWindowComplex.Compo /// protected async Task UpdateSash(DataUpdateProfile updateS) { + _ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetDimElem }); if (updateS != null) { CurrSashGroup = updateS.sash; @@ -275,6 +311,24 @@ namespace WebWindowComplex.Compo } } + /// + /// Metodo per aggiornare sash + /// + /// + /// + protected async Task UpdateBottomRail(ElementDimension updRec) + { + var currRec = CurrSashGroup.BottomRailElemDimList.FirstOrDefault(x => x.ParentArea == updRec.ParentArea && x.nIndex == updRec.nIndex); + if (currRec != null) + { + currRec = updRec; + var args = new DataUpdateSash + { + currSash = CurrSashGroup + }; + await EC_UpdateSashGroup.InvokeAsync(args); + } + } #endregion Protected Methods #region Private Methods diff --git a/WebWindowComplex/Compo/CardSplit.razor b/WebWindowComplex/Compo/CardSplit.razor index cd01539..7d3f8f9 100644 --- a/WebWindowComplex/Compo/CardSplit.razor +++ b/WebWindowComplex/Compo/CardSplit.razor @@ -175,24 +175,30 @@ }
-
-
-
Element vert
+ @if(CurrSplit.nSplitQtyVert > 0) + { +
+
+
Element vert
+
+ @foreach (var element in CurrSplit.ElemDimVertList) + { + + }
- @foreach (var element in CurrSplit.ElemDimVertList) - { - - } -
-
-
-
Element horiz
+ } + @if(CurrSplit.nSplitQtyHoriz > 0) + { +
+
+
Element horiz
+
+ @foreach (var element in CurrSplit.ElemDimHorizList) + { + + }
- @foreach (var element in CurrSplit.ElemDimHorizList) - { - - } -
+ }
diff --git a/WebWindowComplex/Compo/CardSplit.razor.cs b/WebWindowComplex/Compo/CardSplit.razor.cs index e88d074..40efacc 100644 --- a/WebWindowComplex/Compo/CardSplit.razor.cs +++ b/WebWindowComplex/Compo/CardSplit.razor.cs @@ -57,6 +57,12 @@ namespace WebWindowComplex.Compo [Parameter] public EventCallback EC_UpdateFrame { get; set; } + /// + /// Evento per richiesta profili degli Element + /// + [Parameter] + public EventCallback EC_ReqElement { get; set; } + /// /// Evento per tornare nella pagine Tree /// @@ -76,6 +82,8 @@ namespace WebWindowComplex.Compo svgNoHw = true }; await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDictShape }); + await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDimElem }); + await EC_ReqElement.InvokeAsync(CurrSplit); await EC_UpdateSplit.InvokeAsync(args); } @@ -93,6 +101,7 @@ namespace WebWindowComplex.Compo }; // richiesta reset dict shape await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDictShape }); + await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDictShape }); await EC_UpdateFrame.InvokeAsync(args); await EC_ReqClose.InvokeAsync(true); } @@ -113,11 +122,13 @@ namespace WebWindowComplex.Compo { currSplit = CurrSplit }; + _ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetDimElem }); // Se la shape selezionata è grid o custom, richiede reset shape - if(value > 2) + if (value > 2) _ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDictShape }); if (SearchSash(CurrSplit)) _ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetHwOpt }); + _ = EC_ReqElement.InvokeAsync(CurrSplit); _ = EC_UpdateSplit.InvokeAsync(args); } } @@ -144,10 +155,12 @@ namespace WebWindowComplex.Compo if (CurrSplit.nSplitQtyVert != value) { CurrSplit.nSplitQtyVert = value; + _ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDimElem }); var args = new DataUpdateSplit() { currSplit = CurrSplit }; + _ = EC_ReqElement.InvokeAsync(CurrSplit); _ = EC_UpdateSplit.InvokeAsync(args); } } @@ -165,10 +178,12 @@ namespace WebWindowComplex.Compo if (CurrSplit.nSplitQtyHoriz != value) { CurrSplit.nSplitQtyHoriz = value; + _ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetDimElem }); var args = new DataUpdateSplit() { currSplit = CurrSplit }; + _ = EC_ReqElement.InvokeAsync(CurrSplit); _ = EC_UpdateSplit.InvokeAsync(args); } } @@ -225,7 +240,7 @@ namespace WebWindowComplex.Compo } /// - /// Metodo per rimuovere split + /// Metodo per cambiare la dimensione principale /// /// /// diff --git a/WebWindowComplex/Compo/EditElement.razor.cs b/WebWindowComplex/Compo/EditElement.razor.cs index cd30edb..14fd91c 100644 --- a/WebWindowComplex/Compo/EditElement.razor.cs +++ b/WebWindowComplex/Compo/EditElement.razor.cs @@ -17,6 +17,9 @@ namespace WebWindowComplex.Compo [Parameter] public EventCallback EC_Update { get; set; } + [Parameter] + public bool IsBottomRail { get; set; } = false; + /// /// Livello di accesso (utente base) /// @@ -31,8 +34,10 @@ namespace WebWindowComplex.Compo ///
private string name() { - if (CurrRec.ParentArea is Split) - return CurrRec.nIndex.ToString(); + if (IsBottomRail) + { + return CurrRec.nIndex.ToString(); + } else { int nElement = 0; @@ -124,6 +129,7 @@ namespace WebWindowComplex.Compo break; } } + } return ""; } diff --git a/WebWindowComplex/Compo/EditSplitElement.razor b/WebWindowComplex/Compo/EditSplitElement.razor index ceef888..d120612 100644 --- a/WebWindowComplex/Compo/EditSplitElement.razor +++ b/WebWindowComplex/Compo/EditSplitElement.razor @@ -1,10 +1,6 @@ @using static WebWindowComplex.LayoutConst
- @if (CurrRec.nSubArea > 0) - { - A:@(CurrRec.nSubArea) - } - N:@(CurrRec.nIndex) + @name() @if (User) { diff --git a/WebWindowComplex/Compo/EditSplitElement.razor.cs b/WebWindowComplex/Compo/EditSplitElement.razor.cs index 4dd56a1..2a94a83 100644 --- a/WebWindowComplex/Compo/EditSplitElement.razor.cs +++ b/WebWindowComplex/Compo/EditSplitElement.razor.cs @@ -42,6 +42,14 @@ namespace WebWindowComplex.Compo } } } + private string name() + { + string ans = ""; + if (CurrRec.nSubArea > 0) + ans = ans + "A:" + CurrRec.nSubArea + ", "; + ans = ans + "N:" + CurrRec.nIndex; + return ans; + } #endregion Private Properties } diff --git a/WebWindowComplex/Json/JsonUtility.cs b/WebWindowComplex/Json/JsonUtility.cs index 5ad3540..b8cecc9 100644 --- a/WebWindowComplex/Json/JsonUtility.cs +++ b/WebWindowComplex/Json/JsonUtility.cs @@ -349,6 +349,20 @@ namespace WebWindowComplex.Json } } + //private bool m_bIsDimensionLight; + //[JsonProperty] + //public bool IsDimensionLight + //{ + // get + // { + // return m_bIsDimensionLight; + // } + // set + // { + // m_bIsDimensionLight = value; + // } + //} + private List m_SashList = new List(); [JsonProperty] public List SashList @@ -465,6 +479,7 @@ namespace WebWindowComplex.Json public JsonSash(bool IsSashVertical, SashTypes SashType, bool SashBottomRail, int SashBottomRailQty, string Hardware, int GroupId) : base(AreaTypes.SASH) { m_bIsSashVertical = IsSashVertical; + //m_bIsDimensionLight = IsDimensionLight; m_SashType = SashType; m_bBottomRail = SashBottomRail; m_nBottomRailQty = SashBottomRailQty; @@ -477,6 +492,7 @@ namespace WebWindowComplex.Json Sash newSash = new Sash(ParentArea, ParentWindow); newSash.SetGroupId(GroupId); newSash.SetAreaType(AreaTypes.SASH); + //newSash.SetIsDimensionLight(IsDimensionLight); newSash.SetSashQty(m_SashList.Count); newSash.SetIsSashVertical(m_bIsSashVertical); newSash.SetSashBottomRail(m_bBottomRail); @@ -618,7 +634,7 @@ namespace WebWindowComplex.Json split.SetSplitQtyVert(0, m_SplitHorizList.Count - 1); else { - split.SetSplitQtyVert(m_SplitVertList.Count - 1, m_SplitHorizList.Count); + split.SetSplitQtyVert(m_SplitVertList.Count - 1, m_SplitHorizList.Count - 1); for (var SplitIndex = 0; SplitIndex <= m_SplitVertList.Count - 1; SplitIndex++) { split.SplitVertList[SplitIndex].SetIsRelative(m_SplitVertList[SplitIndex].IsRelative); @@ -636,7 +652,7 @@ namespace WebWindowComplex.Json split.SetSplitQtyHoriz(0, m_SplitVertList.Count); else { - split.SetSplitQtyHoriz(m_SplitHorizList.Count - 1, m_SplitVertList.Count); + split.SetSplitQtyHoriz(m_SplitHorizList.Count - 1, m_SplitVertList.Count - 1); for (var SplitIndex = 0; SplitIndex <= m_SplitHorizList.Count - 1; SplitIndex++) { split.SplitHorizList[SplitIndex].SetIsRelative(m_SplitHorizList[SplitIndex].IsRelative); diff --git a/WebWindowComplex/LayoutConst.cs b/WebWindowComplex/LayoutConst.cs index e563965..44ea954 100644 --- a/WebWindowComplex/LayoutConst.cs +++ b/WebWindowComplex/LayoutConst.cs @@ -41,7 +41,11 @@ namespace WebWindowComplex /// /// Reset dizionario HwOptions /// - ResetHwOpt + ResetHwOpt, + /// + /// Reset dizionario HwOptions + /// + ResetDimElem } } } diff --git a/WebWindowComplex/Models/Area.cs b/WebWindowComplex/Models/Area.cs index 54d7a03..1b521e9 100644 --- a/WebWindowComplex/Models/Area.cs +++ b/WebWindowComplex/Models/Area.cs @@ -137,8 +137,8 @@ namespace WebWindowComplex.Models // Aggiungo Area split di default Split SplitArea = Split.CreateSplit(this, SplitShapes.HORIZONTAL); // imposto i parametri di default - SplitArea.SetSplitQtyHoriz(1, 0); SplitArea.SetSplitStartVert(false); + SplitArea.SetSplitQtyHoriz(1, 0); // Aggiungo area AreaList.Add(SplitArea); // Creo le due aree Splitted diff --git a/WebWindowComplex/Models/Frame.cs b/WebWindowComplex/Models/Frame.cs index 8e01ca3..ab8a272 100644 --- a/WebWindowComplex/Models/Frame.cs +++ b/WebWindowComplex/Models/Frame.cs @@ -160,9 +160,10 @@ namespace WebWindowComplex.Models } set { - Shapes SelShape = (Shapes)value; - if (m_Shape != SelShape) + if (m_Shape != (Shapes)value) { + Shapes oldShape = m_Shape; + Shapes SelShape = (Shapes)value; // salvo vecchie dimensioni List oldDimensionList = new List(DimensionList); // verifico parametri Dimension @@ -307,7 +308,7 @@ namespace WebWindowComplex.Models break; } } - if (JointList.Count > 3) + if (oldShape is Shapes.TRIANGLE) { foreach (var s in sashList) { @@ -319,56 +320,6 @@ namespace WebWindowComplex.Models } } m_ElementDimensionList.Clear(); - // aggiungo Element Dimension - switch (SelShape) - { - case Shapes.RECTANGLE: - case Shapes.ARC_FULL: - case Shapes.RIGHTCHAMFER: - case Shapes.LEFTCHAMFER: - case Shapes.ARC: - { - for (int i = 0; i < 4; i++) - ElementDimensionList.Add(new ElementDimension(this, i + 1, 78)); - break; - } - - case Shapes.DOUBLECHAMFER: - case Shapes.DOUBLEARC: - { - for (int i = 0; i < 5; i++) - ElementDimensionList.Add(new ElementDimension(this, i + 1, 78)); - break; - } - - case Shapes.THREECENTERARC: - { - for (int i = 0; i < 6; i++) - ElementDimensionList.Add(new ElementDimension(this, i + 1, 78)); - if(sashList.Count > 0) - { - foreach(var sash in sashList) - { - foreach(var anta in sash.SashList) - anta.ElementDimensionList.Add(new ElementDimension(sash, 5, 78)); - } - } - break; - } - - case Shapes.TRIANGLE: - { - for (int i = 0; i < 3; i++) - ElementDimensionList.Add(new ElementDimension(this, i + 1, 78)); - break; - } - - case Shapes.CUSTOM: - { - ElementDimensionList.Clear(); - break; - } - } //switch (SelShape) //{ // case Shapes.RECTANGLE: @@ -707,53 +658,6 @@ namespace WebWindowComplex.Models ElementDimensionList.Last().dOverlap; } return -1; - //switch (m_Shape) - //{ - // case Shapes.RECTANGLE: - // case Shapes.RIGHTCHAMFER: - // case Shapes.LEFTCHAMFER: - // case Shapes.ARC: - // case Shapes.ARC_FULL: - // { - // // larghezza - elementDim(1) - elementDim(3) + overlapDd + overlapSx - // return DimensionList.FirstOrDefault(x => x.sName.Equals("Width")).dDimension - - // ElementDimensionList.ElementAt(1).dDimension - - // ElementDimensionList.ElementAt(3).dDimension + - // ElementDimensionList.ElementAt(1).dOverlap + - // ElementDimensionList.ElementAt(3).dOverlap; - // } - // case Shapes.DOUBLECHAMFER: - // case Shapes.DOUBLEARC: - // { - // // larghezza - elementDim(1) - elementDim(4) + overlapDd + overlapSx - // return DimensionList.FirstOrDefault(x => x.sName.Equals("Width")).dDimension - - // ElementDimensionList.ElementAt(1).dDimension - - // ElementDimensionList.ElementAt(4).dDimension + - // ElementDimensionList.ElementAt(1).dOverlap + - // ElementDimensionList.ElementAt(4).dOverlap; - // } - - // case Shapes.THREECENTERARC: - // { - // // larghezza - elementDim(1) - elementDim(5) + overlapDd + overlapSx - // return DimensionList.FirstOrDefault(x => x.sName.Equals("Width")).dDimension - - // ElementDimensionList.ElementAt(1).dDimension - - // ElementDimensionList.ElementAt(5).dDimension + - // ElementDimensionList.ElementAt(1).dOverlap + - // ElementDimensionList.ElementAt(5).dOverlap; - // } - - // case Shapes.TRIANGLE: - // { - // // larghezza - // return DimensionList.FirstOrDefault(x => x.sName.Equals("Width")).dDimension; - // } - - // case Shapes.CUSTOM: - // { - // return -1; - // } - // } } #endregion Internal Methods diff --git a/WebWindowComplex/Models/Sash.cs b/WebWindowComplex/Models/Sash.cs index 17ce4fa..4d6ddcf 100644 --- a/WebWindowComplex/Models/Sash.cs +++ b/WebWindowComplex/Models/Sash.cs @@ -34,6 +34,26 @@ namespace WebWindowComplex.Models #region Public Properties + /// + /// Dimensione solo luce + /// true --> dimensione solo luce + /// false --> dimensione totale + /// + public bool bIsDimensionLight + { + get + { + return m_IsbDimensionLight; + } + set + { + if (m_IsbDimensionLight != value) + { + m_IsbDimensionLight = value; + } + } + } + public bool bIsSashVertical { get @@ -247,8 +267,8 @@ namespace WebWindowComplex.Models { if (value > 0 && value <= 3) { - // TODO: width se anta è in un'area di split - double widthTot = ((Frame)ParentArea).AvailArea(); + double widthTot = CalculateWidthArea(ParentWindow.AreaList.First(), ParentWindow.AreaList.FirstOrDefault().DimensionList.Where(x => x.sName == "Width").First().dDimension); // TODO: width se anta è in un'area di split + //double widthTot = ((Frame)ParentArea).AvailArea(); if (value > m_SashList.Count) { // recupero larghezza ultimo @@ -698,7 +718,10 @@ namespace WebWindowComplex.Models #endregion Public Methods #region Internal Methods - + internal void SetIsDimensionLight(bool DimensionLight) + { + m_IsbDimensionLight = DimensionLight; + } internal static Sash CreateSash(Area Area) { Sash newSash = new Sash(Area, Area.ParentWindow); @@ -1052,6 +1075,8 @@ namespace WebWindowComplex.Models private OrientationSash m_SelOrientationSashType; //private SashArcElement m_SashArcElement; + private bool m_IsbDimensionLight = false; + #endregion Private Fields #region Private Methods diff --git a/WebWindowComplex/Models/SashDimension.cs b/WebWindowComplex/Models/SashDimension.cs index a0209eb..8ff5213 100644 --- a/WebWindowComplex/Models/SashDimension.cs +++ b/WebWindowComplex/Models/SashDimension.cs @@ -153,6 +153,21 @@ namespace WebWindowComplex.Models { double widthTot = CalculateWidthSashGroup(m_Parent.ParentWindow.AreaList.FirstOrDefault()!, m_Parent.ParentWindow.AreaList.FirstOrDefault()!.DimensionList.Where(x => x.sName == "Width").First().dDimension); //double widthTot = ((Frame)m_Parent.ParentArea).AvailArea(); + //if (m_Parent.bIsDimensionLight) + //{ + // for (int i = 0; i < m_Parent.SashList.Count; i++) + // { + // if(i == 0) + // widthTot = widthTot + // - m_Parent.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dDimension + // - m_Parent.SashList.ElementAt(i).ElementDimensionList.Last().dDimension; + // else + // widthTot = widthTot + // - m_Parent.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dDimension + // - m_Parent.SashList.ElementAt(i).ElementDimensionList.Last().dDimension + // + m_Parent.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dOverlap; + // } + //} double valMinAbsolute = 100; double valMaxAbsolute = widthTot - valMinAbsolute * (m_Parent.SashList.Count - 1); bool valueAccept = false; @@ -318,26 +333,6 @@ namespace WebWindowComplex.Models } } - /// - /// Dimensione solo luce - /// true --> dimensione solo luce - /// false --> dimensione totale - /// - public bool bDimensionLight - { - get - { - return m_bDimensionLight; - } - set - { - if(m_bDimensionLight != value) - { - m_bDimensionLight = value; - } - } - } - public int nSashId { get @@ -411,11 +406,20 @@ namespace WebWindowComplex.Models if (m_Parent.ParentWindow.AreaList.FirstOrDefault() != null) { double widthTot = CalculateWidthSashGroup(m_Parent.ParentWindow.AreaList.FirstOrDefault()!, m_Parent.ParentWindow.AreaList.FirstOrDefault()!.DimensionList.Where(x => x.sName == "Width").First().dDimension); + // TODO: availArea per aree che non sono frame + //double widthTot = ((Frame)m_Parent.ParentArea).AvailArea(); AreaDimension ad = new AreaDimension(m_dDimension, SelMeasureType); List adList = new List(); foreach (var it in m_Parent.SashList) { adList.Add(new AreaDimension(it.m_dDimension, it.SelMeasureType)); + //if (it.SelMeasureType is MeasureTypes.ABSOLUTE) + //{ + // if (it.bHasHandle) + // adList.Add(new AreaDimension(it.m_dDimension - (it.ElementDimensionList.ElementAt(1).dOverlap) / 2, it.SelMeasureType)); + // else + // adList.Add(new AreaDimension(it.m_dDimension - (it.ElementDimensionList.Last().dOverlap) / 2, it.SelMeasureType)); + //} } m_dDimension = ad.ConvertDimension(adList, SelMeasureType, newType, widthTot, nSashId-1); SelMeasureType = (MeasureTypes)value; @@ -455,6 +459,11 @@ namespace WebWindowComplex.Models #region Internal Methods + internal void SetDimensionLight(double Dimension) + { + m_dDimension = Dimension; + } + /// /// Metodo per calcolare larghezza intera sash group /// @@ -648,8 +657,6 @@ namespace WebWindowComplex.Models private List m_ElementDimensionList = new List(); private Openings m_SelOpeningType; - private bool m_bDimensionLight = false; - #endregion Private Fields } diff --git a/WebWindowComplex/Models/Split.cs b/WebWindowComplex/Models/Split.cs index bd12a2d..14acccb 100644 --- a/WebWindowComplex/Models/Split.cs +++ b/WebWindowComplex/Models/Split.cs @@ -105,16 +105,16 @@ namespace WebWindowComplex.Models // aggiungo area Split di default for (var SplitIndex = m_SplitHorizList.Count; SplitIndex <= value; SplitIndex++) m_SplitHorizList.Add(new SplitDimension(dNewDimension, m_SplitHorizList[m_SplitHorizList.Count - 1].MeasureType, true, this, false)); - //ElemDimHorizList.Add(new SplitElementDimension(this, ElemDimHorizList.Count, 78)); if (!m_bSplitStartVert) { //Aggiungo un elemento alla sottoarea principale ElemDimHorizList.Add(new SplitElementDimension(this, ElemDimHorizList.Max(x => x.nIndex) + 1, 78, 0)); - // Aggiungo a tutte le sottoaree degli element - int subArea = ElemDimVertList.Max(x => x.nSubArea) + 1; - for (int i = 1; i <= ElemDimVertList.Max(x => x.nIndex); i++) + if(nSplitQtyVert > 0) { - ElemDimVertList.Add(new SplitElementDimension(this, i, 78, subArea)); + // Aggiungo a tutte le sottoaree degli element + int subArea = ElemDimVertList.Max(x => x.nSubArea) + 1; + for (int i = 1; i <= ElemDimVertList.Max(x => x.nIndex); i++) + ElemDimVertList.Add(new SplitElementDimension(this, i, 78, subArea)); } } else @@ -151,7 +151,8 @@ namespace WebWindowComplex.Models { int deleteSubArea = ElemDimHorizList.Count + 1; ElemDimHorizList.RemoveAt(ElemDimHorizList.Count - 1); - ElemDimVertList.RemoveAll(x => x.nSubArea == deleteSubArea); + if(nSplitQtyVert > 0) + ElemDimVertList.RemoveAll(x => x.nSubArea == deleteSubArea); } } // Controllo quanti split verticali ci sono @@ -238,11 +239,12 @@ namespace WebWindowComplex.Models { //Aggiungo un elemento alla sottoarea principale ElemDimVertList.Add(new SplitElementDimension(this, ElemDimVertList.Max(x => x.nIndex) + 1, 78, 0)); - // Aggiungo a tutte le sottoaree degli element - int subArea = ElemDimHorizList.Max(x => x.nSubArea) + 1; - for (int i = 1; i <= ElemDimHorizList.Max(x => x.nIndex); i++) + if(nSplitQtyHoriz > 0) { - ElemDimHorizList.Add(new SplitElementDimension(this, i, 78, subArea)); + // Aggiungo a tutte le sottoaree degli element + int subArea = ElemDimHorizList.Max(x => x.nSubArea) + 1; + for (int i = 1; i <= ElemDimHorizList.Max(x => x.nIndex); i++) + ElemDimHorizList.Add(new SplitElementDimension(this, i, 78, subArea)); } } else @@ -284,7 +286,8 @@ namespace WebWindowComplex.Models { int deleteSubArea = ElemDimVertList.Count + 1; ElemDimVertList.RemoveAt(ElemDimVertList.Count - 1); - ElemDimHorizList.RemoveAll(x=>x.nSubArea == deleteSubArea); + if(nSplitQtyHoriz > 0) + ElemDimHorizList.RemoveAll(x=>x.nSubArea == deleteSubArea); } else { @@ -357,25 +360,25 @@ namespace WebWindowComplex.Models m_SelSplitShape = (SplitShapes)value; // Azzero quantità orizzontale e verticale SetSplitQtyVert(0, 0); - SetSplitQtyHoriz(0,0); + SetSplitQtyHoriz(0, 0); if (m_SelSplitShape == SplitShapes.VERTICAL) { // Inserisco valori di default - SetSplitQtyVert(1, 0); SetSplitStartVert(true); + SetSplitQtyVert(1, 0); } else if (m_SelSplitShape == SplitShapes.HORIZONTAL) { // Inserisco valori di default - SetSplitQtyHoriz(1,0); SetSplitStartVert(false); + SetSplitQtyHoriz(1, 0); } else { // Inserisco valori di default + SetSplitStartVert(true); SetSplitQtyVert(1, 1); SetSplitQtyHoriz(1, 1); - SetSplitStartVert(true); } if(OldSelShapeSplit == SplitShapes.GRID || m_SelSplitShape == SplitShapes.GRID) { @@ -635,7 +638,7 @@ namespace WebWindowComplex.Models { if (bSplitStartVert) { - for(int subArea = 0; subArea < QtyVert; subArea++) + for(int subArea = 0; subArea <= QtyVert; subArea++) { for (int i = 0; i < QtyHoriz; i++) ElemDimHorizList.Add(new SplitElementDimension(this, i + 1, 78, subArea+1)); @@ -686,7 +689,7 @@ namespace WebWindowComplex.Models } else { - for(int subArea = 0; subArea< QtyHoriz; subArea++) + for(int subArea = 0; subArea <= QtyHoriz; subArea++) { for (int i = 0; i < QtyVert; i++) ElemDimVertList.Add(new SplitElementDimension(this, i+1, 78, subArea + 1)); diff --git a/WebWindowComplex/TableComp.razor b/WebWindowComplex/TableComp.razor index f6200f6..6b9fbe7 100644 --- a/WebWindowComplex/TableComp.razor +++ b/WebWindowComplex/TableComp.razor @@ -118,6 +118,7 @@ EC_UpdateFrame="UpdatePreviewFrame" EC_ReqResetDict="ReqResetDict" EC_UpdateSplit="UpdatePreviewSplit" + EC_ReqElement="UpdateElementSplit" EC_ReqClose="ReturnTree"> diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index b2a4fe5..2ec021c 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -790,7 +790,6 @@ namespace WebWindowComplex ///
protected void UpdateInputList(JsonWindow WindowFromJson) { - //Frame.m_AllThresholdList = ListPayload.Threshold; string profile = WindowFromJson.ProfilePath; Window.m_ParameterList = ListPayload.ProfileList?.FirstOrDefault(x => x.ProfileName.Equals(profile))?.ParameterDict ?? new(); Frame.m_AllThresholdList = ListPayload.ProfileList?.FirstOrDefault(x => x.ProfileName.Equals(profile))?.ThresholdList ?? new(); @@ -926,7 +925,7 @@ namespace WebWindowComplex } if (ListPayload.ProfileList == null || ListPayload.ProfileList.Count == 0) { - listErrPre.Add("Profile", "Missing Profile List!"); + listErrPre.Add("Profile", "Missing Profile data!"); } } @@ -1106,6 +1105,7 @@ namespace WebWindowComplex { // Cerco area corrispondente al GroupId Area? found = SearchAreaFromGroupId(FrameWindow, GroupIdSearch); + List elemList = new List(); if(found != null) { switch (found.AreaType) @@ -1113,10 +1113,18 @@ namespace WebWindowComplex case AreaTypes.FRAME: { Frame frame = (Frame)found; - for(int i = 0; i < frame.ElementDimensionList.Count; i++) + for (int index = frame.ElementDimensionList.Count; index < profileNameList.Count; index++) + { + double valStd = Window.m_ParameterList.GetValueOrDefault(profileNameList.ElementAt(index) + "_DimStd"); + frame.ElementDimensionList.Add(new ElementDimension(frame, index + 1, valStd)); + } + for (int i = 0; i < frame.ElementDimensionList.Count; i++) { frame.ElementDimensionList.ElementAt(i).SetNameElement(profileNameList.ElementAt(i)); } + for (int index = profileNameList.Count; index < frame.ElementDimensionList.Count; index++) + frame.ElementDimensionList.RemoveAt(index); + elemList = frame.ElementDimensionList; break; } case AreaTypes.SASH: @@ -1128,10 +1136,13 @@ namespace WebWindowComplex double valStd = Window.m_ParameterList.GetValueOrDefault(profileNameList.ElementAt(index) + "_DimStd"); anta.ElementDimensionList.Add(new ElementDimension(sash, index + 1, valStd)); } + for (int index = profileNameList.Count; index < anta.ElementDimensionList.Count; index++) + anta.ElementDimensionList.RemoveAt(index); for (int i = 0; i < anta.ElementDimensionList.Count; i++) { anta.ElementDimensionList.ElementAt(i).SetNameElement(profileNameList.ElementAt(i)); } + elemList = anta.ElementDimensionList; break; } case AreaTypes.SPLIT: @@ -1139,10 +1150,23 @@ namespace WebWindowComplex Split split = (Split)found; List SpElemList = split.searchElemFromSubArea(EntityIdSearch); for(int i = 0; i < SpElemList.Count; i++) + { SpElemList.ElementAt(i).SetNameElement(profileNameList.ElementAt(i)); + SpElemList.ElementAt(i).SetMinDimension(Window.m_ParameterList.GetValueOrDefault(SpElemList.ElementAt(i).sName + "_DimMin")); + SpElemList.ElementAt(i).SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(SpElemList.ElementAt(i).sName + "_DimMax")); + string overlapName = string.Join("_", SpElemList.ElementAt(i).sName.Split('_').Skip(1)); + SpElemList.ElementAt(i).SetOverlapElement(Window.m_ParameterList.GetValueOrDefault(SpElemList.ElementAt(i).sName + "_Overlap")); + } break; } } + foreach(var item in elemList) + { + item.SetMinDimension(Window.m_ParameterList.GetValueOrDefault(item.sName + "_DimMin")); + item.SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(item.sName + "_DimMax")); + string overlapName = string.Join("_", item.sName.Split('_').Skip(1)); + item.SetOverlapElement(Window.m_ParameterList.GetValueOrDefault(overlapName + "_Overlap")); + } } } @@ -1296,6 +1320,11 @@ namespace WebWindowComplex } } + /// + /// Aggiornamento Element a causa di un cambiamento nella sash + /// + /// + /// private async Task UpdateElementSash(Sash newSash) { if (newSash != null) @@ -1305,8 +1334,24 @@ namespace WebWindowComplex await UpdateElement(FrameWindow); } } + /// - /// Aggiornamento Element della Window + /// Aggiornamento Element a causa di un cambiamento nello split + /// + /// + /// + private async Task UpdateElementSplit(Split newSplit) + { + if (newSplit != null) + { + Split currRec = (Split)SearchAreaFromGroupId(FrameWindow, newSplit.GroupId)!; + currRec = newSplit; + await UpdateElement(FrameWindow); + } + } + + /// + /// Aggiornamento Element a casua di un cambiamento nel frame /// /// nuovo frame /// @@ -1322,8 +1367,9 @@ namespace WebWindowComplex await UpdateElement(FrameWindow); } } + /// - /// Aggiornamento Element della Window + /// Aggiornamento Element /// /// nuovo frame /// @@ -1334,8 +1380,14 @@ namespace WebWindowComplex // richiedo update element del frame List reqList = new List(); reqList.Add(FrameWindow.GroupId); + // Aggiorno le liste sash, split + m_FillList = new List(); + m_SashList = new List(); + m_SplitList = new List(); + m_SplittedList = new List(); + CreateWindowsList((m_CurrWindow!).AreaList.First(), false); // richiedo update element della sash (se presenti) - if(SashList.Count > 0) + if (SashList.Count > 0) { foreach(var item in SashList) { diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 7fb984e..c805b56 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.8.1.3010 + 2.8.2.216 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -31,143 +31,3 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index d49fee1..5f880e9 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.8.1.3010 + 2.8.2.216 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -37,185 +37,3 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -