From 04d2b8201e728758d11b6b89943422e6bde2b047 Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Fri, 23 Jan 2026 09:24:49 +0100 Subject: [PATCH] - Eliminate aree deprecate - Aggiunti parametri min e max degli elementi del frame e split --- Test.UI/Components/Pages/BaseEdit.razor.cs | 185 +++++++++++++- Test.UI/Components/Pages/EditJWD.razor.cs | 135 ++++++++-- Test.UI/Components/Pages/Home.razor.cs | 12 - Test.UI/Data/FinestraSplitVert.jwd | 6 + WebWindowComplex/Compo/CardSplit.razor | 4 + WebWindowComplex/Compo/EditElement.razor | 2 +- WebWindowComplex/Compo/EditElement.razor.cs | 35 ++- WebWindowComplex/DTO/BaseListPayload.cs | 22 -- WebWindowComplex/Json/JsonUtility.cs | 12 + WebWindowComplex/Models/ElementDimension.cs | 56 +++-- WebWindowComplex/Models/Split.cs | 48 ++++ WebWindowComplex/TableComp.razor.cs | 237 ++++++++++++++++-- WebWindowComplex/WebWindowComplex.csproj | 14 +- .../WebWindowConfigurator.csproj | 13 +- 14 files changed, 688 insertions(+), 93 deletions(-) diff --git a/Test.UI/Components/Pages/BaseEdit.razor.cs b/Test.UI/Components/Pages/BaseEdit.razor.cs index 14aec17..1610892 100644 --- a/Test.UI/Components/Pages/BaseEdit.razor.cs +++ b/Test.UI/Components/Pages/BaseEdit.razor.cs @@ -89,16 +89,172 @@ namespace Test.UI.Components.Pages new string("Abete") }; - protected List AvailProfileList { get; set; } = new List() + /// + /// Lista profili da DB + /// + private List AvailProfileList = new List(); + + private List ThresholdProfilo78 = new List() { - new string("Profilo78"), - new string("ProfiloSaomad") + { new Threshold(3, "Bottom") }, + { new Threshold(1, "Threshold") } }; - protected Dictionary> AvailThreshold { get; set; } = new Dictionary>() + private List ThresholdProfiloSaomad = new List() { - {"Profilo78", new List() { new Threshold(3, "Bottom"), new Threshold(1, "Threshold")}}, - {"ProfiloSaomad", new List(){ new Threshold(3, "Bottom"), new Threshold(2, "BottomWaterdrip"), new Threshold(1, "Threshold")}} + { new Threshold(3, "Bottom") }, + { new Threshold(2, "BottomWaterdrip") }, + { new Threshold(1, "Threshold") } + }; + + private Dictionary ParamProfilo78 = new Dictionary() + { + {"Frame_Fill_Rail_DimMax", 85}, + {"Frame_Fill_Rail_DimMin", 70}, + {"Frame_Fill_Rail_DimStd", 72}, + {"Frame_Fixed_Bottom_DimMax", 80}, + {"Frame_Fixed_Bottom_DimMin", 70}, + {"Frame_Fixed_Bottom_DimStd", 78}, + {"Frame_Fixed_Top_DimMax", 80}, + {"Frame_Fixed_Top_DimMin", 70}, + {"Frame_Fixed_Top_DimStd", 78}, + {"Frame_Frame_Split_DimMax", 85}, + {"Frame_Frame_Split_DimMin", 55}, + {"Frame_Frame_Split_DimStd", 60}, + {"Frame_Mixed_Bottom_DimMax", 80}, + {"Frame_Mixed_Bottom_DimMin", 70}, + {"Frame_Mixed_Bottom_DimStd", 78}, + {"Frame_Mixed_Split_DimMax", 110}, + {"Frame_Mixed_Split_DimMin", 70}, + {"Frame_Mixed_Split_DimStd", 90}, + {"Frame_Mixed_Top_DimMax", 80}, + {"Frame_Mixed_Top_DimMin", 70}, + {"Frame_Mixed_Top_DimStd", 78}, + {"Frame_Rail_Bottom_DimMax", 80}, + {"Frame_Rail_Bottom_DimMin", 70}, + {"Frame_Rail_Bottom_DimStd", 78}, + {"Frame_Rail_DimMax", 78}, + {"Frame_Rail_DimMin", 68}, + {"Frame_Rail_DimStd", 72}, + {"Frame_Sash_Bottom_DimMax", 80}, + {"Frame_Sash_Bottom_DimMin", 70}, + {"Frame_Sash_Bottom_DimStd", 78}, + {"Frame_Sash_Horizontal_DimMax", 110}, + {"Frame_Sash_Horizontal_DimMin", 75}, + {"Frame_Sash_Horizontal_DimStd", 95}, + {"Frame_Sash_Threshold_DimMax", 26}, + {"Frame_Sash_Threshold_DimMin", 24}, + {"Frame_Sash_Threshold_DimStd", 25}, + {"Frame_Sash_Top_DimMax", 80}, + {"Frame_Sash_Top_DimMin", 70}, + {"Frame_Sash_Top_DimStd", 78}, + {"Frame_Sash_Vertical_DimMax", 110}, + {"Frame_Sash_Vertical_DimMin", 75}, + {"Frame_Sash_Vertical_DimStd", 95}, + {"Frame_Slide_Bottom_DimMax", 60}, + {"Frame_Slide_Bottom_DimMin", 50}, + {"Frame_Slide_Bottom_DimStd", 55}, + {"Frame_Slide_Fixed_DimMax", 60}, + {"Frame_Slide_Fixed_DimMin", 50}, + {"Frame_Slide_Fixed_DimStd", 55}, + {"Frame_Slide_MovableBack_Bottom_DimMax", 60}, + {"Frame_Slide_MovableBack_Bottom_DimMin", 50}, + {"Frame_Slide_MovableBack_Bottom_DimStd", 55}, + {"Frame_Slide_MovableBack_Threshold_DimMax", 10}, + {"Frame_Slide_MovableBack_Threshold_DimMin", 3}, + {"Frame_Slide_MovableBack_Threshold_DimStd", 4}, + {"Frame_Slide_Movable_DimMax", 60}, + {"Frame_Slide_Movable_DimMin", 50}, + {"Frame_Slide_Movable_DimStd", 55}, + {"Frame_Slide_Threshold_DimMax", 10}, + {"Frame_Slide_Threshold_DimMin", 3}, + {"Frame_Slide_Threshold_DimStd", 4}, + {"Frame_Slide_Top_DimMax", 60}, + {"Frame_Slide_Top_DimMin", 50}, + {"Frame_Slide_Top_DimStd", 55}, + {"Sash_Fill_Rail_DimMax", 80}, + {"Sash_Fill_Rail_DimMin", 70}, + {"Sash_Fill_Rail_DimStd", 78}, + {"Sash_Frame_Bottom_DimMax", 80}, + {"Sash_Frame_Bottom_DimMin", 70}, + {"Sash_Frame_Bottom_DimStd", 78}, + {"Sash_Frame_Top_DimMax", 80}, + {"Sash_Frame_Top_DimMin", 70}, + {"Sash_Frame_Top_DimStd", 78}, + {"Sash_French_In_DimMax", 80}, + {"Sash_French_In_DimMin", 70}, + {"Sash_French_In_DimStd", 78}, + {"Sash_French_Out_DimMax", 80}, + {"Sash_French_Out_DimMin", 70}, + {"Sash_French_Out_DimStd", 78}, + {"Sash_Rail_Bottom_DimMax", 80}, + {"Sash_Rail_Bottom_DimMin", 70}, + {"Sash_Rail_Bottom_DimStd", 78}, + {"Sash_Rail_DimMax", 80}, + {"Sash_Rail_DimMin", 70}, + {"Sash_Rail_DimStd", 78}, + {"Sash_Sash_Active_DimMax", 80}, + {"Sash_Sash_Active_DimMin", 70}, + {"Sash_Sash_Active_DimStd", 78}, + {"Sash_Sash_Inactive_DimMax", 80}, + {"Sash_Sash_Inactive_DimMin", 70}, + {"Sash_Sash_Inactive_DimStd", 78}, + {"Sash_Sash_Split_DimMax", 70}, + {"Sash_Sash_Split_DimMin", 50}, + {"Sash_Sash_Split_DimStd", 60}, + {"Sash_Slide_Active_DimMax", 90}, + {"Sash_Slide_Active_DimMin", 70}, + {"Sash_Slide_Active_DimStd", 80}, + {"Sash_Slide_Active_In_DimMax", 90}, + {"Sash_Slide_Active_In_DimMin", 70}, + {"Sash_Slide_Active_In_DimStd", 80}, + {"Sash_Slide_Fixed_Bottom_DimMax", 150}, + {"Sash_Slide_Fixed_Bottom_DimMin", 120}, + {"Sash_Slide_Fixed_Bottom_DimStd", 135}, + {"Sash_Slide_Fixed_Side_DimMax", 90}, + {"Sash_Slide_Fixed_Side_DimMin", 70}, + {"Sash_Slide_Fixed_Side_DimStd", 80}, + {"Sash_Slide_Fixed_Top_DimMax", 90}, + {"Sash_Slide_Fixed_Top_DimMin", 70}, + {"Sash_Slide_Fixed_Top_DimStd", 80}, + {"Sash_Slide_Inactive_DimMax", 90}, + {"Sash_Slide_Inactive_DimMin", 70}, + {"Sash_Slide_Inactive_DimStd", 80}, + {"Sash_Slide_MovableBack_Bottom_DimMax", 150}, + {"Sash_Slide_MovableBack_Bottom_DimMin", 120}, + {"Sash_Slide_MovableBack_Bottom_DimStd", 135}, + {"Sash_Slide_MovableBack_Side_DimMax", 90}, + {"Sash_Slide_MovableBack_Side_DimMin", 70}, + {"Sash_Slide_MovableBack_Side_DimStd", 80}, + {"Sash_Slide_MovableBack_Top_DimMax", 90}, + {"Sash_Slide_MovableBack_Top_DimMin", 70}, + {"Sash_Slide_MovableBack_Top_DimStd", 80}, + {"Sash_Slide_Movable_Bottom_DimMax", 150}, + {"Sash_Slide_Movable_Bottom_DimMin", 120}, + {"Sash_Slide_Movable_Bottom_DimStd", 135}, + {"Sash_Slide_Movable_Side_DimMax", 90}, + {"Sash_Slide_Movable_Side_DimMin", 70}, + {"Sash_Slide_Movable_Side_DimStd", 80}, + {"Sash_Slide_Movable_Top_DimMax", 90}, + {"Sash_Slide_Movable_Top_DimMin", 70}, + {"Sash_Slide_Movable_Top_DimStd", 80} + }; + + private Dictionary ParamProfiloSaomad = new Dictionary() + { + {"Frame_Frame_Split_DimMax", 85}, + {"Frame_Frame_Split_DimMin", 55}, + {"Frame_Frame_Split_DimStd", 60}, + {"Frame_Mixed_Bottom_DimMax", 80}, + {"Frame_Mixed_Bottom_DimMin", 70}, + {"Frame_Mixed_Bottom_DimStd", 78}, + {"Frame_Mixed_Split_DimMax", 110}, + {"Frame_Mixed_Split_DimMin", 70}, + {"Frame_Mixed_Split_DimStd", 90}, + {"Frame_Mixed_Top_DimMax", 80}, + {"Frame_Mixed_Top_DimMin", 70}, + {"Frame_Mixed_Top_DimStd", 78}, + {"Frame_Rail_Bottom_DimMax", 80} }; [Inject] @@ -146,6 +302,20 @@ namespace Test.UI.Components.Pages currJwd = InitialJwd; // rileggo altri dati await ReloadData(); + // costruisco lista profili + ProfilePayload pp1 = new ProfilePayload() + { + ProfileName = "Profilo78", + ThresholdList = ThresholdProfilo78, + ParameterDict = ParamProfilo78 + }; + ProfilePayload pp2 = new ProfilePayload() + { + ProfileName = "ProfiloSaomad", + ThresholdList = ThresholdProfiloSaomad, + ParameterDict = ParamProfiloSaomad + }; + AvailProfileList = new List { pp1, pp2 }; // preparo conf oggetti x controllo SetupList = new BaseListPayload() { @@ -153,7 +323,8 @@ namespace Test.UI.Components.Pages FamilyHardware = AvailFamilyHardwareList, Glass = AvailGlassList, Hardware = AvailHardwareList, - Material = AvailMaterialList + Material = AvailMaterialList, + ProfileList = AvailProfileList }; CurrData = new LivePayload() { diff --git a/Test.UI/Components/Pages/EditJWD.razor.cs b/Test.UI/Components/Pages/EditJWD.razor.cs index 0280f61..6d316ee 100644 --- a/Test.UI/Components/Pages/EditJWD.razor.cs +++ b/Test.UI/Components/Pages/EditJWD.razor.cs @@ -99,18 +99,6 @@ namespace Test.UI.Components.Pages new string("Abete") }; - protected List AvailProfileListOld { get; set; } = new List() - { - new string("Profilo78"), - new string("ProfiloSaomad") - }; - - protected Dictionary> AvailThresholdOld { get; set; } = new Dictionary>() - { - {"Profilo78", new List() { new Threshold(3, "Bottom"), new Threshold(1, "Threshold")}}, - {"ProfiloSaomad", new List(){ new Threshold(3, "Bottom"), new Threshold(2, "BottomWaterdrip"), new Threshold(1, "Threshold")}} - }; - /// /// Lista profili da DB /// @@ -132,7 +120,6 @@ namespace Test.UI.Components.Pages private Dictionary ParamProfilo78 = new Dictionary() { - {"Frame_BottomRail_Overlap", 33.2}, {"Frame_Fill_Rail_DimMax", 85}, {"Frame_Fill_Rail_DimMin", 70}, {"Frame_Fill_Rail_DimStd", 72}, @@ -141,7 +128,127 @@ namespace Test.UI.Components.Pages {"Frame_Fixed_Bottom_DimStd", 78}, {"Frame_Fixed_Top_DimMax", 80}, {"Frame_Fixed_Top_DimMin", 70}, - {"Frame_Fixed_Top_DimStd", 78} + {"Frame_Fixed_Top_DimStd", 78}, + {"Frame_Frame_Split_DimMax", 85}, + {"Frame_Frame_Split_DimMin", 55}, + {"Frame_Frame_Split_DimStd", 60}, + {"Frame_Mixed_Bottom_DimMax", 80}, + {"Frame_Mixed_Bottom_DimMin", 70}, + {"Frame_Mixed_Bottom_DimStd", 78}, + {"Frame_Mixed_Split_DimMax", 110}, + {"Frame_Mixed_Split_DimMin", 70}, + {"Frame_Mixed_Split_DimStd", 90}, + {"Frame_Mixed_Top_DimMax", 80}, + {"Frame_Mixed_Top_DimMin", 70}, + {"Frame_Mixed_Top_DimStd", 78}, + {"Frame_Rail_Bottom_DimMax", 80}, + {"Frame_Rail_Bottom_DimMin", 70}, + {"Frame_Rail_Bottom_DimStd", 78}, + {"Frame_Rail_DimMax", 78}, + {"Frame_Rail_DimMin", 68}, + {"Frame_Rail_DimStd", 72}, + {"Frame_Sash_Bottom_DimMax", 80}, + {"Frame_Sash_Bottom_DimMin", 70}, + {"Frame_Sash_Bottom_DimStd", 78}, + {"Frame_Sash_Horizontal_DimMax", 110}, + {"Frame_Sash_Horizontal_DimMin", 75}, + {"Frame_Sash_Horizontal_DimStd", 95}, + {"Frame_Sash_Threshold_DimMax", 26}, + {"Frame_Sash_Threshold_DimMin", 24}, + {"Frame_Sash_Threshold_DimStd", 25}, + {"Frame_Sash_Top_DimMax", 80}, + {"Frame_Sash_Top_DimMin", 70}, + {"Frame_Sash_Top_DimStd", 78}, + {"Frame_Sash_Vertical_DimMax", 110}, + {"Frame_Sash_Vertical_DimMin", 75}, + {"Frame_Sash_Vertical_DimStd", 95}, + {"Frame_Slide_Bottom_DimMax", 60}, + {"Frame_Slide_Bottom_DimMin", 50}, + {"Frame_Slide_Bottom_DimStd", 55}, + {"Frame_Slide_Fixed_DimMax", 60}, + {"Frame_Slide_Fixed_DimMin", 50}, + {"Frame_Slide_Fixed_DimStd", 55}, + {"Frame_Slide_MovableBack_Bottom_DimMax", 60}, + {"Frame_Slide_MovableBack_Bottom_DimMin", 50}, + {"Frame_Slide_MovableBack_Bottom_DimStd", 55}, + {"Frame_Slide_MovableBack_Threshold_DimMax", 10}, + {"Frame_Slide_MovableBack_Threshold_DimMin", 3}, + {"Frame_Slide_MovableBack_Threshold_DimStd", 4}, + {"Frame_Slide_Movable_DimMax", 60}, + {"Frame_Slide_Movable_DimMin", 50}, + {"Frame_Slide_Movable_DimStd", 55}, + {"Frame_Slide_Threshold_DimMax", 10}, + {"Frame_Slide_Threshold_DimMin", 3}, + {"Frame_Slide_Threshold_DimStd", 4}, + {"Frame_Slide_Top_DimMax", 60}, + {"Frame_Slide_Top_DimMin", 50}, + {"Frame_Slide_Top_DimStd", 55}, + {"Sash_Fill_Rail_DimMax", 80}, + {"Sash_Fill_Rail_DimMin", 70}, + {"Sash_Fill_Rail_DimStd", 78}, + {"Sash_Frame_Bottom_DimMax", 80}, + {"Sash_Frame_Bottom_DimMin", 70}, + {"Sash_Frame_Bottom_DimStd", 78}, + {"Sash_Frame_Top_DimMax", 80}, + {"Sash_Frame_Top_DimMin", 70}, + {"Sash_Frame_Top_DimStd", 78}, + {"Sash_French_In_DimMax", 80}, + {"Sash_French_In_DimMin", 70}, + {"Sash_French_In_DimStd", 78}, + {"Sash_French_Out_DimMax", 80}, + {"Sash_French_Out_DimMin", 70}, + {"Sash_French_Out_DimStd", 78}, + {"Sash_Rail_Bottom_DimMax", 80}, + {"Sash_Rail_Bottom_DimMin", 70}, + {"Sash_Rail_Bottom_DimStd", 78}, + {"Sash_Rail_DimMax", 80}, + {"Sash_Rail_DimMin", 70}, + {"Sash_Rail_DimStd", 78}, + {"Sash_Sash_Active_DimMax", 80}, + {"Sash_Sash_Active_DimMin", 70}, + {"Sash_Sash_Active_DimStd", 78}, + {"Sash_Sash_Inactive_DimMax", 80}, + {"Sash_Sash_Inactive_DimMin", 70}, + {"Sash_Sash_Inactive_DimStd", 78}, + {"Sash_Sash_Split_DimMax", 70}, + {"Sash_Sash_Split_DimMin", 50}, + {"Sash_Sash_Split_DimStd", 60}, + {"Sash_Slide_Active_DimMax", 90}, + {"Sash_Slide_Active_DimMin", 70}, + {"Sash_Slide_Active_DimStd", 80}, + {"Sash_Slide_Active_In_DimMax", 90}, + {"Sash_Slide_Active_In_DimMin", 70}, + {"Sash_Slide_Active_In_DimStd", 80}, + {"Sash_Slide_Fixed_Bottom_DimMax", 150}, + {"Sash_Slide_Fixed_Bottom_DimMin", 120}, + {"Sash_Slide_Fixed_Bottom_DimStd", 135}, + {"Sash_Slide_Fixed_Side_DimMax", 90}, + {"Sash_Slide_Fixed_Side_DimMin", 70}, + {"Sash_Slide_Fixed_Side_DimStd", 80}, + {"Sash_Slide_Fixed_Top_DimMax", 90}, + {"Sash_Slide_Fixed_Top_DimMin", 70}, + {"Sash_Slide_Fixed_Top_DimStd", 80}, + {"Sash_Slide_Inactive_DimMax", 90}, + {"Sash_Slide_Inactive_DimMin", 70}, + {"Sash_Slide_Inactive_DimStd", 80}, + {"Sash_Slide_MovableBack_Bottom_DimMax", 150}, + {"Sash_Slide_MovableBack_Bottom_DimMin", 120}, + {"Sash_Slide_MovableBack_Bottom_DimStd", 135}, + {"Sash_Slide_MovableBack_Side_DimMax", 90}, + {"Sash_Slide_MovableBack_Side_DimMin", 70}, + {"Sash_Slide_MovableBack_Side_DimStd", 80}, + {"Sash_Slide_MovableBack_Top_DimMax", 90}, + {"Sash_Slide_MovableBack_Top_DimMin", 70}, + {"Sash_Slide_MovableBack_Top_DimStd", 80}, + {"Sash_Slide_Movable_Bottom_DimMax", 150}, + {"Sash_Slide_Movable_Bottom_DimMin", 120}, + {"Sash_Slide_Movable_Bottom_DimStd", 135}, + {"Sash_Slide_Movable_Side_DimMax", 90}, + {"Sash_Slide_Movable_Side_DimMin", 70}, + {"Sash_Slide_Movable_Side_DimStd", 80}, + {"Sash_Slide_Movable_Top_DimMax", 90}, + {"Sash_Slide_Movable_Top_DimMin", 70}, + {"Sash_Slide_Movable_Top_DimStd", 80} }; private Dictionary ParamProfiloSaomad = new Dictionary() diff --git a/Test.UI/Components/Pages/Home.razor.cs b/Test.UI/Components/Pages/Home.razor.cs index 7110122..8229879 100644 --- a/Test.UI/Components/Pages/Home.razor.cs +++ b/Test.UI/Components/Pages/Home.razor.cs @@ -85,18 +85,6 @@ namespace Test.UI.Components.Pages new string("Abete") }; - protected List AvailProfileList { get; set; } = new List() - { - new string("Profilo78"), - new string("ProfiloSaomad") - }; - - protected Dictionary> AvailThreshold { get; set; } = new Dictionary>() - { - {"Profilo78", new List() { new Threshold(1, "Bottom"), new Threshold(3, "Threshold")}}, - {"ProfiloSaomad", new List(){ new Threshold(1, "Bottom"), new Threshold(2, "BottomWaterdrip"), new Threshold(3, "Threshold")}} - }; - [Inject] protected IConfiguration Config { get; set; } = null!; diff --git a/Test.UI/Data/FinestraSplitVert.jwd b/Test.UI/Data/FinestraSplitVert.jwd index d3d8a7d..92749df 100644 --- a/Test.UI/Data/FinestraSplitVert.jwd +++ b/Test.UI/Data/FinestraSplitVert.jwd @@ -57,6 +57,12 @@ } ], "SplitHorizList": [], + "ElementDimVertList": [ + { + "Index": 1, + "Value": 78.0 + } + ], "ElemDimVertList": [ { "Index": 1, diff --git a/WebWindowComplex/Compo/CardSplit.razor b/WebWindowComplex/Compo/CardSplit.razor index 4a64d6d..828d599 100644 --- a/WebWindowComplex/Compo/CardSplit.razor +++ b/WebWindowComplex/Compo/CardSplit.razor @@ -179,6 +179,10 @@ { } + @foreach (var element in CurrSplit.ElemDimVertList) + { + + } diff --git a/WebWindowComplex/Compo/EditElement.razor b/WebWindowComplex/Compo/EditElement.razor index f92285b..bf5d823 100644 --- a/WebWindowComplex/Compo/EditElement.razor +++ b/WebWindowComplex/Compo/EditElement.razor @@ -1,6 +1,6 @@ @using static WebWindowComplex.LayoutConst
- @(CurrRec.nIndex) + @(name()) @if (User) { diff --git a/WebWindowComplex/Compo/EditElement.razor.cs b/WebWindowComplex/Compo/EditElement.razor.cs index 55b4bb3..cedfaf7 100644 --- a/WebWindowComplex/Compo/EditElement.razor.cs +++ b/WebWindowComplex/Compo/EditElement.razor.cs @@ -26,6 +26,39 @@ namespace WebWindowComplex.Compo #endregion Public Properties #region Private Properties + /// + /// Metodo per aggiornare element corrente + /// + private string name() + { + if(CurrRec.ParentArea is Frame || CurrRec.ParentArea is Sash) + { + switch (CurrRec.nIndex) + { + case 1: + { + return "B"; + } + case 2: + { + return "R"; + } + case 3: + { + return "T"; + } + case 4: + { + return "L"; + } + } + } + else + { + return CurrRec.nIndex.ToString(); + } + return ""; + } /// /// Metodo per aggiornare element corrente @@ -37,7 +70,7 @@ namespace WebWindowComplex.Compo { if (CurrRec.dDimension != value) { - CurrRec.SetDimension(value); + CurrRec.dDimension = value; _ = EC_Update.InvokeAsync(CurrRec); } } diff --git a/WebWindowComplex/DTO/BaseListPayload.cs b/WebWindowComplex/DTO/BaseListPayload.cs index aa352a3..a9021fc 100644 --- a/WebWindowComplex/DTO/BaseListPayload.cs +++ b/WebWindowComplex/DTO/BaseListPayload.cs @@ -39,20 +39,6 @@ namespace WebWindowComplex.DTO /// public List Glass { get; set; } = null!; -#if false - /// - /// Elenco profili ammessi - /// - [Obsolete("Sostituire con info ProfileList")] - public List? Profile { get; set; } = null; - - /// - /// Elenco profili ammessi - /// - [Obsolete("Sostituire con info ProfileList")] - public Dictionary>? Threshold { get; set; } = null; -#endif - /// /// Lista info profili nel nuovo formato compatto /// @@ -70,10 +56,6 @@ namespace WebWindowComplex.DTO bool matOK = Material != null && Material.Count > 0; bool colorOK = ColorMaterial != null && ColorMaterial.Count > 0; bool profileOK = ProfileList != null && ProfileList.Count > 0; -#if false - bool profileOKOld = Profile != null && Profile.Count > 0; - bool thresholdOK = Threshold != null && Threshold.Count > 0; -#endif return famHwOK && glassOK && hwOK && colorOK && matOK && profileOK; } /// @@ -88,10 +70,6 @@ namespace WebWindowComplex.DTO bool matOK = Material != null && Material.Count > 0; bool colorOK = ColorMaterial != null && ColorMaterial.Count > 0; bool profileOK = ProfileList != null && ProfileList.Count > 0; -#if false - bool profileOKOld = Profile != null && Profile.Count > 0; - bool thresholdOK = Threshold != null && Threshold.Count > 0; -#endif return famHwOK || glassOK || hwOK || colorOK || matOK || profileOK; } } diff --git a/WebWindowComplex/Json/JsonUtility.cs b/WebWindowComplex/Json/JsonUtility.cs index 5136543..d291824 100644 --- a/WebWindowComplex/Json/JsonUtility.cs +++ b/WebWindowComplex/Json/JsonUtility.cs @@ -549,6 +549,16 @@ namespace WebWindowComplex.Json } } + private List m_ElemDimVertList = new List(); + [JsonProperty] + public List ElementDimVertList + { + get + { + return m_ElemDimVertList; + } + } + public JsonSplit() : base(AreaTypes.SPLIT) { } @@ -577,6 +587,8 @@ namespace WebWindowComplex.Json Split.SplitVertList[SplitIndex].SetDimension(m_SplitVertList[SplitIndex].Dimension); Split.SplitVertList[SplitIndex].SetMeasureType(m_SplitVertList[SplitIndex].MeasureType); } + foreach (var ElementDimension in ElementDimVertList) + Split.ElemDimVertList.Add(ElementDimension.Deserialize((Area)ParentArea)); } if (m_SplitHorizList.Count == 0) Split.SetSplitQtyHoriz(0); diff --git a/WebWindowComplex/Models/ElementDimension.cs b/WebWindowComplex/Models/ElementDimension.cs index 69e35dc..936b53c 100644 --- a/WebWindowComplex/Models/ElementDimension.cs +++ b/WebWindowComplex/Models/ElementDimension.cs @@ -20,15 +20,6 @@ namespace WebWindowComplex.Models m_dDimension = dDimension; } - public ElementDimension(Area ParentArea, int nIndex, double dDimension, double dMin, double dMax) - { - m_ParentArea = ParentArea; - m_nIndex = nIndex; - m_dDimension = dDimension; - m_dMin = dMin; - m_dMax = dMax; - } - #endregion Public Constructors #region Public Properties @@ -43,10 +34,10 @@ namespace WebWindowComplex.Models { if(dDimension != value) { - if (value > MaxDim) - m_dDimension = MaxDim; - else if (value < MinDim) - m_dDimension = MinDim; + if (value > m_dMax) + m_dDimension = m_dMax; + else if (value < m_dMin) + m_dDimension = m_dMin; else m_dDimension = value; } @@ -60,7 +51,20 @@ namespace WebWindowComplex.Models return m_nIndex; } } - + public string sName + { + get + { + return m_sName; + } + set + { + if (m_sName != value) + { + m_sName = value; + } + } + } public Area ParentArea { get @@ -77,7 +81,23 @@ namespace WebWindowComplex.Models { m_dDimension = dValue; } - + + public void SetMaxDimension(double dValue) + { + m_dMax = dValue; + } + + public void SetMinDimension(double dValue) + { + m_dMin = dValue; + } + + public void SetNameElement(string dValue) + { + m_sName = dValue; + } + + public ElementDimension Copy() { ElementDimension newElementDimension = new ElementDimension(ParentArea, nIndex, dDimension); @@ -108,13 +128,11 @@ namespace WebWindowComplex.Models private int m_nIndex; + private string m_sName; + private double m_dMin; private double m_dMax; - // valore massimo della dimensione del frame - private int MaxDim = 200; - // valore minimo della dimensione del frame - private int MinDim = 50; #endregion Private Fields } diff --git a/WebWindowComplex/Models/Split.cs b/WebWindowComplex/Models/Split.cs index 609ec92..4b3a586 100644 --- a/WebWindowComplex/Models/Split.cs +++ b/WebWindowComplex/Models/Split.cs @@ -319,6 +319,18 @@ namespace WebWindowComplex.Models m_ElemDimHorizList = value; } } + + public List ElemDimVertList + { + get + { + return m_ElemDimVertList; + } + set + { + m_ElemDimVertList = value; + } + } public List SplitPositionList { get @@ -378,6 +390,11 @@ namespace WebWindowComplex.Models ElementDimension newElementDimension = item.Copy(); newSplit.ElemDimHorizList.Add(newElementDimension); } + foreach (var item in ElemDimVertList) + { + ElementDimension newElementDimension = item.Copy(); + newSplit.ElemDimVertList.Add(newElementDimension); + } foreach (var item in AreaList) { Area a = item.Copy(newSplit); @@ -395,6 +412,34 @@ namespace WebWindowComplex.Models //m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); } + public bool OnlySashChild() + { + foreach (var areaSplitted in AreaList) + { + if (!(areaSplitted.AreaList.FirstOrDefault().AreaType is AreaTypes.SASH)) + return false; + } + return true; + } + public bool MinOneSashChild() + { + foreach (var areaSplitted in AreaList) + { + if (areaSplitted.AreaList.FirstOrDefault().AreaType is AreaTypes.SASH) + return true; + } + return false; + } + public bool SashChildSxOrDx() + { + foreach (var areaSplitted in AreaList) + { + if (areaSplitted.AreaList.FirstOrDefault().AreaType is AreaTypes.SASH) + return true; + } + return false; + } + #endregion Public Methods #region Internal Properties @@ -435,6 +480,8 @@ namespace WebWindowComplex.Models JsonSplit.SplitHorizList.Add(SplitHoriz.Serialize()); foreach (var Elem in m_ElemDimHorizList) JsonSplit.ElementDimHorizList.Add(Elem.Serialize()); + foreach (var Elem in m_ElemDimVertList) + JsonSplit.ElementDimVertList.Add(Elem.Serialize()); foreach (var Area in AreaList) JsonSplit.AreaList.Add(Area.Serialize(hideHw)); return JsonSplit; @@ -539,6 +586,7 @@ namespace WebWindowComplex.Models private List m_SplitHorizList = new List(); private List m_ElemDimHorizList = new List(); + private List m_ElemDimVertList = new List(); private List m_SplitPositionList = new List(); private List m_SplitShapeList = new List diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index dd280f2..b5395ff 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -322,6 +322,224 @@ namespace WebWindowComplex } } + /// + /// Metodo per popolare i parametri relativi al profilo + /// + /// Area che si considera + protected void PopolateParamElement(Area node) + { + if (node != null) + { + switch (node.AreaType) + { + case AreaTypes.FRAME: + { + Frame frame = (Frame)node; + switch (node.AreaList.FirstOrDefault().AreaType) + { + case AreaTypes.SASH: + { + frame.ElementDimensionList.FirstOrDefault().SetNameElement("Frame_Sash_Bottom_Dim"); + for(int i = 1; i <4; i++) + frame.ElementDimensionList.ElementAt(i).SetNameElement("Frame_Sash_Top_Dim"); + foreach(var elem in frame.ElementDimensionList) + { + elem.SetMinDimension(Window.m_ParameterList.GetValueOrDefault(elem.sName + "Min")); + elem.SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(elem.sName + "Max")); + } + break; + } + case AreaTypes.SPLIT: + { + Split split = (Split)node.AreaList.FirstOrDefault(); + switch(split.SelSplitShape) + { + case SplitShapes.VERTICAL: + { + // in tutte le aree splittate ho ante + if (split.OnlySashChild()) + { + frame.ElementDimensionList.ElementAt(0).SetNameElement("Frame_Mixed_Bottom_Dim"); + frame.ElementDimensionList.ElementAt(1).SetNameElement("Frame_Sash_Top_Dim"); + frame.ElementDimensionList.ElementAt(2).SetNameElement("Frame_Mixed_Bottom_Dim"); + frame.ElementDimensionList.ElementAt(3).SetNameElement("Frame_Sash_Top_Dim"); + foreach (var elem in frame.ElementDimensionList) + { + elem.SetMinDimension(Window.m_ParameterList.GetValueOrDefault(elem.sName + "Min")); + elem.SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(elem.sName + "Max")); + } + } + // cambio profilo + else if (split.MinOneSashChild()) + { + frame.ElementDimensionList.ElementAt(0).SetNameElement("Frame_Mixed_Bottom_Dim"); + if(split.AreaList.FirstOrDefault().AreaList.FirstOrDefault().AreaType is AreaTypes.SASH) + frame.ElementDimensionList.ElementAt(1).SetNameElement("Frame_Sash_Top_Dim"); + else + frame.ElementDimensionList.ElementAt(1).SetNameElement("Frame_Fixed_Top_Dim"); + frame.ElementDimensionList.ElementAt(2).SetNameElement("Frame_Mixed_Bottom_Dim"); + if (split.AreaList.Last().AreaList.FirstOrDefault().AreaType is AreaTypes.SASH) + frame.ElementDimensionList.ElementAt(3).SetNameElement("Frame_Sash_Top_Dim"); + else + frame.ElementDimensionList.ElementAt(3).SetNameElement("Frame_Fixed_Top_Dim"); + foreach (var elem in frame.ElementDimensionList) + { + elem.SetMinDimension(Window.m_ParameterList.GetValueOrDefault(elem.sName + "Min")); + elem.SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(elem.sName + "Max")); + } + } + // solo vetri fissi + else + { + frame.ElementDimensionList.ElementAt(0).SetNameElement("Frame_Frame_Split_Dim"); + frame.ElementDimensionList.ElementAt(1).SetNameElement("Frame_Fixed_Top_Dim"); + frame.ElementDimensionList.ElementAt(2).SetNameElement("Frame_Frame_Split_Dim"); + frame.ElementDimensionList.ElementAt(3).SetNameElement("Frame_Fixed_Top_Dim"); + foreach (var elem in frame.ElementDimensionList) + { + elem.SetMinDimension(Window.m_ParameterList.GetValueOrDefault(elem.sName + "Min")); + elem.SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(elem.sName + "Max")); + } + } + break; + } + case SplitShapes.HORIZONTAL: + { + // in tutte le aree splittate ho ante + if (split.OnlySashChild()) + { + frame.ElementDimensionList.ElementAt(0).SetNameElement("Frame_Sash_Bottom_Dim"); + frame.ElementDimensionList.ElementAt(1).SetNameElement("Frame_Mixed_Top_Dim"); + frame.ElementDimensionList.ElementAt(2).SetNameElement("Frame_Sash_Top_Dim"); + frame.ElementDimensionList.ElementAt(3).SetNameElement("Frame_Mixed_Top_Dim"); + foreach (var elem in frame.ElementDimensionList) + { + elem.SetMinDimension(Window.m_ParameterList.GetValueOrDefault(elem.sName + "Min")); + elem.SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(elem.sName + "Max")); + } + } + // cambio profilo + else if (split.MinOneSashChild()) + { + if (split.AreaList.FirstOrDefault().AreaList.FirstOrDefault().AreaType is AreaTypes.SASH) + frame.ElementDimensionList.ElementAt(0).SetNameElement("Frame_Sash_Bottom_Dim"); + else + frame.ElementDimensionList.ElementAt(0).SetNameElement("Frame_Fixed_Bottom_Dim"); + frame.ElementDimensionList.ElementAt(1).SetNameElement("Frame_Mixed_Top_Dim"); + if (split.AreaList.ElementAt(2).AreaList.FirstOrDefault().AreaType is AreaTypes.SASH) + frame.ElementDimensionList.ElementAt(2).SetNameElement("Frame_Sash_Top_Dim"); + else + frame.ElementDimensionList.ElementAt(2).SetNameElement("Frame_Fixed_Top_Dim"); + frame.ElementDimensionList.ElementAt(3).SetNameElement("Frame_Mixed_Top_Dim"); + foreach (var elem in frame.ElementDimensionList) + { + elem.SetMinDimension(Window.m_ParameterList.GetValueOrDefault(elem.sName + "Min")); + elem.SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(elem.sName + "Max")); + } + } + // solo vetri fissi + else + { + frame.ElementDimensionList.ElementAt(0).SetNameElement("Frame_Fixed_Top_Dim"); + frame.ElementDimensionList.ElementAt(1).SetNameElement("Frame_Frame_Split_Dim"); + frame.ElementDimensionList.ElementAt(2).SetNameElement("Frame_Fixed_Top_Dim"); + frame.ElementDimensionList.ElementAt(3).SetNameElement("Frame_Frame_Split_Dim"); + foreach (var elem in frame.ElementDimensionList) + { + elem.SetMinDimension(Window.m_ParameterList.GetValueOrDefault(elem.sName + "Min")); + elem.SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(elem.sName + "Max")); + } + } + break; + } + case SplitShapes.GRID: + { + for (int i = 0; i < 4; i++) + frame.ElementDimensionList.ElementAt(i).SetNameElement("Frame_Frame_Split_Dim"); + foreach (var elem in frame.ElementDimensionList) + { + elem.SetMinDimension(Window.m_ParameterList.GetValueOrDefault(elem.sName + "Min")); + elem.SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(elem.sName + "Max")); + } + break; + } + } + break; + } + } + break; + } + case AreaTypes.SASH: + { + + break; + } + case AreaTypes.SPLIT: + { + Split split = (Split)node; + switch (split.ParentArea.AreaType) + { + case AreaTypes.SASH: + { + for (int i = 0; i < split.ElemDimVertList.Count - 1; i++) + split.ElemDimVertList.ElementAt(i).SetNameElement("Sash_Sash_Split_Dim"); + for (int i = 0; i < split.ElemDimHorizList.Count - 1; i++) + split.ElemDimHorizList.ElementAt(i).SetNameElement("Sash_Sash_Split_Dim"); + foreach (var elem in split.ElemDimVertList) + { + elem.SetMinDimension(Window.m_ParameterList.GetValueOrDefault(elem.sName + "Min")); + elem.SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(elem.sName + "Max")); + } + foreach (var elem in split.ElemDimHorizList) + { + elem.SetMinDimension(Window.m_ParameterList.GetValueOrDefault(elem.sName + "Min")); + elem.SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(elem.sName + "Max")); + } + break; + } + case AreaTypes.FRAME: + { + if (split.MinOneSashChild()) + { + for (int i = 0; i < split.ElemDimVertList.Count - 1; i++) + split.ElemDimVertList.ElementAt(i).SetNameElement("Frame_Mixed_Split_Dim"); + for (int i = 0; i < split.ElemDimHorizList.Count - 1; i++) + split.ElemDimHorizList.ElementAt(i).SetNameElement("Frame_Mixed_Split_Dim"); + } + else + { + for (int i = 0; i < split.ElemDimVertList.Count - 1; i++) + split.ElemDimVertList.ElementAt(i).SetNameElement("Frame_Frame_Split_Dim"); + for (int i = 0; i < split.ElemDimHorizList.Count - 1; i++) + split.ElemDimHorizList.ElementAt(i).SetNameElement("Frame_Frame_Split_Dim"); + } + foreach (var elem in split.ElemDimVertList) + { + elem.SetMinDimension(Window.m_ParameterList.GetValueOrDefault(elem.sName + "Min")); + elem.SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(elem.sName + "Max")); + } + foreach (var elem in split.ElemDimHorizList) + { + elem.SetMinDimension(Window.m_ParameterList.GetValueOrDefault(elem.sName + "Min")); + elem.SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(elem.sName + "Max")); + } + break; + } + } + break; + } + default: + { + break; + } + } + foreach (var item in node.AreaList) + { + PopolateParamElement(item); + } + } + } + /// /// Metodo per riempire le liste Sash, Split, Splitted e Fill /// @@ -736,6 +954,7 @@ namespace WebWindowComplex /// protected void UpdateLists() { + PopolateParamElement((m_CurrWindow!).AreaList.First()); m_maxCol = 0; m_maxRow = 0; m_FillList = new List(); @@ -899,12 +1118,6 @@ namespace WebWindowComplex { listErrPre.Add("Profile", "Missing Profile List!"); } -#if false - if (ListPayload.Profile == null || ListPayload.Profile.Count == 0) - { - listErrPre.Add("Profile", "Missing Profile List!"); - } -#endif } /// @@ -918,15 +1131,15 @@ namespace WebWindowComplex // verifico colore attuale sia consistente... if (m_CurrWindow != null) { - if (!ListPayload.ColorMaterial.Contains(m_CurrWindow.sColorMaterial)) + if (ListPayload.ColorMaterial == null || !ListPayload.ColorMaterial.Contains(m_CurrWindow.sColorMaterial)) { listWarnings.Add("ColorMaterial", $"Missing Color: {m_CurrWindow.sColorMaterial}"); } - if (!ListPayload.Glass.Contains(m_CurrWindow.sGlass)) + if (ListPayload.Glass == null || !ListPayload.Glass.Contains(m_CurrWindow.sGlass)) { listWarnings.Add("Glass", $"Missing Glass: {m_CurrWindow.sGlass}"); } - if (!ListPayload.Material.Contains(m_CurrWindow.sMaterial)) + if (ListPayload.Material == null || !ListPayload.Material.Contains(m_CurrWindow.sMaterial)) { listWarnings.Add("Material", $"Missing Material: {m_CurrWindow.sMaterial}"); } @@ -934,12 +1147,6 @@ namespace WebWindowComplex { listWarnings.Add("Profile", $"Missing Profile: {m_CurrWindow.sProfilePath}"); } -#if false - if (!ListPayload.Profile.Contains(m_CurrWindow.sProfilePath)) - { - listWarnings.Add("Profile", $"Missing Profile: {m_CurrWindow.sProfilePath}"); - } -#endif } } } diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 9cb2e78..bf3cbd2 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.8.1.2216 + 2.8.1.2309 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -57,6 +57,18 @@ + + + + + + + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index aadb65f..b727b70 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.8.1.2216 + 2.8.1.2309 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -86,6 +86,17 @@ + + + + + + + + + + +