diff --git a/Test.UI/Data/AntaDoppia.jwd b/Test.UI/Data/AntaDoppia.jwd index 07d466c..d1d65fe 100644 --- a/Test.UI/Data/AntaDoppia.jwd +++ b/Test.UI/Data/AntaDoppia.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, diff --git a/WebWindowComplex/Compo/CardFrame.razor b/WebWindowComplex/Compo/CardFrame.razor index dfc737d..f56bbb9 100644 --- a/WebWindowComplex/Compo/CardFrame.razor +++ b/WebWindowComplex/Compo/CardFrame.razor @@ -66,6 +66,25 @@ } + @if (SashList.Count == 0) + { +
+
Bottom rail
+
+
+
+ Quantity + @if (User) + { + + } + else + { + + } +
+
+ }
@@ -101,27 +120,19 @@ } -
- @if (SashList.Count == 0) - { -
-
Bottom rail
+
+
+
+
Element
-
-
- Quantity - @if (User) - { - - } - else - { - - } -
-
- } -
+
+
+ @foreach (var element in CurrFrameWindow.ElementDimensionList) + { + + } +
+
diff --git a/WebWindowComplex/Compo/CardFrame.razor.cs b/WebWindowComplex/Compo/CardFrame.razor.cs index a11d31c..07fe789 100644 --- a/WebWindowComplex/Compo/CardFrame.razor.cs +++ b/WebWindowComplex/Compo/CardFrame.razor.cs @@ -242,6 +242,28 @@ namespace WebWindowComplex.Compo } } + /// + /// Aggiornamento element + /// + /// + /// + private async Task UpdateElement(ElementDimension updRec) + { + // cerco il record + var currRec = CurrFrameWindow.ElementDimensionList.FirstOrDefault(x => x.ParentArea == updRec.ParentArea && x.nIndex == updRec.nIndex); + // lo aggiorno + if (updRec != null) + { + currRec = updRec; + var args = new DataUpdateFrame() + { + currFrame = CurrFrameWindow, + svgNoHw = false + }; + await EC_UpdateFrame.InvokeAsync(args); + } + } + /// /// Metodo per la visualizzazione dei pulsanti joint /// diff --git a/WebWindowComplex/Compo/EditElement.razor b/WebWindowComplex/Compo/EditElement.razor new file mode 100644 index 0000000..f92285b --- /dev/null +++ b/WebWindowComplex/Compo/EditElement.razor @@ -0,0 +1,12 @@ +@using static WebWindowComplex.LayoutConst +
+ @(CurrRec.nIndex) + @if (User) + { + + } + else + { + + } +
\ No newline at end of file diff --git a/WebWindowComplex/Compo/EditElement.razor.cs b/WebWindowComplex/Compo/EditElement.razor.cs new file mode 100644 index 0000000..55b4bb3 --- /dev/null +++ b/WebWindowComplex/Compo/EditElement.razor.cs @@ -0,0 +1,48 @@ +using Microsoft.AspNetCore.Components; +using WebWindowComplex.Models; + +namespace WebWindowComplex.Compo +{ + public partial class EditElement + { + #region Public Properties + + /// + /// Joint corrente + /// + [Parameter] + public ElementDimension CurrRec { get; set; } = null!; + + + [Parameter] + public EventCallback EC_Update { get; set; } + + /// + /// Livello di accesso (utente base) + /// + [CascadingParameter(Name = "User")] + public bool User { get; set; } = false!; + + #endregion Public Properties + + #region Private Properties + + /// + /// Metodo per aggiornare element corrente + /// + private double updateVal + { + get => CurrRec.dDimension; + set + { + if (CurrRec.dDimension != value) + { + CurrRec.SetDimension(value); + _ = EC_Update.InvokeAsync(CurrRec); + } + } + } + + #endregion Private Properties + } +} \ No newline at end of file diff --git a/WebWindowComplex/Json/JsonUtility.cs b/WebWindowComplex/Json/JsonUtility.cs index a9a594b..3d784bc 100644 --- a/WebWindowComplex/Json/JsonUtility.cs +++ b/WebWindowComplex/Json/JsonUtility.cs @@ -188,6 +188,16 @@ namespace WebWindowComplex.Json } } + private List m_ElementDimensionList = new List(); + [JsonProperty] + public List ElementDimensionList + { + get + { + return m_ElementDimensionList; + } + } + private List m_JointList = new List(); [JsonProperty] public List JointList @@ -286,6 +296,8 @@ namespace WebWindowComplex.Json //Frame.AppliedDone(); for (var DimensionIndex = 0; DimensionIndex <= m_DimensionList.Count - 1; DimensionIndex++) newFrame.DimensionList[DimensionIndex].SetDimension(m_DimensionList[DimensionIndex].Value); + for (var ElementIndex = 0; ElementIndex <= m_ElementDimensionList.Count - 1; ElementIndex++) + newFrame.ElementDimensionList[ElementIndex].SetDimension(ElementDimensionList[ElementIndex].Value); for (var JointIndex = 0; JointIndex <= m_JointList.Count - 1; JointIndex++) newFrame.JointList[JointIndex].SetSelJointType(m_JointList[JointIndex].JointType); foreach (var Area in AreaList) @@ -316,6 +328,16 @@ namespace WebWindowComplex.Json } } + private List m_ElementDimensionList = new List(); + [JsonProperty] + public List ElementDimensionList + { + get + { + return m_ElementDimensionList; + } + } + private List m_SashList = new List(); [JsonProperty] public List SashList @@ -838,6 +860,39 @@ namespace WebWindowComplex.Json } + public class JsonElementDimension + { + private int m_nIndex; + [JsonProperty] + public int Index + { + get + { + return m_nIndex; + } + } + + private double m_dValue; + [JsonProperty] + public double Value + { + get + { + return m_dValue; + } + set + { + m_dValue = value; + } + } + + public JsonElementDimension(int Index, double Value) + { + m_nIndex = Index; + m_dValue = Value; + } + } + public class JsonFrameDimension { private int m_nIndex; diff --git a/WebWindowComplex/Models/ElementDimension.cs b/WebWindowComplex/Models/ElementDimension.cs new file mode 100644 index 0000000..8d866ac --- /dev/null +++ b/WebWindowComplex/Models/ElementDimension.cs @@ -0,0 +1,103 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WebWindowComplex.Json; +using static WebWindowComplex.Json.WindowConst; + +namespace WebWindowComplex.Models +{ + public class ElementDimension + { + #region Public Constructors + + public ElementDimension(Frame ParentArea, int nIndex, double dDimension) + { + m_ParentArea = ParentArea; + m_nIndex = nIndex; + m_dDimension = dDimension; + } + + #endregion Public Constructors + + #region Public Properties + + public double dDimension + { + get + { + return m_dDimension; + } + set + { + if(dDimension != value) + { + if (value > MaxDim) + m_dDimension = MaxDim; + else if (value < MinDim) + m_dDimension = MinDim; + else + m_dDimension = value; + } + } + } + + public int nIndex + { + get + { + return m_nIndex; + } + } + + public Area ParentArea + { + get + { + return m_ParentArea; + } + } + + #endregion Public Properties + + #region Public Methods + + public void SetDimension(double dValue) + { + m_dDimension = dValue; + } + + #endregion Public Methods + + #region Internal Methods + + internal JsonElementDimension Serialize() + { + JsonElementDimension JsonElementDimension = new JsonElementDimension(m_nIndex, m_dDimension); + return JsonElementDimension; + } + + #endregion Internal Methods + + #region Protected Fields + + protected Frame m_ParentArea; + + #endregion Protected Fields + + #region Private Fields + + private double m_dDimension; + + private int m_nIndex; + + // valore massimo della dimensione del frame + private int MaxDim = 200; + // valore minimo della dimensione del frame + private int MinDim = 50; + + #endregion Private Fields + } +} \ No newline at end of file diff --git a/WebWindowComplex/Models/Frame.cs b/WebWindowComplex/Models/Frame.cs index a4fc123..e61ef58 100644 --- a/WebWindowComplex/Models/Frame.cs +++ b/WebWindowComplex/Models/Frame.cs @@ -117,6 +117,12 @@ namespace WebWindowComplex.Models set => m_DimensionList = value; } + public List ElementDimensionList + { + get => m_ElementDimensionList; + set => m_ElementDimensionList = value; + } + public List JointList { get @@ -425,6 +431,8 @@ namespace WebWindowComplex.Models // JsonFrame.ArcElement = null; foreach (var Dimension in DimensionList) JsonFrame.DimensionList.Add(Dimension.Serialize()); + foreach (var ElementDimension in ElementDimensionList) + JsonFrame.ElementDimensionList.Add(ElementDimension.Serialize()); foreach (var Joint in JointList) JsonFrame.JointList.Add(Joint.Serialize()); foreach (var Area in AreaList) @@ -554,6 +562,49 @@ namespace WebWindowComplex.Models break; } } + ElementDimensionList.Clear(); + // aggiungo Element Dimension + switch (Value) + { + 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)); + 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; + } + } m_Shape = Value; } @@ -583,6 +634,8 @@ namespace WebWindowComplex.Models private List m_ThresholdList = new List(); private List m_DimensionList = new List(); + + private List m_ElementDimensionList = new List(); private List m_JointList = new List(); diff --git a/WebWindowComplex/Models/Sash.cs b/WebWindowComplex/Models/Sash.cs index 79098e9..32d8e5f 100644 --- a/WebWindowComplex/Models/Sash.cs +++ b/WebWindowComplex/Models/Sash.cs @@ -249,6 +249,12 @@ namespace WebWindowComplex.Models } } + public List ElementDimensionList + { + get => m_ElementDimensionList; + set => m_ElementDimensionList = value; + } + public bool SashBottomRail { get @@ -648,7 +654,9 @@ namespace WebWindowComplex.Models JsonSash JsonSash = new JsonSash(m_bIsSashVertical, m_SashType, m_bSashBottomRail, m_nSashBottomRailQty, currHwId, GroupId); foreach (var SashDimension in SashList) JsonSash.SashList.Add(SashDimension.Serialize()); - if(HwOptionList.Count > 0) + foreach (var ElementDimension in ElementDimensionList) + JsonSash.ElementDimensionList.Add(ElementDimension.Serialize()); + if (HwOptionList.Count > 0) { foreach (var HwOption in HwOptionList) JsonSash.HwOptionList.Add(HwOption.Serialize()); @@ -868,6 +876,8 @@ namespace WebWindowComplex.Models private int m_nSashBottomRailQty; + private List m_ElementDimensionList = new List(); + private List m_OrientationSashTypeList = new List { new IdNameStruct((int)OrientationSash.VERTICAL, "Vertical"), diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 8925ad2..c473e2e 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.1.1910 + 2.7.1.2114 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -30,3 +30,8 @@ + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 07cb0e1..92b656d 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.1.1910 + 2.7.1.2114 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -37,3 +37,5 @@ + +