From dfe4ecd9d15a0480bc2628b841a4d20153fb0274 Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Tue, 2 Dec 2025 16:44:01 +0100 Subject: [PATCH] Aggiunto arc element per Frame e Sash (da rivedere) --- Test.UI/Components/Pages/EditJWD.razor.cs | 3 +- Test.UI/Data/ArcoAntaDoppia.jwd | 150 ++++++++++++++++++ Test.UI/Test.UI.csproj | 3 + WebWindowComplex/Compo/AreaFrameArcElem.razor | 66 ++++++++ .../Compo/AreaFrameArcElem.razor.cs | 81 ++++++++++ WebWindowComplex/Compo/AreaSash.razor | 39 ++--- WebWindowComplex/Compo/AreaSash.razor.cs | 2 +- WebWindowComplex/Compo/AreaSashArcElem.razor | 58 +++++++ .../Compo/AreaSashArcElem.razor.cs | 75 +++++++++ WebWindowComplex/Compo/CardArcElement.razor | 27 ++++ .../Compo/CardArcElement.razor.cs | 60 +++++++ WebWindowComplex/Compo/CardSashGroup.razor | 2 +- WebWindowComplex/Compo/CardSplit.razor | 2 +- WebWindowComplex/Json/JsonUtility.cs | 147 +++++++++++++++-- WebWindowComplex/Json/WindowConst.cs | 2 +- WebWindowComplex/LayoutConst.cs | 3 +- WebWindowComplex/Models/Area.cs | 9 +- WebWindowComplex/Models/Frame.cs | 65 +++++++- WebWindowComplex/Models/FrameArcElement.cs | 121 ++++++++++++++ WebWindowComplex/Models/FrameDimension.cs | 4 +- WebWindowComplex/Models/Sash.cs | 36 ++++- WebWindowComplex/Models/SashArcElement.cs | 96 +++++++++++ WebWindowComplex/Models/SashDimension.cs | 27 ++-- WebWindowComplex/Models/SplitDimension.cs | 26 +-- WebWindowComplex/TableComp.razor | 17 ++ WebWindowComplex/TableComp.razor.cs | 2 + WebWindowComplex/WebWindowComplex.csproj | 10 +- .../WebWindowConfigurator.csproj | 20 ++- 28 files changed, 1075 insertions(+), 78 deletions(-) create mode 100644 Test.UI/Data/ArcoAntaDoppia.jwd create mode 100644 WebWindowComplex/Compo/AreaFrameArcElem.razor create mode 100644 WebWindowComplex/Compo/AreaFrameArcElem.razor.cs create mode 100644 WebWindowComplex/Compo/AreaSashArcElem.razor create mode 100644 WebWindowComplex/Compo/AreaSashArcElem.razor.cs create mode 100644 WebWindowComplex/Compo/CardArcElement.razor create mode 100644 WebWindowComplex/Compo/CardArcElement.razor.cs create mode 100644 WebWindowComplex/Models/FrameArcElement.cs create mode 100644 WebWindowComplex/Models/SashArcElement.cs diff --git a/Test.UI/Components/Pages/EditJWD.razor.cs b/Test.UI/Components/Pages/EditJWD.razor.cs index 3e41df8..50f69ca 100644 --- a/Test.UI/Components/Pages/EditJWD.razor.cs +++ b/Test.UI/Components/Pages/EditJWD.razor.cs @@ -127,7 +127,8 @@ namespace Test.UI.Components.Pages { ConfInit(); //InitialJwd = File.ReadAllText("Data\\FinestraSplitVert.jwd"); - InitialJwd = File.ReadAllText("Data\\AntaDoppia.jwd"); + //InitialJwd = File.ReadAllText("Data\\AntaDoppia.jwd"); + InitialJwd = File.ReadAllText("Data\\ArcoAntaDoppia.jwd"); currJwd = InitialJwd; // rileggo altri dati await ReloadData(); diff --git a/Test.UI/Data/ArcoAntaDoppia.jwd b/Test.UI/Data/ArcoAntaDoppia.jwd new file mode 100644 index 0000000..b9032e7 --- /dev/null +++ b/Test.UI/Data/ArcoAntaDoppia.jwd @@ -0,0 +1,150 @@ +{ + "ProfilePath": "Profilo78", + "Material": "Pino", + "ColorMaterial": "Black", + "Glass": "Vetro BE 2S 4T/16/4T", + "AreaList": [ + { + "Shape": "ARC", + "DimensionList": [ + { + "Index": 1, + "Name": "Width", + "Value": 800.0 + }, + { + "Index": 2, + "Name": "Height", + "Value": 1500.0 + }, + { + "Index": 3, + "Name": "Full Height", + "Value": 1800.0 + } + ], + "JointList": [ + { + "Index": 1, + "JointType": "FULL_H" + }, + { + "Index": 2, + "JointType": "FULL_H" + }, + { + "Index": 3, + "JointType": "FULL_V" + }, + { + "Index": 4, + "JointType": "FULL_V" + } + ], + "BottomRail": false, + "BottomRailQty": 0, + "ArcElement": { + "Section": 10.0, + "CutEdge": true, + "IsAlign": true + }, + "GroupId": 1, + "AreaList": [ + { + "IsSashVertical": true, + "ArcElement": { + "Section": 10.0, + "CutEdge": true, + "IsAlign": true + }, + "SashList": [ + { + "SashId": 1, + "OpeningType": "TILTTURN_LEFT", + "MeasureType": "PERCENTAGE", + "Dimension": 50.0, + "HasHandle": true, + "JointList": [ + { + "Index": 1, + "JointType": "FULL_V" + }, + { + "Index": 2, + "JointType": "FULL_V" + }, + { + "Index": 3, + "JointType": "FULL_V" + }, + { + "Index": 4, + "JointType": "FULL_V" + } + ] + }, + { + "SashId": 2, + "OpeningType": "TURNONLY_RIGHT", + "MeasureType": "PERCENTAGE", + "Dimension": 50.0, + "HasHandle": false, + "JointList": [ + { + "Index": 1, + "JointType": "FULL_V" + }, + { + "Index": 2, + "JointType": "FULL_V" + }, + { + "Index": 3, + "JointType": "FULL_V" + }, + { + "Index": 4, + "JointType": "FULL_V" + } + ] + } + ], + "SashType": "NULL", + "BottomRail": false, + "BottomRailQty": 0, + "Hardware": "000644", + "HwOptionList": [], + "GroupId": 2, + "AreaList": [ + { + "GroupId": 4, + "AreaList": [ + { + "FillType": "GLASS", + "GroupId": 3, + "AreaList": [], + "AreaType": "FILL" + } + ], + "AreaType": "SPLITTED" + }, + { + "GroupId": 5, + "AreaList": [ + { + "FillType": "GLASS", + "GroupId": 6, + "AreaList": [], + "AreaType": "FILL" + } + ], + "AreaType": "SPLITTED" + } + ], + "AreaType": "SASH" + } + ], + "AreaType": "FRAME" + } + ] +} \ No newline at end of file diff --git a/Test.UI/Test.UI.csproj b/Test.UI/Test.UI.csproj index 8cf883b..75050e1 100644 --- a/Test.UI/Test.UI.csproj +++ b/Test.UI/Test.UI.csproj @@ -43,6 +43,9 @@ + + Always + Always diff --git a/WebWindowComplex/Compo/AreaFrameArcElem.razor b/WebWindowComplex/Compo/AreaFrameArcElem.razor new file mode 100644 index 0000000..0cdc13c --- /dev/null +++ b/WebWindowComplex/Compo/AreaFrameArcElem.razor @@ -0,0 +1,66 @@ + +
+
+
Frame
+
+
+
+
+
+
+
+ +
+
+
+ Qty element + @if (insertQty) + { + + } + else + { + + } +
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+
+ Section + @if (!insertQty) + { + + } + else + { + + } +
+
+
+
+
+ +
+
+ +
+
+
+
+
diff --git a/WebWindowComplex/Compo/AreaFrameArcElem.razor.cs b/WebWindowComplex/Compo/AreaFrameArcElem.razor.cs new file mode 100644 index 0000000..5cc8d19 --- /dev/null +++ b/WebWindowComplex/Compo/AreaFrameArcElem.razor.cs @@ -0,0 +1,81 @@ +using Microsoft.AspNetCore.Components; +using System.Runtime.CompilerServices; +using WebWindowComplex.DTO; +using WebWindowComplex.Models; + +namespace WebWindowComplex.Compo +{ + public partial class AreaFrameArcElem + { + #region Public Properties + + [Parameter] + public Frame CurrFrame { get; set; } = null!; + + [Parameter] + public EventCallback EC_UpdatePreview { get; set; } + + #endregion Public Properties + + #region Protected Properties + + protected int ArcElementQty + { + get => CurrFrame.FrameArcElem.nQty; + set + { + CurrFrame.FrameArcElem.nQty = value; + _ = EC_UpdatePreview.InvokeAsync(CurrFrame); + } + } + + protected double ArcSection + { + get => CurrFrame.FrameArcElem.nSection; + set + { + CurrFrame.FrameArcElem.nSection = value; + _ = EC_UpdatePreview.InvokeAsync(CurrFrame); + } + } + + #endregion Protected Properties + + #region Protected Methods + + protected void IsCheckedQty() + { + insertQty = !insertQty; + } + + protected void IsCheckCutEdge() + { + CurrFrame.FrameArcElem.bCutEdge = !CurrFrame.FrameArcElem.bCutEdge; + _ = EC_UpdatePreview.InvokeAsync(CurrFrame); + } + + protected void IsCheckAlign() + { + CurrFrame.FrameArcElem.bIsAlign = !CurrFrame.FrameArcElem.bIsAlign; + _ = EC_UpdatePreview.InvokeAsync(CurrFrame); + } + + protected string IsUsedQty() + { + if (insertQty) + return "form-control"; + else + return "form-control disabled"; + } + + + #endregion Protected Methods + + #region Private Fields + + private bool insertQty = false; + + #endregion Private Fields + } + +} \ No newline at end of file diff --git a/WebWindowComplex/Compo/AreaSash.razor b/WebWindowComplex/Compo/AreaSash.razor index 5e91ec6..3ddd227 100644 --- a/WebWindowComplex/Compo/AreaSash.razor +++ b/WebWindowComplex/Compo/AreaSash.razor @@ -4,26 +4,29 @@
Sash @(CurrSashGroup.SashList.Count == 1 ? "" : (IndexSash + 1))
- + }
diff --git a/WebWindowComplex/Compo/AreaSash.razor.cs b/WebWindowComplex/Compo/AreaSash.razor.cs index c62b8bf..c3cff0e 100644 --- a/WebWindowComplex/Compo/AreaSash.razor.cs +++ b/WebWindowComplex/Compo/AreaSash.razor.cs @@ -84,7 +84,7 @@ namespace WebWindowComplex.Compo { switch (CurrSashDim.MeasureType) { - case Json.WindowConst.MeasureTypes.ABSOLUT: + case Json.WindowConst.MeasureTypes.ABSOLUTE: { return 2; } diff --git a/WebWindowComplex/Compo/AreaSashArcElem.razor b/WebWindowComplex/Compo/AreaSashArcElem.razor new file mode 100644 index 0000000..b68d1f9 --- /dev/null +++ b/WebWindowComplex/Compo/AreaSashArcElem.razor @@ -0,0 +1,58 @@ + +
+
+
Sash
+
+
+
+
+
+
+
+ +
+
+
+ Qty element + @if (insertQty) + { + + } + else + { + + } +
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+
+ Section + @if (!insertQty) + { + + } + else + { + + } +
+
+
+
+
+
diff --git a/WebWindowComplex/Compo/AreaSashArcElem.razor.cs b/WebWindowComplex/Compo/AreaSashArcElem.razor.cs new file mode 100644 index 0000000..eff80f7 --- /dev/null +++ b/WebWindowComplex/Compo/AreaSashArcElem.razor.cs @@ -0,0 +1,75 @@ +using Microsoft.AspNetCore.Components; +using System.Runtime.CompilerServices; +using WebWindowComplex.DTO; +using WebWindowComplex.Models; + +namespace WebWindowComplex.Compo +{ + public partial class AreaSashArcElem + { + #region Public Properties + + [Parameter] + public Sash CurrSashGroup { get; set; } = null!; + + [Parameter] + public EventCallback EC_UpdatePreview { get; set; } + + #endregion Public Properties + + #region Protected Properties + + protected int ArcElementQty + { + get => CurrSashGroup.SashArcElem.nQty; + set + { + CurrSashGroup.SashArcElem.nQty = value; + _ = EC_UpdatePreview.InvokeAsync(CurrSashGroup); + } + } + + protected double ArcSection + { + get => CurrSashGroup.SashArcElem.nSection; + set + { + CurrSashGroup.SashArcElem.nSection = value; + _ = EC_UpdatePreview.InvokeAsync(CurrSashGroup); + } + } + + #endregion Protected Properties + + #region Protected Methods + + protected void IsCheckedQty() + { + insertQty = !insertQty; + } + + protected void IsCheckCutEdge() + { + CurrSashGroup.SashArcElem.bCutEdge = !CurrSashGroup.SashArcElem.bCutEdge; + _ = EC_UpdatePreview.InvokeAsync(CurrSashGroup); + } + + protected string IsUsedQty() + { + if (insertQty) + return "form-control"; + else + return "form-control disabled"; + } + + + #endregion Protected Methods + + #region Private Fields + + private bool insertQty = false; + + #endregion Private Fields + } + +} \ No newline at end of file diff --git a/WebWindowComplex/Compo/CardArcElement.razor b/WebWindowComplex/Compo/CardArcElement.razor new file mode 100644 index 0000000..e29174e --- /dev/null +++ b/WebWindowComplex/Compo/CardArcElement.razor @@ -0,0 +1,27 @@ +
+
+
+
+
Arc Element
+
+
+ +
+
+
+
+
+ + + + @foreach (var sashGroup in SashList) + { +
+ + + } +
+
+
\ No newline at end of file diff --git a/WebWindowComplex/Compo/CardArcElement.razor.cs b/WebWindowComplex/Compo/CardArcElement.razor.cs new file mode 100644 index 0000000..19bc564 --- /dev/null +++ b/WebWindowComplex/Compo/CardArcElement.razor.cs @@ -0,0 +1,60 @@ +using Microsoft.AspNetCore.Components; +using WebWindowComplex.DTO; +using WebWindowComplex.Models; + +namespace WebWindowComplex.Compo +{ + public partial class CardArcElement + { + #region Public Properties + + /// + /// Finestra corrente + /// + [Parameter] + public Frame CurrFrame { get; set; } = null!; + + /// + /// Lista sash group + /// + [Parameter] + public List SashList { get; set; } = null!; + + [Parameter] + public EventCallback EC_UpdatePreview { get; set; } + + [Parameter] + public EventCallback EC_ReqClose { get; set; } + + #endregion Public Properties + + private async Task UpdatePreview() + { + var args = new DataUpdateFrame + { + currFrame = CurrFrame + }; + await EC_UpdatePreview.InvokeAsync(args); + } + + private async Task UpdatePreviewSash(Sash CurrSashGRoup) + { + var currRec = SashList.First(x => x.GroupId == CurrSashGRoup.GroupId); + if (currRec != null) + { + currRec = CurrSashGRoup; + var args = new DataUpdateFrame + { + currFrame = CurrFrame + }; + await EC_UpdatePreview.InvokeAsync(args); + } + } + + private void ReqClose() + { + _ = EC_ReqClose.InvokeAsync(true); + } + } + +} \ No newline at end of file diff --git a/WebWindowComplex/Compo/CardSashGroup.razor b/WebWindowComplex/Compo/CardSashGroup.razor index 33f4aa2..9689706 100644 --- a/WebWindowComplex/Compo/CardSashGroup.razor +++ b/WebWindowComplex/Compo/CardSashGroup.razor @@ -110,7 +110,7 @@
@@ -188,6 +197,14 @@ EC_ReqClose="ReturnTree"> } + else if (currStep == CompileStep.ArcElement) + { + + + }
diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index 20c4d59..16fbfb4 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -601,9 +601,11 @@ namespace WebWindowComplex new Joint(frame, 3, Joints.FULL_H), new Joint(frame, 4, Joints.FULL_H) }; + FrameArcElement ae = new FrameArcElement(frame, window, 10, true, true); JsonWindow jsonWindow = new JsonWindow("Profilo78", "Pino", "Black", "Vetro BE 2S 4T/16/4T"); JsonFrame jsonFrame = new JsonFrame(Shapes.RECTANGLE, false, 0, 1); jsonWindow.AreaList.Add(jsonFrame); + jsonFrame.ArcElement = ae.Serialize(); foreach (var Dimension in DimensionList) jsonFrame.DimensionList.Add(Dimension.Serialize()); foreach (var Joint in JointList) diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index be9f69c..a029df9 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.11.2818 + 2.7.12.216 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -191,6 +191,14 @@ + + + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 7678d14..1e3e508 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.11.2818 + 2.7.12.216 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -271,6 +271,24 @@ + + + + + + + + + + + + + + + + + +