diff --git a/README.md b/README.md index c58c528..0e812e9 100644 --- a/README.md +++ b/README.md @@ -128,10 +128,10 @@ Vengono richieste nei seguenti casi: Descrive il tipo di riempimento: vetro o pannello. -# Richieste di informazioni a EgwMultiEnginManager +## Richieste di informazioni a EgwMultiEnginManager Nel componente sono presenti quattro tipi di richieste di informazioni al programma EgwMultiEngineManager: 1. SVG: serve per avere SVG dato il JWD per poter rappresentare il disegno. La domanda è costituita dal JWD e la risposta contiene il SVG; 2. Forma del telaio: serve per poter avere la lista degli hardware coerenti con le caratteristiche scelte. La domanda è costituita dal JWD e dalla lista di groupId interessati. La risposta contiene un dizionario di valori interi-stringa che rappresentano groupId-forma; 3. Hardware option: serve per avere le opzioni relative all'hardware selezionato. La domanda è costituita dal JWD e la lista di groupId interessati. La risposta contiene un dizionario interi-stringa che rappresentano groupId-opzioni hardware. Le opzioni hardware sono restituite in formato xml; - 4. Profili degli elementi: serve per avere i profili degli elementi del groupId richiesto (nel caso di gruppi di ante gli elemeneti sono specificati per ogni anta). La domanda è costituita dal JWD e dalla lista di groupId interessati. La risposta contiene un dizionario di valori interi-stringhe. + 4. Profili degli elementi: serve per avere i profili degli elementi groupId richiesto (nel caso di gruppi di ante gli elemeneti sono specificati per ogni anta). La domanda è costituita dal JWD e dalla lista di groupId interessati. La risposta contiene un dizionario di valori interi-stringhe. diff --git a/Test.UI/Components/Pages/EditJWD.razor.cs b/Test.UI/Components/Pages/EditJWD.razor.cs index 092847a..3741b33 100644 --- a/Test.UI/Components/Pages/EditJWD.razor.cs +++ b/Test.UI/Components/Pages/EditJWD.razor.cs @@ -29,7 +29,7 @@ namespace Test.UI.Components.Pages DLService.PipeSvg.EA_NewMessage -= PipeSvg_EA_NewMessage; DLService.PipeShape.EA_NewMessage -= PipeShape_EA_NewMessage; DLService.PipeHwOpt.EA_NewMessage -= PipeHwOption_EA_NewMessage; - //DLService.PipeElement.EA_NewMessage -= PipeElement_EA_NewMessage; + //DLService.PipeAreaProfile.EA_NewMessage -= PipeAreaProfile_EA_NewMessage; } #endregion Public Methods @@ -49,7 +49,7 @@ namespace Test.UI.Components.Pages protected bool User = false; protected Dictionary currGroupShape = new Dictionary(); - protected Dictionary currElement = new Dictionary(); + protected List currElement = new List(); protected Dictionary currHwOption = new Dictionary(); protected string currJwd = "..."; protected Dictionary m_CurrArgs = new Dictionary(); @@ -350,7 +350,7 @@ namespace Test.UI.Components.Pages DLService.PipeSvg.EA_NewMessage += PipeSvg_EA_NewMessage; DLService.PipeShape.EA_NewMessage += PipeShape_EA_NewMessage; DLService.PipeHwOpt.EA_NewMessage += PipeHwOption_EA_NewMessage; - //DLService.PipeElement.EA_NewMessage += PipeElement_EA_NewMessage; + //DLService.PipeAreaProfile.EA_NewMessage += PipeAreaProfile_EA_NewMessage; } #endregion Protected Methods @@ -509,7 +509,7 @@ namespace Test.UI.Components.Pages await Task.Delay(1); } - private async void PipeElement_EA_NewMessage(object? sender, EventArgs e) + private async void PipeAreaProfile_EA_NewMessage(object? sender, EventArgs e) { // aggiorno visualizzazione PubSubEventArgs currArgs = (PubSubEventArgs)e; @@ -519,9 +519,9 @@ namespace Test.UI.Components.Pages if (currArgs.msgUid.StartsWith($"{channelElement}:{windowUid}")) { // deserializzo il dizionario delle risposte... - var rawDict = JsonConvert.DeserializeObject>(currArgs.newMessage); - currElement = rawDict ?? new Dictionary(); - CurrData.DictElement = currElement; + var rawDict = JsonConvert.DeserializeObject>(currArgs.newMessage); + currElement = rawDict ?? new List(); + CurrData.ProfElementList = currElement; } await InvokeAsync(StateHasChanged); } @@ -551,7 +551,6 @@ namespace Test.UI.Components.Pages /// private async Task ReloadData() { - //return base.OnInitializedAsync(); AvailHardwareList = new List(); if (File.Exists(cFileHardware)) { diff --git a/Test.UI/Data/AntaSingola.jwd b/Test.UI/Data/AntaSingola.jwd index 049e822..6fe8a92 100644 --- a/Test.UI/Data/AntaSingola.jwd +++ b/Test.UI/Data/AntaSingola.jwd @@ -18,6 +18,24 @@ "Value": 1200.0 } ], + "ElementDimensionList": [ + { + "Index": 1, + "Value": 78.0 + }, + { + "Index": 2, + "Value": 78.0 + }, + { + "Index": 3, + "Value": 78.0 + }, + { + "Index": 4, + "Value": 78.0 + } + ], "JointList": [ { "Index": 1, @@ -50,6 +68,24 @@ "HasHandle": true, "Dimension": 100.0, "MeasureType": "PERCENTAGE", + "ElementDimensionList": [ + { + "Index": 1, + "Value": 78.0 + }, + { + "Index": 2, + "Value": 78.0 + }, + { + "Index": 3, + "Value": 78.0 + }, + { + "Index": 4, + "Value": 78.0 + } + ], "JointList": [ { "Index": 1, diff --git a/Test.UI/Data/ArcoAntaDoppia.jwd b/Test.UI/Data/ArcoAntaDoppia.jwd index 7b2b5be..0a652f2 100644 --- a/Test.UI/Data/ArcoAntaDoppia.jwd +++ b/Test.UI/Data/ArcoAntaDoppia.jwd @@ -23,6 +23,24 @@ "Value": 1800.0 } ], + "ElementDimensionList": [ + { + "Index": 1, + "Value": 78.0 + }, + { + "Index": 2, + "Value": 78.0 + }, + { + "Index": 3, + "Value": 78.0 + }, + { + "Index": 4, + "Value": 78.0 + } + ], "JointList": [ { "Index": 1, @@ -52,9 +70,27 @@ { "SashId": 1, "OpeningType": "TILTTURN_LEFT", + "HasHandle": true, "Dimension": 50.0, "MeasureType": "PERCENTAGE", - "HasHandle": true, + "ElementDimensionList": [ + { + "Index": 1, + "Value": 78.0 + }, + { + "Index": 2, + "Value": 78.0 + }, + { + "Index": 3, + "Value": 78.0 + }, + { + "Index": 4, + "Value": 78.0 + } + ], "JointList": [ { "Index": 1, @@ -77,9 +113,27 @@ { "SashId": 2, "OpeningType": "TURNONLY_RIGHT", + "HasHandle": false, "Dimension": 50.0, "MeasureType": "PERCENTAGE", - "HasHandle": false, + "ElementDimensionList": [ + { + "Index": 1, + "Value": 78.0 + }, + { + "Index": 2, + "Value": 78.0 + }, + { + "Index": 3, + "Value": 78.0 + }, + { + "Index": 4, + "Value": 78.0 + } + ], "JointList": [ { "Index": 1, diff --git a/Test.UI/Data/FinDueAnteBottomFisso.jwd b/Test.UI/Data/FinDueAnteBottomFisso.jwd index 2882852..bc0eba9 100644 --- a/Test.UI/Data/FinDueAnteBottomFisso.jwd +++ b/Test.UI/Data/FinDueAnteBottomFisso.jwd @@ -18,6 +18,24 @@ "Value": 2100.0 } ], + "ElementDimensionList": [ + { + "Index": 1, + "Value": 78.0 + }, + { + "Index": 2, + "Value": 78.0 + }, + { + "Index": 3, + "Value": 78.0 + }, + { + "Index": 4, + "Value": 78.0 + } + ], "JointList": [ { "Index": 1, @@ -55,6 +73,13 @@ "Dimension": 60.0 } ], + "ElementDimVertList": [], + "ElementDimHorizList": [ + { + "Index": 1, + "Value": 78.0 + } + ], "GroupId": 2, "AreaList": [ { @@ -81,6 +106,24 @@ "HasHandle": false, "Dimension": 50.0, "MeasureType": "PERCENTAGE", + "ElementDimensionList": [ + { + "Index": 1, + "Value": 78.0 + }, + { + "Index": 2, + "Value": 78.0 + }, + { + "Index": 3, + "Value": 78.0 + }, + { + "Index": 4, + "Value": 78.0 + } + ], "JointList": [ { "Index": 1, @@ -106,6 +149,24 @@ "HasHandle": true, "Dimension": 50.0, "MeasureType": "PERCENTAGE", + "ElementDimensionList": [ + { + "Index": 1, + "Value": 78.0 + }, + { + "Index": 2, + "Value": 78.0 + }, + { + "Index": 3, + "Value": 78.0 + }, + { + "Index": 4, + "Value": 78.0 + } + ], "JointList": [ { "Index": 1, diff --git a/Test.UI/Data/FinestraDueAnteSeparate.jwd b/Test.UI/Data/FinestraDueAnteSeparate.jwd index 2d8dbe7..06a7713 100644 --- a/Test.UI/Data/FinestraDueAnteSeparate.jwd +++ b/Test.UI/Data/FinestraDueAnteSeparate.jwd @@ -23,6 +23,24 @@ "Value": 1800.0 } ], + "ElementDimensionList": [ + { + "Index": 1, + "Value": 78.0 + }, + { + "Index": 2, + "Value": 78.0 + }, + { + "Index": 3, + "Value": 78.0 + }, + { + "Index": 4, + "Value": 78.0 + } + ], "JointList": [ { "Index": 1, @@ -60,6 +78,13 @@ } ], "SplitHorizList": [], + "ElementDimVertList": [ + { + "Index": 1, + "Value": 78.0 + } + ], + "ElementDimHorizList": [], "GroupId": 2, "AreaList": [ { @@ -74,6 +99,24 @@ "HasHandle": true, "Dimension": 100.0, "MeasureType": "PERCENTAGE", + "ElementDimensionList": [ + { + "Index": 1, + "Value": 78.0 + }, + { + "Index": 2, + "Value": 78.0 + }, + { + "Index": 3, + "Value": 78.0 + }, + { + "Index": 4, + "Value": 78.0 + } + ], "JointList": [ { "Index": 1, @@ -154,6 +197,24 @@ "HasHandle": true, "Dimension": 100.0, "MeasureType": "PERCENTAGE", + "ElementDimensionList": [ + { + "Index": 1, + "Value": 78.0 + }, + { + "Index": 2, + "Value": 78.0 + }, + { + "Index": 3, + "Value": 78.0 + }, + { + "Index": 4, + "Value": 78.0 + } + ], "JointList": [ { "Index": 1, diff --git a/Test.UI/Data/FinestraSplitGrid.jwd b/Test.UI/Data/FinestraSplitGrid.jwd index 5367e5f..5bc0f69 100644 --- a/Test.UI/Data/FinestraSplitGrid.jwd +++ b/Test.UI/Data/FinestraSplitGrid.jwd @@ -18,6 +18,24 @@ "Value": 1200.0 } ], + "ElementDimensionList": [ + { + "Index": 1, + "Value": 78.0 + }, + { + "Index": 2, + "Value": 78.0 + }, + { + "Index": 3, + "Value": 78.0 + }, + { + "Index": 4, + "Value": 78.0 + } + ], "JointList": [ { "Index": 1, @@ -73,6 +91,18 @@ "MeasureType": "PERCENTAGE" } ], + "ElementDimVertList": [ + { + "Index": 1, + "Value": 78.0 + } + ], + "ElementDimHorizList": [ + { + "Index": 1, + "Value": 78.0 + } + ], "GroupId": 2, "AreaList": [ { diff --git a/Test.UI/Data/FinestraSplitHoriz.jwd b/Test.UI/Data/FinestraSplitHoriz.jwd index 3e7305c..e9d49aa 100644 --- a/Test.UI/Data/FinestraSplitHoriz.jwd +++ b/Test.UI/Data/FinestraSplitHoriz.jwd @@ -18,6 +18,24 @@ "Value": 1800.0 } ], + "ElementDimensionList": [ + { + "Index": 1, + "Value": 78.0 + }, + { + "Index": 2, + "Value": 78.0 + }, + { + "Index": 3, + "Value": 78.0 + }, + { + "Index": 4, + "Value": 78.0 + } + ], "JointList": [ { "Index": 1, @@ -57,6 +75,7 @@ "MeasureType": "PERCENTAGE" } ], + "ElementDimVertList": [], "ElementDimHorizList": [ { "Index": 1, diff --git a/Test.UI/Data/FinestraSplitVert.jwd b/Test.UI/Data/FinestraSplitVert.jwd index 92749df..c5dc26c 100644 --- a/Test.UI/Data/FinestraSplitVert.jwd +++ b/Test.UI/Data/FinestraSplitVert.jwd @@ -18,6 +18,24 @@ "Value": 1800.0 } ], + "ElementDimensionList": [ + { + "Index": 1, + "Value": 78.0 + }, + { + "Index": 2, + "Value": 78.0 + }, + { + "Index": 3, + "Value": 78.0 + }, + { + "Index": 4, + "Value": 78.0 + } + ], "JointList": [ { "Index": 1, @@ -63,12 +81,7 @@ "Value": 78.0 } ], - "ElemDimVertList": [ - { - "Index": 1, - "Value": 78.0 - } - ], + "ElementDimHorizList": [], "GroupId": 2, "AreaList": [ { diff --git a/WebWindowComplex/AreaProfiles.cs b/WebWindowComplex/AreaProfiles.cs new file mode 100644 index 0000000..9bf14f7 --- /dev/null +++ b/WebWindowComplex/AreaProfiles.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WebWindowComplex +{ + public class AreaProfiles + { + /// + /// Numero di area + /// + public int GroupId { get; set; } + + /// + /// Numero di anta (se è una sash) + /// + public int SashId { get; set; } + + /// + /// Lista profili + /// + public List Profiles { get; set; } + + public AreaProfiles(int groupId, int sashId, List profiles) + { + GroupId = groupId; + SashId = sashId; + Profiles = profiles; + } + } +} diff --git a/WebWindowComplex/Compo/AreaSash.razor.cs b/WebWindowComplex/Compo/AreaSash.razor.cs index 9f80c50..96899dd 100644 --- a/WebWindowComplex/Compo/AreaSash.razor.cs +++ b/WebWindowComplex/Compo/AreaSash.razor.cs @@ -279,20 +279,23 @@ namespace WebWindowComplex.Compo /// private async Task ChangeTypeDimension() { - CurrSashDim.bDimensionLight = !CurrSashDim.bDimensionLight; - if (CurrSashDim.bDimensionLight) + if (CurrSashDim.SelMeasureType.Equals(MeasureTypes.ABSOLUTE)) { - CurrSashDim.dDimension = CurrSashDim.dDimension - - CurrSashDim.ElementDimensionList.ElementAt(1).dDimension - - CurrSashDim.ElementDimensionList.ElementAt(3).dDimension; + 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; + } + await EC_UpdateSash.InvokeAsync(CurrSashGroup); } - else - { - CurrSashDim.dDimension = CurrSashDim.dDimension + - CurrSashDim.ElementDimensionList.ElementAt(1).dDimension + - CurrSashDim.ElementDimensionList.ElementAt(3).dDimension; - } - await EC_UpdateSash.InvokeAsync(CurrSashGroup); } /// diff --git a/WebWindowComplex/Compo/CardFrame.razor.cs b/WebWindowComplex/Compo/CardFrame.razor.cs index 124a7ee..e7ce2f2 100644 --- a/WebWindowComplex/Compo/CardFrame.razor.cs +++ b/WebWindowComplex/Compo/CardFrame.razor.cs @@ -104,13 +104,17 @@ namespace WebWindowComplex.Compo { if (CurrFrameWindow.SelThresholdFromType != value) { - CurrFrameWindow.SelThresholdFromType = value; - var args = new DataUpdateFrame() + string valueName = CurrFrameWindow.ThresholdList.Where(x => x.Type.Equals(value)).First().Name; + if (SashList.Count > 0 || (SashList.Count == 0 && !valueName.Equals("Threshold"))) { - currFrame = CurrFrameWindow, - svgNoHw = false - }; - _ = EC_UpdateFrame.InvokeAsync(args); + CurrFrameWindow.SelThresholdFromType = value; + var args = new DataUpdateFrame() + { + currFrame = CurrFrameWindow, + svgNoHw = false + }; + _ = EC_UpdateFrame.InvokeAsync(args); + } } } } diff --git a/WebWindowComplex/Compo/CardSashGroup.razor.cs b/WebWindowComplex/Compo/CardSashGroup.razor.cs index c1bed29..4bf6f57 100644 --- a/WebWindowComplex/Compo/CardSashGroup.razor.cs +++ b/WebWindowComplex/Compo/CardSashGroup.razor.cs @@ -195,6 +195,7 @@ namespace WebWindowComplex.Compo protected async Task RemoveArea() { CurrSashGroup.Remove(); + FrameWindow.SetSelThresholdFromName(FrameWindow.ThresholdList.FirstOrDefault(x => x.Name != "Threshold").Name); var args = new DataUpdateFrame() { currFrame = FrameWindow diff --git a/WebWindowComplex/DTO/LivePayload.cs b/WebWindowComplex/DTO/LivePayload.cs index 39eba34..9d00a07 100644 --- a/WebWindowComplex/DTO/LivePayload.cs +++ b/WebWindowComplex/DTO/LivePayload.cs @@ -35,9 +35,9 @@ namespace WebWindowComplex.DTO public Dictionary DictOptionsXml { get; set; } = new Dictionary(); /// - /// Dizionario Element + /// Lista profili Element /// - public Dictionary DictElement { get; set; } = new Dictionary(); + public List ProfElementList { get; set; } = new List(); #endregion Public Properties @@ -61,7 +61,8 @@ namespace WebWindowComplex.DTO return false; if (!DictUtils.DictAreEqual(DictShape, item.DictShape)) return false; - + if (ProfElementList.Count == item.ProfElementList.Count && !ProfElementList.OrderBy(x => x).SequenceEqual(item.ProfElementList.OrderBy(x => x))) + return false; return true; } diff --git a/WebWindowComplex/Json/JsonUtility.cs b/WebWindowComplex/Json/JsonUtility.cs index 0ea7569..48f4106 100644 --- a/WebWindowComplex/Json/JsonUtility.cs +++ b/WebWindowComplex/Json/JsonUtility.cs @@ -539,15 +539,6 @@ namespace WebWindowComplex.Json } } - private List m_ElemDimHorizList = new List(); - [JsonProperty] - public List ElementDimHorizList - { - get - { - return m_ElemDimHorizList; - } - } private List m_ElemDimVertList = new List(); [JsonProperty] @@ -559,6 +550,15 @@ namespace WebWindowComplex.Json } } + private List m_ElemDimHorizList = new List(); + [JsonProperty] + public List ElementDimHorizList + { + get + { + return m_ElemDimHorizList; + } + } public JsonSplit() : base(AreaTypes.SPLIT) { } @@ -571,48 +571,48 @@ namespace WebWindowComplex.Json internal override Area Deserialize(Area ParentArea, Window ParentWindow) { - Split Split = new Split(ParentArea, ParentWindow); - Split.SetGroupId(GroupId); - Split.SetAreaType(AreaTypes.SPLIT); - Split.SetSplitShape(m_SplitShape); - Split.SetSplitStartVert(m_SplitStartVert); + Split split = new Split(ParentArea, ParentWindow); + split.SetGroupId(GroupId); + split.SetAreaType(AreaTypes.SPLIT); + split.SetSplitShape(m_SplitShape); + split.SetSplitStartVert(m_SplitStartVert); if (m_SplitVertList.Count == 0) - Split.SetSplitQtyVert(0); + split.SetSplitQtyVert(0); else { - Split.SetSplitQtyVert(m_SplitVertList.Count - 1); + split.SetSplitQtyVert(m_SplitVertList.Count - 1); for (var SplitIndex = 0; SplitIndex <= m_SplitVertList.Count - 1; SplitIndex++) { - Split.SplitVertList[SplitIndex].SetIsRelative(m_SplitVertList[SplitIndex].IsRelative); - Split.SplitVertList[SplitIndex].SetDimension(m_SplitVertList[SplitIndex].Dimension); - Split.SplitVertList[SplitIndex].SetMeasureType(m_SplitVertList[SplitIndex].MeasureType); + split.SplitVertList[SplitIndex].SetIsRelative(m_SplitVertList[SplitIndex].IsRelative); + 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)); + for (int index = 0; index < ElementDimVertList.Count; index++) + split.ElemDimVertList.ElementAt(index).SetDimension(m_ElemDimVertList[index].Value); } if (m_SplitHorizList.Count == 0) - Split.SetSplitQtyHoriz(0); + split.SetSplitQtyHoriz(0); else { - Split.SetSplitQtyHoriz(m_SplitHorizList.Count - 1); + split.SetSplitQtyHoriz(m_SplitHorizList.Count - 1); for (var SplitIndex = 0; SplitIndex <= m_SplitHorizList.Count - 1; SplitIndex++) { - Split.SplitHorizList[SplitIndex].SetIsRelative(m_SplitHorizList[SplitIndex].IsRelative); - Split.SplitHorizList[SplitIndex].SetDimension(m_SplitHorizList[SplitIndex].Dimension); - Split.SplitHorizList[SplitIndex].SetMeasureType(m_SplitHorizList[SplitIndex].MeasureType); + split.SplitHorizList[SplitIndex].SetIsRelative(m_SplitHorizList[SplitIndex].IsRelative); + split.SplitHorizList[SplitIndex].SetDimension(m_SplitHorizList[SplitIndex].Dimension); + split.SplitHorizList[SplitIndex].SetMeasureType(m_SplitHorizList[SplitIndex].MeasureType); } - foreach (var ElementDimension in ElementDimHorizList) - Split.ElemDimHorizList.Add(ElementDimension.Deserialize((Area)ParentArea)); + for (int index = 0; index < ElementDimHorizList.Count; index++) + split.ElemDimHorizList.ElementAt(index).SetDimension(m_ElemDimHorizList[index].Value); } foreach (var Area in AreaList) { - var AreaDeserealized = Area.Deserialize(Split, ParentWindow); + var AreaDeserealized = Area.Deserialize(split, ParentWindow); if (AreaDeserealized != null) { - Split.AreaList.Add(AreaDeserealized); + split.AreaList.Add(AreaDeserealized); } } - return Split; + return split; } } diff --git a/WebWindowComplex/Models/ElementDimension.cs b/WebWindowComplex/Models/ElementDimension.cs index 2a606c8..29e93cc 100644 --- a/WebWindowComplex/Models/ElementDimension.cs +++ b/WebWindowComplex/Models/ElementDimension.cs @@ -43,7 +43,6 @@ namespace WebWindowComplex.Models } } } - public int nIndex { get @@ -72,7 +71,6 @@ namespace WebWindowComplex.Models return m_ParentArea; } } - public double dOverlap { get @@ -105,6 +103,10 @@ namespace WebWindowComplex.Models m_sName = dValue; } + public void SetOverlapElement(double dValue) + { + m_dOverlap = dValue; + } public ElementDimension Copy() { @@ -116,11 +118,6 @@ namespace WebWindowComplex.Models #region Internal Methods - internal void SetOverlap(double overlap) - { - m_dOverlap = overlap; - } - internal JsonElementDimension Serialize() { JsonElementDimension JsonElementDimension = new JsonElementDimension(m_nIndex, m_dDimension); @@ -129,14 +126,10 @@ namespace WebWindowComplex.Models #endregion Internal Methods - #region Protected Fields - - protected Area m_ParentArea; - - #endregion Protected Fields - #region Private Fields + private Area m_ParentArea; + private double m_dDimension; private double m_dOverlap; diff --git a/WebWindowComplex/Models/Frame.cs b/WebWindowComplex/Models/Frame.cs index 592070b..95685ac 100644 --- a/WebWindowComplex/Models/Frame.cs +++ b/WebWindowComplex/Models/Frame.cs @@ -13,9 +13,7 @@ namespace WebWindowComplex.Models public class Frame : Area { #region Public Fields - // Lista hardware completa passata dal chiamante del componente - public static Dictionary> m_AllThresholdListOld = new Dictionary>(); - + // Lista soglie completa passata dal chiamante del componente public static List m_AllThresholdList = new List(); @@ -681,54 +679,59 @@ namespace WebWindowComplex.Models /// internal double AvailArea() { - 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; - } + // larghezza - elementDim(1) - elementDim(last) + overlapDd + overlapSx + return DimensionList.FirstOrDefault(x => x.sName.Equals("Width")).dDimension - + ElementDimensionList.ElementAt(1).dDimension - + ElementDimensionList.Last().dDimension + + ElementDimensionList.ElementAt(1).dOverlap + + ElementDimensionList.Last().dOverlap; + //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.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.TRIANGLE: + // { + // // larghezza + // return DimensionList.FirstOrDefault(x => x.sName.Equals("Width")).dDimension; + // } - case Shapes.CUSTOM: - { - return -1; - } - } - return -1; + // case Shapes.CUSTOM: + // { + // return -1; + // } + // } } #endregion Internal Methods diff --git a/WebWindowComplex/Models/FrameDimension.cs b/WebWindowComplex/Models/FrameDimension.cs index dbde1c9..da3f8ac 100644 --- a/WebWindowComplex/Models/FrameDimension.cs +++ b/WebWindowComplex/Models/FrameDimension.cs @@ -177,8 +177,6 @@ namespace WebWindowComplex.Models private bool m_bIsLen = false; - //private double m_dDimension; - private int m_nIndex; private string m_sName; diff --git a/WebWindowComplex/Models/SashDimension.cs b/WebWindowComplex/Models/SashDimension.cs index c4bfe08..c708f3e 100644 --- a/WebWindowComplex/Models/SashDimension.cs +++ b/WebWindowComplex/Models/SashDimension.cs @@ -328,7 +328,10 @@ namespace WebWindowComplex.Models } set { - m_bDimensionLight = value; + if(m_bDimensionLight != value) + { + m_bDimensionLight = value; + } } } @@ -597,8 +600,6 @@ namespace WebWindowComplex.Models private bool m_bHasHandle; - //private double m_dDimension; - private int m_nSashId; private List m_OpeningTypeList = new List @@ -639,8 +640,6 @@ namespace WebWindowComplex.Models private bool m_bDimensionLight = false; - //private MeasureTypes m_SelMeasureType; - #endregion Private Fields } diff --git a/WebWindowComplex/Models/Split.cs b/WebWindowComplex/Models/Split.cs index 4b3a586..d5b4140 100644 --- a/WebWindowComplex/Models/Split.cs +++ b/WebWindowComplex/Models/Split.cs @@ -92,7 +92,7 @@ namespace WebWindowComplex.Models } dLastDimension += m_SplitHorizList[m_SplitHorizList.Count - 1].dDimension; m_SplitHorizList[m_SplitHorizList.Count - 1].SetDimension(dLastDimension); - ElemDimHorizList.RemoveAt(ElemDimHorizList.Count); + ElemDimHorizList.RemoveAt(ElemDimHorizList.Count-1); } // Controllo quanti split verticali ci sono int nVert = m_SplitVertList.Count > 0 ? m_SplitVertList.Count : 1; @@ -198,6 +198,8 @@ namespace WebWindowComplex.Models dLastDimension += m_SplitVertList[m_SplitVertList.Count - 1].dDimension; m_SplitVertList[m_SplitVertList.Count - 1].SetDimension(dLastDimension); } + ElemDimVertList.RemoveAt(ElemDimVertList.Count - 1); + } // Controllo quanti split orizzontali ci sono int nHoriz = m_SplitHorizList.Count > 0 ? m_SplitHorizList.Count : 1; @@ -511,8 +513,15 @@ namespace WebWindowComplex.Models for (var SplitIndex = m_SplitHorizList.Count - 1; SplitIndex >= QtyHoriz; SplitIndex += -1) m_SplitHorizList.RemoveAt(SplitIndex); } - for (int i = 0; i < QtyHoriz; i++) - ElemDimHorizList.Add(new ElementDimension(this, i + 1, 78)); + if(QtyHoriz == 0) + { + ElemDimHorizList.Clear(); + } + else + { + for (int i = 0; i < QtyHoriz; i++) + ElemDimHorizList.Add(new ElementDimension(this, i + 1, 78)); + } } internal void SetSplitQtyVert(int QtyVert) @@ -539,6 +548,15 @@ namespace WebWindowComplex.Models for (var SplitIndex = m_SplitVertList.Count - 1; SplitIndex >= QtyVert; SplitIndex += -1) m_SplitVertList.RemoveAt(SplitIndex); } + if (QtyVert == 0) + { + ElemDimVertList.Clear(); + } + else + { + for (int i = 0; i < QtyVert; i++) + ElemDimVertList.Add(new ElementDimension(this, i + 1, 78)); + } } internal void SetSplitShape(SplitShapes Value) diff --git a/WebWindowComplex/Models/SplitDimension.cs b/WebWindowComplex/Models/SplitDimension.cs index f00152a..f51736f 100644 --- a/WebWindowComplex/Models/SplitDimension.cs +++ b/WebWindowComplex/Models/SplitDimension.cs @@ -470,11 +470,6 @@ namespace WebWindowComplex.Models return JsonSplitDimension; } - //internal void SetDimension(double dValue) - //{ - // m_dDimension = dValue; - //} - internal void SetIsRelative(bool value) { m_bIsRelative = value; @@ -545,17 +540,6 @@ namespace WebWindowComplex.Models private bool m_bIsVertListDim = false; - //private double m_dDimension; - - //private List m_MeasureTypeList = new List - //{ - // new IdNameStruct((int)MeasureTypes.ABSOLUTE, "Absolute"), - // new IdNameStruct((int)MeasureTypes.PROPORTIONAL, "Proportional"), - // new IdNameStruct((int)MeasureTypes.PERCENTAGE, "Percentage"), - //}; - - //private MeasureTypes m_SelMeasureType; - // reference private Split m_Parent; diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index ef5d122..26ad4d7 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -168,6 +168,10 @@ namespace WebWindowComplex { get => m_SplittedList; } + protected List SplitList + { + get => m_SplitList; + } protected string SelColorMaterial { get; set; } = ""; protected string SelFamilyHardware { get; set; } = ""; @@ -175,11 +179,6 @@ namespace WebWindowComplex protected string SelMaterial { get; set; } = ""!; protected string SelProfile { get; set; } = ""; - protected List SplitList - { - get => m_SplitList; - } - #endregion Protected Properties #region Protected Methods @@ -760,12 +759,12 @@ namespace WebWindowComplex } } } - if(LiveData.DictElement.Count > 0) + if(LiveData.ProfElementList.Count > 0) { // Inserisco i profili ricevuti nei rispettivi Element - foreach (var item in LiveData.DictElement) + foreach (var item in LiveData.ProfElementList) { - + UpdateProfileElement(item.Profiles, item.GroupId, item.SashId); } } } @@ -1049,22 +1048,45 @@ namespace WebWindowComplex AdvStep(CompileStep.Tree); } + ///// + ///// Metodo per cercare un area precisa + ///// + ///// Area che si sta analizzando + ///// Id Area che si sta cercando + ///// Area che si sta cercando + ///// + //private Area SearchArea(Area currentArea, int idSearch, Area itemSearch) + //{ + // if (currentArea.GroupId == idSearch && currentArea.AreaType.Equals(itemSearch.AreaType)) + // { + // return currentArea; + // } + // foreach (Area child in currentArea.AreaList) + // { + // Area found = SearchArea(child, idSearch, itemSearch); + // if (found != null) + // { + // return found; + // } + // } + // return null; + //} + /// - /// Metodo per cercare un area precisa + /// Metodo per cercare un area precisa partendo da GroupId /// /// Area che si sta analizzando /// Id Area che si sta cercando - /// Area che si sta cercando /// - private Area SearchArea(Area currentArea, int idSearch, Area itemSearch) + private Area SearchAreaFromGroupId(Area currentArea, int idSearch) { - if (currentArea.GroupId == idSearch && currentArea.AreaType.Equals(itemSearch.AreaType)) + if (currentArea.GroupId == idSearch) { return currentArea; } foreach (Area child in currentArea.AreaList) { - Area found = SearchArea(child, idSearch, itemSearch); + Area found = SearchAreaFromGroupId(child, idSearch); if (found != null) { return found; @@ -1074,50 +1096,66 @@ namespace WebWindowComplex } /// - /// Metodo per cercare un area precisa + /// Metodo per aggiornare i nomi dei profili degli elementi /// - /// Area che si sta analizzando - /// Id Area che si sta cercando - /// Indice che si sta cercando + /// Lista dei profili + /// Id Area che si sta cercando + /// Id dell'anta (se -1 non usare) /// - private Area UpdateIdElement(Area currentArea, int idSearch, int index) + private void UpdateProfileElement(List profileNameList, int GroupIdSearch, int SashIdSearch = -1) { - switch (currentArea.AreaType) + // Cerco area corrispondente al GroupId + Area found = SearchAreaFromGroupId(FrameWindow, SashIdSearch); + switch (found.AreaType) { case AreaTypes.FRAME: { - Frame frame = (Frame)currentArea; - foreach(var item in frame.ElementDimensionList) + Frame frame = (Frame)found; + for(int i = 0; i < frame.ElementDimensionList.Count; i++) { - //if(item.nIndex == index) - + frame.ElementDimensionList.ElementAt(i).SetNameElement(profileNameList.ElementAt(i)); } break; } case AreaTypes.SASH: { + Sash sash = (Sash)found; + SashDimension anta = sash.SashList.ElementAt(SashIdSearch); + for(int index = anta.ElementDimensionList.Count; index < profileNameList.Count; index++) + { + double valStd = Window.m_ParameterList.GetValueOrDefault(profileNameList.ElementAt(index) + "_DimStd"); + anta.ElementDimensionList.Add(new ElementDimension(sash, index + 1, valStd)); + } + for (int i = 0; i < anta.ElementDimensionList.Count; i++) + { + anta.ElementDimensionList.ElementAt(i).SetNameElement(profileNameList.ElementAt(i)); + } break; } case AreaTypes.SPLIT: { + Split split = (Split)found; + for (int i = 0; i < split.ElemDimVertList.Count; i++) + { + split.ElemDimVertList.ElementAt(i).SetNameElement(profileNameList.ElementAt(i)); + } + for (int i = split.ElemDimVertList.Count; i < split.ElemDimHorizList.Count; i++) + { + split.ElemDimHorizList.ElementAt(i).SetNameElement(profileNameList.ElementAt(i)); + } break; } } - foreach (Area child in currentArea.AreaList) + foreach (Area child in found.AreaList) { - Area found = UpdateIdElement(child, idSearch, index); - if (found != null) - { - return found; - } + UpdateProfileElement(profileNameList, GroupIdSearch, SashIdSearch); } - return null; } /// /// Metodo per aggiornare valori della sezione General /// - /// + /// private void UpdatePreviewGeneral(DataUpdateGeneral args) { string Color = args.Color; @@ -1209,7 +1247,7 @@ namespace WebWindowComplex if (newFill != null) { // cerco il record - var currRec = (Fill)SearchArea(FrameWindow, newFill.GroupId, newFill); + var currRec = (Fill)SearchAreaFromGroupId(FrameWindow, newFill.GroupId); // lo aggiorno currRec = newFill; await DoPreviewSvg(); @@ -1302,7 +1340,7 @@ namespace WebWindowComplex if (newSash != null) { // cerco il record - var currRec = SearchArea(FrameWindow, newSash.GroupId, newSash); + var currRec = SearchAreaFromGroupId(FrameWindow, newSash.GroupId); // lo aggiorno currRec = newSash; // resetto hw lst @@ -1325,7 +1363,7 @@ namespace WebWindowComplex if (newSash != null) { // cerco il record - var currRec = SearchArea(FrameWindow, newSash.GroupId, newSash); + var currRec = SearchAreaFromGroupId(FrameWindow, newSash.GroupId); // lo aggiorno currRec = newSash; // resetto hw lst @@ -1350,7 +1388,7 @@ namespace WebWindowComplex if (newSplit != null) { // cerco il record - var currRec = SearchArea(FrameWindow, newSplit.GroupId, newSplit); + var currRec = SearchAreaFromGroupId(FrameWindow, newSplit.GroupId); // lo aggiorno currRec = newSplit; if (!noSvg) @@ -1372,7 +1410,7 @@ namespace WebWindowComplex { if (currSplitted != null) { - var item = SearchArea(FrameWindow, currSplitted.GroupId, currSplitted); + var item = SearchAreaFromGroupId(FrameWindow, currSplitted.GroupId); item = currSplitted; // ricalcolo liste UpdateLists(); @@ -1396,7 +1434,7 @@ namespace WebWindowComplex bool noSvg = args.noSvg; if (svgNoHw) { - Sash item = (Sash)SearchArea(FrameWindow, newSash.GroupId, newSash); + Sash item = (Sash)SearchAreaFromGroupId(FrameWindow, newSash.GroupId); if (newSash != null && item != null) { item = newSash; @@ -1405,7 +1443,7 @@ namespace WebWindowComplex } else { - Sash item = (Sash)SearchArea(FrameWindow, newSash.GroupId, newSash); + Sash item = (Sash)SearchAreaFromGroupId(FrameWindow, newSash.GroupId ); if (newSash != null && item != null) { item = newSash; diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 7faa759..d765ef4 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.8.1.2613 + 2.8.1.2715 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -79,6 +79,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 51b985d..0bb6e8a 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.8.1.2613 + 2.8.1.2715 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -124,6 +124,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + +