From e10ae2824161cbc991f2708200cfc9c0f427f299 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 7 Oct 2025 18:08:34 +0200 Subject: [PATCH 01/10] Ancora update x gestione componente (NON ancora ok al 100% x elenco HW) --- Test.UI/Components/Pages/EditJWD.razor.cs | 20 +- Test.UI/Data/AntaDoppia.jwd | 6 +- Test.UI/Hardware/Setup.json | 398 ++++++++++++++++-- WebWindowComplex/TableComp.razor | 15 +- WebWindowComplex/WebWindowComplex.csproj | 7 +- .../WebWindowConfigurator.csproj | 7 +- 6 files changed, 397 insertions(+), 56 deletions(-) diff --git a/Test.UI/Components/Pages/EditJWD.razor.cs b/Test.UI/Components/Pages/EditJWD.razor.cs index 4e6ecdd..f2edbdf 100644 --- a/Test.UI/Components/Pages/EditJWD.razor.cs +++ b/Test.UI/Components/Pages/EditJWD.razor.cs @@ -44,8 +44,8 @@ namespace Test.UI.Components.Pages protected List AvailHardwareList { get; set; } = new List(); protected List AvailFamilyHardwareList { get; set; } = new List() { - new string("Natura"), - new string("Optima") + new string("Arc"), + new string("Profilo78") }; protected List AvailColorMaterialList { get; set; } = new List() { @@ -55,17 +55,17 @@ namespace Test.UI.Components.Pages }; protected List AvailMaterialList { get; set; } = new List() { - new string("Pine"), - new string("Fir") + new string("Pino"), + new string("Abete") }; protected List AvailGlassList { get; set; } = new List() { - new string("4/12/4"), - new string("4/16/4"), - new string("4/12/4/12/4"), - new string("4/16/4/16/4"), - new string("4T/12/4T"), - new string("4T/16/4T") + new string("Vetro BE 2S 4/12/4"), + new string("Vetro BE 2S 4/16/4"), + new string("Vetro BE 3S 4/12/4/12/4"), + new string("Vetro BE 3S 4/16/4/16/4"), + new string("Vetro BE 2S 4T/12/4T"), + new string("Vetro BE 2S 4T/16/4T") }; protected string SelFamilyHardware { get; set; } = ""; protected string SelColorMaterial { get; set; } = ""; diff --git a/Test.UI/Data/AntaDoppia.jwd b/Test.UI/Data/AntaDoppia.jwd index 12d9235..68dfb32 100644 --- a/Test.UI/Data/AntaDoppia.jwd +++ b/Test.UI/Data/AntaDoppia.jwd @@ -1,8 +1,8 @@ { "ProfilePath": "Profilo78", - "Material": "Pine", + "Material": "Pino", "ColorMaterial": "Black", - "Glass": "4T/16/4T", + "Glass": "Vetro BE 2S 4T/16/4T", "AreaList": [ { "IdGroup": 1, @@ -76,7 +76,7 @@ "JointType": "FULL_V" } ], - "Hardware": "000559", + "Hardware": "000558", "AreaList": [ { "IdGroup": 3, diff --git a/Test.UI/Hardware/Setup.json b/Test.UI/Hardware/Setup.json index ff15768..4a81ba4 100644 --- a/Test.UI/Hardware/Setup.json +++ b/Test.UI/Hardware/Setup.json @@ -1,47 +1,371 @@ [ { - "Id": "000558", - "FamilyName": "Natura", - "Description": "Profilo78_Rect_Sash", - "OpeningType": "ANTA_RIBALTA", - "Shape": "Rectangular", - "SashQty": 1, - "SashPosition": 1 - }, - { - "Id": "000562", - "FamilyName": "Natura", - "Description": "Profilo78_Rect_Sash", - "OpeningType": "ANTA_BANDIERA", - "Shape": "Rectangular", - "SashQty": 1, - "SashPosition": 1 - }, - { - "Id": "000559", - "FamilyName": "Natura", - "Description": "Profilo78_Rect_DoubleSash", - "OpeningType": "ANTA_RIBALTA", - "Shape": "Rectangular", + "Description": "Rect_Sash_Compl", + "FamilyName": "Rect", + "Id": "000547", + "OpeningType": "CO", + "SashPosition": 1, "SashQty": 2, - "SashPosition": 1 + "Shape": "Rectangular" }, { - "Id": "000563", - "FamilyName": "Natura", - "Description": "Profilo78_TurnOnly_Rect_DoubleSash", - "OpeningType": "ANTA_BANDIERA", - "Shape": "Rectangular", - "SashQty": 2, - "SashPosition": 1 + "Description": "Vasistas", + "FamilyName": "Vasistas", + "Id": "000573", + "OpeningType": "VA", + "SashPosition": 1, + "SashQty": 1, + "Shape": "Rectangular" }, { - "Id": "000560", - "FamilyName": "Natura", - "Description": "Profilo78_Rect_TripleSash", - "OpeningType": "ANTA_RIBALTA", - "Shape": "Rectangular", + "Description": "Profilo78_Rect_TripleSash_HiddenHinges", + "FamilyName": "Profilo78", + "Id": "000561", + "OpeningType": "AR", + "SashPosition": 1, "SashQty": 3, - "SashPosition": 1 + "Shape": "Rectangular" + }, + { + "Description": "Profilo78_TurnOnly_Rect_DoubleSash", + "FamilyName": "Profilo78", + "Id": "000563", + "OpeningType": "AB", + "SashPosition": 1, + "SashQty": 2, + "Shape": "Rectangular" + }, + { + "Description": "Profilo78_TurnOnly_Rect_TripleSash", + "FamilyName": "Profilo78", + "Id": "000564", + "OpeningType": "AB", + "SashPosition": 2, + "SashQty": 3, + "Shape": "Rectangular" + }, + { + "Description": "SegArc_2S_TurnOnly", + "FamilyName": "SegArc", + "Id": "000603", + "OpeningType": "AB", + "SashPosition": 1, + "SashQty": 2, + "Shape": "Arc" + }, + { + "Description": "Arc_2S_TurnOnly", + "FamilyName": "Arc", + "Id": "000602", + "OpeningType": "AB", + "SashPosition": 1, + "SashQty": 2, + "Shape": "FullArc" + }, + { + "Description": "SegArc_1S_TurnOnly", + "FamilyName": "SegArc", + "Id": "000601", + "OpeningType": "AB", + "SashPosition": 1, + "SashQty": 1, + "Shape": "Arc" + }, + { + "Description": "SemiArc_1S", + "FamilyName": "SemiArc", + "Id": "000610", + "OpeningType": "AR", + "SashPosition": 1, + "SashQty": 1, + "Shape": "SemiFullArc" + }, + { + "Description": "SemiSegArc_S1", + "FamilyName": "SemiSegArc", + "Id": "000611", + "OpeningType": "AR", + "SashPosition": 1, + "SashQty": 1, + "Shape": "SemiArc" + }, + { + "Description": "Arc_1S", + "FamilyName": "Arc", + "Id": "000596", + "OpeningType": "AR", + "SashPosition": 1, + "SashQty": 1, + "Shape": "FullArc" + }, + { + "Description": "SegArc_2S", + "FamilyName": "SegArc", + "Id": "000599", + "OpeningType": "AR", + "SashPosition": 1, + "SashQty": 2, + "Shape": "Arc" + }, + { + "Description": "SegArc_1S", + "FamilyName": "SegArc", + "Id": "000597", + "OpeningType": "AR", + "SashPosition": 1, + "SashQty": 1, + "Shape": "Arc" + }, + { + "Description": "Test aria 4", + "FamilyName": "Test aria 4", + "Id": "000609", + "OpeningType": "AR", + "SashPosition": 1, + "SashQty": 2, + "Shape": "Arc" + }, + { + "Description": "Arc_2S", + "FamilyName": "Arc", + "Id": "000598", + "OpeningType": "AR", + "SashPosition": 1, + "SashQty": 2, + "Shape": "FullArc" + }, + { + "Description": "Arc_1S_TurnOnly", + "FamilyName": "Arc", + "Id": "000600", + "OpeningType": "AB", + "SashPosition": 1, + "SashQty": 1, + "Shape": "FullArc" + }, + { + "Description": "Trap_S1_TurnOnly", + "FamilyName": "Trap", + "Id": "000606", + "OpeningType": "AB", + "SashPosition": 1, + "SashQty": 1, + "Shape": "Trapezoidal" + }, + { + "Description": "Trap_S2", + "FamilyName": "Trap", + "Id": "000605", + "OpeningType": "AR", + "SashPosition": 1, + "SashQty": 2, + "Shape": "Trapezoidal" + }, + { + "Description": "Trap_S2_TurnOnly", + "FamilyName": "Trap", + "Id": "000607", + "OpeningType": "AB", + "SashPosition": 1, + "SashQty": 2, + "Shape": "Trapezoidal" + }, + { + "Description": "Trap_S1", + "FamilyName": "Trap", + "Id": "000604", + "OpeningType": "AR", + "SashPosition": 1, + "SashQty": 1, + "Shape": "Trapezoidal" + }, + { + "Description": "Slide_quadruple", + "FamilyName": "Slide", + "Id": "000595", + "OpeningType": "AS", + "SashPosition": 2, + "SashQty": 4, + "Shape": "Rectangular" + }, + { + "Description": "Slide_2S", + "FamilyName": "Slide", + "Id": "000592", + "OpeningType": "AS", + "SashPosition": 1, + "SashQty": 2, + "Shape": "Rectangular" + }, + { + "Description": "Slide_4S", + "FamilyName": "Slide", + "Id": "000594", + "OpeningType": "AS", + "SashPosition": 2, + "SashQty": 4, + "Shape": "Rectangular" + }, + { + "Description": "Slide_double", + "FamilyName": "Slide", + "Id": "000593", + "OpeningType": "AS", + "SashPosition": 1, + "SashQty": 2, + "Shape": "Rectangular" + }, + { + "Description": "Profilo78_TurnOnly_Rect_QuadrupleSash", + "FamilyName": "Profilo78", + "Id": "000575", + "OpeningType": "AB", + "SashPosition": 2, + "SashQty": 4, + "Shape": "Rectangular" + }, + { + "Description": "Profilo78_Rect_Sash", + "FamilyName": "Profilo78", + "Id": "000558", + "OpeningType": "AR", + "SashPosition": 1, + "SashQty": 1, + "Shape": "Rectangular" + }, + { + "Description": "Profilo78_Rect_DoubleSash", + "FamilyName": "Profilo78", + "Id": "000559", + "OpeningType": "AR", + "SashPosition": 1, + "SashQty": 2, + "Shape": "Rectangular" + }, + { + "Description": "Profilo78_TurnOnly_Rect_TripleSash_CenterHandle", + "FamilyName": "Profilo78", + "Id": "000566", + "OpeningType": "AB", + "SashPosition": 2, + "SashQty": 3, + "Shape": "Rectangular" + }, + { + "Description": "Profilo78_TurnOnly_Rect_TripleSash_SideHandle", + "FamilyName": "Profilo78", + "Id": "000565", + "OpeningType": "AB", + "SashPosition": 1, + "SashQty": 3, + "Shape": "Rectangular" + }, + { + "Description": "Profilo78_Rect_Sash", + "FamilyName": "Profilo78", + "Id": "000562", + "OpeningType": "AB", + "SashPosition": 1, + "SashQty": 1, + "Shape": "Rectangular" + }, + { + "Description": "Profilo78_Rect_TripleSash", + "FamilyName": "Profilo78", + "Id": "000560", + "OpeningType": "AR", + "SashPosition": 1, + "SashQty": 3, + "Shape": "Rectangular" + }, + { + "Description": "Rect_DoubleSash_4", + "FamilyName": "Rect", + "Id": "000550", + "OpeningType": "AR", + "SashPosition": 1, + "SashQty": 2, + "Shape": "Rectangular" + }, + { + "Description": "Rect_DoubleSashStrana", + "FamilyName": "Rect", + "Id": "000552", + "OpeningType": "AR", + "SashPosition": 1, + "SashQty": 3, + "Shape": "Rectangular" + }, + { + "Description": "Rect_DoubleSash", + "FamilyName": "Rect", + "Id": "000549", + "OpeningType": "AR", + "SashPosition": 1, + "SashQty": 2, + "Shape": "Rectangular" + }, + { + "Description": "Round_Sash", + "FamilyName": "Round", + "Id": "000555", + "OpeningType": "BI", + "SashPosition": 1, + "SashQty": 1, + "Shape": "Circular" + }, + { + "Description": "Rect_Sash_Bilico", + "FamilyName": "Rect", + "Id": "000556", + "OpeningType": "BI", + "SashPosition": 1, + "SashQty": 1, + "Shape": "Rectangular" + }, + { + "Description": "Rect_QuadrupolSash_Bandiera", + "FamilyName": "Rect", + "Id": "000554", + "OpeningType": "AB", + "SashPosition": 2, + "SashQty": 4, + "Shape": "Rectangular" + }, + { + "Description": "Rect_Sash_Bandiera", + "FamilyName": "Rect", + "Id": "000551", + "OpeningType": "AB", + "SashPosition": 1, + "SashQty": 1, + "Shape": "Rectangular" + }, + { + "Description": "Rect_Sash", + "FamilyName": "Rect", + "Id": "000544", + "OpeningType": "AR", + "SashPosition": 1, + "SashQty": 1, + "Shape": "Rectangular" + }, + { + "Description": "Rect_TripleSash", + "FamilyName": "Rect", + "Id": "000553", + "OpeningType": "AR", + "SashPosition": 1, + "SashQty": 3, + "Shape": "Rectangular" + }, + { + "Description": "Rect_Sash_4", + "FamilyName": "Rect", + "Id": "000545", + "OpeningType": "AR", + "SashPosition": 1, + "SashQty": 1, + "Shape": "Rectangular" } ] \ No newline at end of file diff --git a/WebWindowComplex/TableComp.razor b/WebWindowComplex/TableComp.razor index 9abc3a8..22dd190 100644 --- a/WebWindowComplex/TableComp.razor +++ b/WebWindowComplex/TableComp.razor @@ -545,9 +545,16 @@
- @foreach(string glass in ListPayload.Glass) + @foreach (string glass in ListPayload.Glass) { } @@ -825,7 +832,7 @@
- @for (int i = 0; i < Sash.s_FamilyHardwareList.Count; i++) +
- @if (item.HardwareList == null || item.HardwareList.Count == 0) { @@ -553,13 +560,9 @@ { @foreach (var hlItem in item.HardwareList) { - + } } - @* @for (int i = 0; i < item.HardwareList.Count; i++) - { - - } *@
@@ -719,9 +722,10 @@ - @for (int i = 0; i < SplittedList.Count; i++) + @foreach(var currSplitted in SplittedList) + @* @for (int i = 0; i < SplittedList.Count; i++) *@ { - Splitted currSplitted = SplittedList[i]; + @* Splitted currSplitted = SplittedList[i]; *@ @if (currSplitted.AreaList[0].Equals(item)) {
@@ -730,7 +734,7 @@
@if (SplittedList.Count > 1) { -

Area split @(i + 1)

+

Area split @(SplittedList.IndexOf(currSplitted) + 1)

} else { @@ -742,12 +746,13 @@
- @for (int j = 0; j < SashList.Count; j++) + @foreach(var Index in SashList) + @* @for (int j = 0; j < SashList.Count; j++) *@ { - int Index = j; + @* int Index = j; *@
- +
} @@ -780,7 +785,7 @@
- + - - - - - - - - - -
-
-
-
-
-
-
Dimension
- @foreach (FrameDimension dimension in FrameWindow.DimensionList) +
+
+
+ @if (string.IsNullOrEmpty(LiveData.CurrJwd)) + { + @if (currStep == CompileStep.Template && ListPayload.TemplateDTO != null) + { + + + + + + + + + + @foreach (var item in ListPayload.TemplateDTO) + { + string colorClass = ""; + @if (SelTemplateDTO != null && item.Index == SelTemplateDTO.Index) + colorClass = "table-success"; + else + colorClass = ""; + + + + + + } + +
#ImageDescription
@item.Index@item.Description
+ } + } + @if (currStep == CompileStep.Tree) + { +
+ + + @for (int i = 0; i < ItemTableList.Count; i++) + { + + @for (int j = 0; j < m_maxCol; j++) + { + CompileStep cs = CompileStep.Frame; + int ind = -1; + @if (j + 1 == ItemTableList[i].Col) + { + @if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.FRAME) { -
- @dimension.sName - - mm -
+ cs = CompileStep.Frame; } - -
-
Threshold
-
- - -
-
- -
-
-
-
-
-
Joints
-
-
-
- -
-
-
-
- -
-
-
-
- -
+ else if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.SPLIT) + { + cs = CompileStep.Split; + ind = ItemTableList[i].IndexItem; + } + else if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.SASH) + { + cs = CompileStep.Sash; + ind = ItemTableList[i].IndexItem; + } + else if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.FILL) + { + cs = CompileStep.Fill; + ind = ItemTableList[i].IndexItem; + } +
+ } + else + { + + } + } + + } + +
+ + @FillTable(i, j)
+
+ + } + else if (currStep == CompileStep.Frame) + { + @if (m_CurrWindow != null) + { + m_PreviousWindow = m_CurrWindow; + } +
+
+
+
+
+
+
+
+
+

Frame

- @foreach (Joint joint in FrameWindow.JointList) - { +
- - + + + + + + + +
- } -
-
-
- @if (m_SashList.Count == 0) - { -
-
Bottom rail
-
+
+
+
+
+
Dimension
+ @foreach (FrameDimension dimension in FrameWindow.DimensionList) + { +
+ @dimension.sName + + mm +
+ } +
+
+
Threshold
- Quantity - + +
- } -
- -
-
-
- @if (!(FrameWindow.AreaList[0] is Split) || (SashList.Count == 0 && SplitList.Count == 0)) - { -
-
-
-
-

Area frame

-
- @if (SashList.Count == 0 && SplitList.Count == 0) - { - -
- -
- } -
-
- @if (!(FrameWindow.AreaList[0] is Split)) - { -
- -
- } -
-
-
-
- } -
-
-
-
-
- } - else if (currStep == CompileStep.Split) - { - @if (currSplit >= SplitList.Count || currSplit == -1) - { - currStep = CompileStep.Tree; - } - else - { - Split item = SplitList[currSplit]; -
-
-
-
-
-
-
-
-
-
@(descParentSplit(item))
-
-
-
-
-
+
+
+
-
-
Split
+
+
Joints
-
- @if ((item.nSplitQtyVert == 1 && item.nSplitQtyHoriz == 0) || (item.nSplitQtyVert == 0 && item.nSplitQtyHoriz == 1)) - { -
- -
- } -
-
+
- + +
+
+
+
+ +
+
+
+
+
-
+ @foreach (Joint joint in FrameWindow.JointList) + {
- - + + +
-
-
-
- @if (item.nSplitQtyVert > 0) - { -
-
- QtyVert - -
-
- } - @if (item.nSplitQtyHoriz > 0) - { -
-
- QtyHoriz - -
-
}
-
- @if (item.SplitVertList.Count > 0 && item.SplitHorizList.Count > 0) - { -
- @foreach (var dim in item.SplitVertList) - { -
- Width - - % -
- } -
-
- @foreach (var dim in item.SplitHorizList) - { -
- Height - - % -
- - } -
- } - else if (item.SplitHorizList.Count > 0) - { - @foreach (var dim in item.SplitHorizList) - { -
-
- Height - - % -
-
- } - } - else if (item.SplitVertList.Count > 0) - { - @foreach (var dim in item.SplitVertList) - { -
-
- Width - - % -
-
- } - } -
- @if (item.SelSplitShape == Json.WindowConst.SplitShapes.GRID) +
+
+ @if (m_SashList.Count == 0) {
-
-
-
- -
-
- -
-
+
Bottom rail
+
+
+
+ Quantity +
}
-
-
-
-
-
-
-
-
-
- } - } - else if (currStep == CompileStep.Sash) - { - @if (currSash >= SashList.Count || currSash == -1) - { - currStep = CompileStep.Tree; - } - else - { - Sash item = SashList[currSash]; -
-
-
-
-
-
-
-
-
- @if (SashList.Count > 1) - { -

Window @(currSash + 1)

- } - else - { -

Window

- } -
-
-
- -
-
-
-
-
-
- Qty sash - -
-
-
-
-
-
- - -
-
-
-
- Qty bottom rail - -
-
-
-
-
-
-
-
-
Joints
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
- @foreach (Joint joint in item.JointList) - { -
-
- - -
-
- }
-
-
-
-
Hardware
-
-
-
-
-
- - -
-
- - -
-
-
-
-
-
-
-
-
-
- @for (int i = 0; i <= item.SashList.Count / 2; i++) - { - for (int j = 0; j < 2 && (i * 2 + j <= item.SashList.Count - 1); j++) - { - SashDimension sash = item.SashList[i * 2 + j]; - Area anta; - @if (item.AreaList[i * 2 + j] is Splitted) - { - anta = item.AreaList[i * 2 + j]; - } - else - { - anta = item; - } -
- @if (item.SashList.Count == 1) - { -
Sash
- } - else - { -
Sash @(i * 2 + j + 1)
- } -
- - -
-
- Dimension - - % -
-
-
- -
-
- -
-
- @if (!(anta.AreaList[0] is Split)) - { -
-
-
- -
-
-
-
- -
-
-
- } -
- @for (int k = 0; k <= item.SashList.Count - 1; k++) - { - @if (k != i * 2 + j) - { - int IndexCopy = k; - int IndexModify = i * 2 + j; -
-
- -
-
- } - } -
-
- - } - } -
-
-
-
-
-
-
-
- } - } - else if (currStep == CompileStep.Fill) - { - @if (currFill >= FillList.Count || currFill == -1) - { - currStep = CompileStep.Tree; - } - else - { - Fill item = FillList[currFill]; -
-
-
-
-
-
-
-
-
-

Fill @(currFill + 1)

-
-
-
- -
-
-
-
- -
-
-
-
-
-
-
Selected all fill
-
-
-
- -
-
-
-
- -
-
-
-
-
- @foreach(var currSplitted in SplittedList) - @* @for (int i = 0; i < SplittedList.Count; i++) *@ - { - @* Splitted currSplitted = SplittedList[i]; *@ - @if (currSplitted.AreaList[0].Equals(item)) + @if (!(FrameWindow.AreaList[0] is Split) || (SashList.Count == 0 && SplitList.Count == 0)) {
-
- @if (SplittedList.Count > 1) - { -

Area split @(SplittedList.IndexOf(currSplitted) + 1)

- } - else - { -

Area split

- } -
-
- -
+

Area frame

- @foreach(var Index in SashList) - @* @for (int j = 0; j < SashList.Count; j++) *@ - { - @* int Index = j; *@ -
+
+ @if (SashList.Count == 0 && SplitList.Count == 0) + { +
- +
-
- } + } +
+
+ @if (!(FrameWindow.AreaList[0] is Split)) + { +
+ +
+ } +
} - } +
-
- } - } - else if (currStep == CompileStep.General) - { -
-
-
-
-
-
-
-
-
-
General
+ } + else if (currStep == CompileStep.Split) + { + @if (currSplit >= SplitList.Count || currSplit == -1) + { + currStep = CompileStep.Tree; + } + else + { + Split item = SplitList[currSplit]; +
+
+
+
+
+
+
+
+
+
@(descParentSplit(item))
+
+
+
+
+
+
+
+
Split
+
+
+ @if ((item.nSplitQtyVert == 1 && item.nSplitQtyHoriz == 0) || (item.nSplitQtyVert == 0 && item.nSplitQtyHoriz == 1)) + { +
+ +
+ } +
+
+
+ +
+
+
+
+
+
+ + +
+
+
+
+ @if (item.nSplitQtyVert > 0) + { +
+
+ QtyVert + +
+
+ } + @if (item.nSplitQtyHoriz > 0) + { +
+
+ QtyHoriz + +
+
+ } +
+
+ @if (item.SplitVertList.Count > 0 && item.SplitHorizList.Count > 0) + { +
+ @foreach (var dim in item.SplitVertList) + { +
+ Width + + % +
+ } +
+
+ @foreach (var dim in item.SplitHorizList) + { +
+ Height + + % +
+ + } +
+ } + else if (item.SplitHorizList.Count > 0) + { + @foreach (var dim in item.SplitHorizList) + { +
+
+ Height + + % +
+
+ } + } + else if (item.SplitVertList.Count > 0) + { + @foreach (var dim in item.SplitVertList) + { +
+
+ Width + + % +
+
+ } + } +
+ @if (item.SelSplitShape == Json.WindowConst.SplitShapes.GRID) + { +
+
+
+
+ +
+
+ +
+
+
+
+ } +
+
+
+
-
-
-
- - +
+
+
+
+
+
+ + +
+
+
+
+ Qty bottom rail + +
+
+
+
+
+
+
+
+
Joints
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+ @foreach (Joint joint in item.JointList) + { +
+
+ + +
+
+ } + +
+
+
+
+
Hardware
+
+
+
+
+
+ + +
+
+ + +
+
+
+
+
+
+
+
+
+
+
+
+ @for (int i = 0; i <= item.SashList.Count / 2; i++) { - + for (int j = 0; j < 2 && (i * 2 + j <= item.SashList.Count - 1); j++) + { + SashDimension sash = item.SashList[i * 2 + j]; + Area anta; + @if (item.AreaList[i * 2 + j] is Splitted) + { + anta = item.AreaList[i * 2 + j]; + } + else + { + anta = item; + } +
+ @if (item.SashList.Count == 1) + { +
Sash
+ } + else + { +
Sash @(i * 2 + j + 1)
+ } +
+ + +
+
+ Dimension + + % +
+
+
+ +
+
+ +
+
+ @if (!(anta.AreaList[0] is Split)) + { +
+
+
+ +
+
+
+
+ +
+
+
+ } +
+ @for (int k = 0; k <= item.SashList.Count - 1; k++) + { + @if (k != i * 2 + j) + { + int IndexCopy = k; + int IndexModify = i * 2 + j; +
+
+ +
+
+ } + } +
+
+ + } } - -
-
- - +
-
-
-
-
-
Fill type
-
-
-
- - +
+
+
+
+ } + } + else if (currStep == CompileStep.Fill) + { + @if (currFill >= FillList.Count || currFill == -1) + { + currStep = CompileStep.Tree; + } + else + { + Fill item = FillList[currFill]; +
+
+
+
+
+
+
+
+
+

Fill @(currFill + 1)

+
+
+
+ +
+
+
+
+ +
+
-
- - +
+
+
+
Selected all fill
+
+
+
+ +
+
+
+
+ +
+
-
-
-
Color
+ @foreach (var currSplitted in SplittedList) + @* @for (int i = 0; i < SplittedList.Count; i++) *@ + { + @* Splitted currSplitted = SplittedList[i]; *@ + @if (currSplitted.AreaList[0].Equals(item)) + { +
+
+
+
+ @if (SplittedList.Count > 1) + { +

Area split @(SplittedList.IndexOf(currSplitted) + 1)

+ } + else + { +

Area split

+ } +
+
+
+ +
+
+ @foreach (var Index in SashList) + @* @for (int j = 0; j < SashList.Count; j++) *@ + { + @* int Index = j; *@ +
+
+ +
+
+ } +
+
+
+ } + } +
+
+
+
+
+ } + } + else if (currStep == CompileStep.General) + { +
+
+
+
+
+
+
+
+
+
General
+
-
- - +
+
+ + +
+
+ + +
-
- - +
+
+
+
+
+
Fill type
+
+
+
+ + +
+
+ + +
+
+
+
+
+
Color
+
+
+
+ + +
+
+ + +
+
@@ -859,18 +885,18 @@
-
+ }
- } +
-
-
- @if (currStep != CompileStep.Template) - { -
- @outSvg -
+ @if (currStep != CompileStep.Template) + { +
+ @outSvg +
+ } + } }
diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index 5e372b3..0845818 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -49,6 +49,12 @@ namespace WebWindowComplex [Parameter] public EventCallback> EC_OnUpdate { get; set; } + /// + /// Sollevo evento errore validazione con una lista di errori rilevati + /// + [Parameter] + public EventCallback> EC_ValidError { get; set; } + /// /// Elenco anagrafiche di base /// @@ -85,122 +91,6 @@ namespace WebWindowComplex #endregion Protected Fields -#if false - [Parameter] - public string CurrJwd - { - get => m_CurrJwd; - set - { - // Se viene passato un JWD - if (m_CurrJwd != value && value != "") - { - m_CurrJwd = value; - // Aggiornati parametri di ingresso selezionati - UpdateSelParameter(); - JsonWindow WindowFromJson = JsonConvert.DeserializeObject(m_CurrJwd, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", ""); - if (m_CurrWindow != null) - { - m_CurrWindow.OnPreview -= M_CurrWindow_OnPreview; - m_CurrWindow = null; - } - m_CurrWindow = WindowFromJson.Deserialize(); - m_CurrWindow.OnPreview += M_CurrWindow_OnPreview; - // Recupero dimensioni Frame e Joint del frame della finestra precedente - if (m_PreviousWindow != null) - { - for (int i = 0; i < 2; i++) - m_CurrWindow.AreaList[0].DimensionList[i] = m_PreviousWindow.AreaList[0].DimensionList[i]; - for (int i = 0; i < 4; i++) - m_CurrWindow.AreaList[0].JointList[i] = m_PreviousWindow.AreaList[0].JointList[i]; - } - } - if (m_CurrWindow != null) - { - // Aggiornate liste di sash, split, splitted, fill e itemTable - UpdateLists(); - } - } - } - [Parameter] - public string LiveSVG - { - get => m_SelSVG; - set => m_SelSVG = value; - } -#endif - -#if false - [Parameter] - public Template IN_SelTemplate - { - get => m_SelTemplate; - set - { - // Se viene passato il template selezionato oppure se non è ancora stato selezionato un template oppure se si cambia template di selezione - if (value != null && (m_SelTemplate == null || (m_SelTemplate != null && value.nIndex != m_SelTemplate.nIndex)) && !string.IsNullOrEmpty(value.JWD)) - { - m_SelTemplate = value; - // Aggiornamento parametri di ingresso selezionati - UpdateSelParameter(); - JsonWindow WindowFromJson = JsonConvert.DeserializeObject(m_SelTemplate.JWD, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", ""); - if (m_CurrWindow != null) - { - m_CurrWindow.OnPreview -= M_CurrWindow_OnPreview; - m_CurrWindow = null; - } - m_CurrWindow = WindowFromJson.Deserialize(); - m_CurrWindow.OnPreview += M_CurrWindow_OnPreview; - // Recupero dimensioni Frame e Joint del frame della finestra precedente - if (m_PreviousWindow != null) - { - for (int i = 0; i < 2; i++) - m_CurrWindow.AreaList[0].DimensionList[i] = m_PreviousWindow.AreaList[0].DimensionList[i]; - for (int i = 0; i < 4; i++) - m_CurrWindow.AreaList[0].JointList[i] = m_PreviousWindow.AreaList[0].JointList[i]; - } - } - if (m_CurrWindow != null) - { - // Aggiornamento liste sash, split, splitted, fill e itemTable - UpdateLists(); - } - } - } - - [Parameter] - public List IN_TemplateDTOList { get; set; } = null!; - - [Parameter] - public List IN_FamilyHardwareList { get; set; } = null!; - - [Parameter] - public List IN_HardwareList { get; set; } = null!; - - [Parameter] - public List IN_ColorMaterialList { get; set; } = null!; - - [Parameter] - public List IN_MaterialList { get; set; } = null!; - - [Parameter] - public List IN_GlassList { get; set; } = null!; -#endif - -#if false - [Parameter] - public string IN_SelFamilyHardware { get; set; } = null!; - - [Parameter] - public string? IN_SelColorMaterial { get; set; } = null; - - [Parameter] - public string? IN_SelMaterial { get; set; } = null; - - [Parameter] - public string? IN_SelGlass { get; set; } = null; -#endif - #region Protected Enums protected enum CompileStep @@ -669,66 +559,114 @@ namespace WebWindowComplex editLock = false; // reset variabile errori bError = false; + validErrors = new List(); } + protected override void OnAfterRender(bool firstRender) + { + isLoading = false; + } + + /// + /// Booleana fase loading + /// + private bool isLoading = false; + /// /// Gestione update post ricezione parametri da controllo chiamante /// protected override async Task OnParametersSetAsync() { - bool updateSvg = false; - // controllo elenchi BasePayload siano validi... - if (ListPayload.IsValid()) + isLoading = true; + // SOLO SE sono presenti... + if (ListPayload.IsPopulated() && LiveData.IsValid()) { - // controllo sia popolato anche per la componente LIVE - if (LiveData.IsValid()) + bool updateSvg = false; + validErrors = new List(); + // controllo elenchi BasePayload siano validi... + if (ListPayload.IsValid()) { - // SOLO SE modificato live data... - if (prevLiveData == null || !prevLiveData.Equals(LiveData)) + // controllo sia popolato anche per la componente LIVE + if (LiveData.IsValid()) { - prevLiveData = new LivePayload() + // SOLO SE modificato live data... + if (prevLiveData == null || !prevLiveData.Equals(LiveData)) { - CurrJwd = LiveData.CurrJwd, - SvgPreview = LiveData.SvgPreview - }; - m_SelSVG = LiveData.SvgPreview; - // Aggiornati parametri di ingresso selezionati - UpdateSelParameter(); - JsonWindow WindowFromJson = JsonConvert.DeserializeObject(LiveData.CurrJwd, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", ""); - setCurrWindow(WindowFromJson); - //SOLO SE non sono in edit... - if (!editLock) + prevLiveData = new LivePayload() + { + CurrJwd = LiveData.CurrJwd, + SvgPreview = LiveData.SvgPreview + }; + m_SelSVG = LiveData.SvgPreview; + // Aggiornati parametri di ingresso selezionati + UpdateSelParameter(); + JsonWindow WindowFromJson = JsonConvert.DeserializeObject(LiveData.CurrJwd, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", ""); + setCurrWindow(WindowFromJson); + //SOLO SE non sono in edit... + if (!editLock) + { + currStep = CompileStep.Tree; + } + updateSvg = true; + } + } + else if (CurrSelection != null && CurrSelection.Template != null) + { + // Se viene passato il template selezionato oppure se non è ancora stato selezionato un template oppure se si cambia template di selezione + if (m_SelTemplate == null || (m_SelTemplate != null && CurrSelection.Template.nIndex != m_SelTemplate.nIndex) && !string.IsNullOrEmpty(CurrSelection.Template.JWD)) { - currStep = CompileStep.Tree; + m_SelTemplate = CurrSelection.Template; + // Aggiornamento parametri di ingresso selezionati + UpdateSelParameter(); + JsonWindow WindowFromJson = JsonConvert.DeserializeObject(m_SelTemplate.JWD, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", ""); + setCurrWindow(WindowFromJson); + currStep = CompileStep.Template; } updateSvg = true; } - } - else if (CurrSelection != null && CurrSelection.Template != null) - { - // Se viene passato il template selezionato oppure se non è ancora stato selezionato un template oppure se si cambia template di selezione - if (m_SelTemplate == null || (m_SelTemplate != null && CurrSelection.Template.nIndex != m_SelTemplate.nIndex) && !string.IsNullOrEmpty(CurrSelection.Template.JWD)) + if (SashList.Count > 0) { - m_SelTemplate = CurrSelection.Template; - // Aggiornamento parametri di ingresso selezionati - UpdateSelParameter(); - JsonWindow WindowFromJson = JsonConvert.DeserializeObject(m_SelTemplate.JWD, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", ""); - setCurrWindow(WindowFromJson); - currStep = CompileStep.Template; + currAnta = 0; + } + if (updateSvg) + { + await DoPreviewSvg(); } - updateSvg = true; } - if (SashList.Count > 0) + else { - currAnta = 0; - } - if (updateSvg) - { - await DoPreviewSvg(); + // verifico 1:1 le liste e indico cosa manca + if (ListPayload.Hardware == null || ListPayload.Hardware.Count == 0) + { + validErrors.Add("Missing Hardware List!"); + } + else + { + if (ListPayload.FamilyHardware == null || ListPayload.FamilyHardware.Count == 0) + { + validErrors.Add("Missing Famly HW List!"); + } + } + if (ListPayload.Glass == null || ListPayload.Glass.Count == 0) + { + validErrors.Add("Missing Glass List!"); + } + if (ListPayload.Material == null || ListPayload.Material.Count == 0) + { + validErrors.Add("Missing Material List!"); + } + if (ListPayload.ColorMaterial == null || ListPayload.ColorMaterial.Count == 0) + { + validErrors.Add("Missing ColorMaterial List!"); + } } + isLoading = false; } } - + /// + /// Elenco errori preliminari di validazione + /// + private List validErrors = new List(); protected void setCurrWindow(JsonWindow WindowFromJson) { if (m_CurrWindow != null) diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 13688c3..d6131cb 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.918 + 2.7.10.1009 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -123,6 +123,28 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 7c2a0b7..be92b44 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.918 + 2.7.10.1009 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -159,6 +159,28 @@ + + + + + + + + + + + + + + + + + + + + + + From e3042e7d9e8cce049e987d4c2c0f5c78ba79762d Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 10 Oct 2025 10:47:30 +0200 Subject: [PATCH 08/10] COmpletata prima review blocco gestione errori/warnings --- Test.UI/Data/AntaDoppia.jwd | 2 +- WebWindowComplex/TableComp.razor | 39 +++- WebWindowComplex/TableComp.razor.cs | 188 +++++++++++++----- WebWindowComplex/WebWindowComplex.csproj | 14 +- .../WebWindowConfigurator.csproj | 15 +- 5 files changed, 197 insertions(+), 61 deletions(-) diff --git a/Test.UI/Data/AntaDoppia.jwd b/Test.UI/Data/AntaDoppia.jwd index 21d2d91..141654e 100644 --- a/Test.UI/Data/AntaDoppia.jwd +++ b/Test.UI/Data/AntaDoppia.jwd @@ -1,7 +1,7 @@ { "ProfilePath": "Profilo78", "Material": "Pino", - "ColorMaterial": "Black", + "ColorMaterial": "Nero", "Glass": "Vetro BE 2S 4T/16/4T", "AreaList": [ { diff --git a/WebWindowComplex/TableComp.razor b/WebWindowComplex/TableComp.razor index 4015483..8b262f7 100644 --- a/WebWindowComplex/TableComp.razor +++ b/WebWindowComplex/TableComp.razor @@ -5,17 +5,31 @@ } else { - - @if (validErrors != null && validErrors.Count > 0) + if (listErrPre != null && listErrPre.Count > 0) {
Errori validazione!
    - @foreach (var item in validErrors) + @foreach (var item in listErrPre) { -
  • @item
  • +
  • @item.Value
  • + } +
+
+
+ } + else if (listErrLink != null && listErrLink.Count > 0) + { +
+
Errore configurazione:
+
+ +
    + @foreach (var item in listErrLink) + { +
  • @item.Value
  • }
@@ -860,7 +874,7 @@
- @foreach (string colorMaterial in ListPayload.ColorMaterial) { @@ -896,6 +910,21 @@ @outSvg
} + if (listWarnings != null && listWarnings.Count > 0) + { +
+
Mancata corrispondenza valori:
+
+ +
    + @foreach (var item in listWarnings) + { +
  • @item.Value
  • + } +
+
+
+ } } }
diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index 0845818..40d9aa1 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -53,7 +53,7 @@ namespace WebWindowComplex /// Sollevo evento errore validazione con una lista di errori rilevati /// [Parameter] - public EventCallback> EC_ValidError { get; set; } + public EventCallback> EC_ValidError { get; set; } /// /// Elenco anagrafiche di base @@ -550,6 +550,11 @@ namespace WebWindowComplex await EC_OnSelectedTemplate.InvokeAsync(newSel); } + protected override void OnAfterRender(bool firstRender) + { + isLoading = false; + } + /// /// Primo init componente /// @@ -559,19 +564,11 @@ namespace WebWindowComplex editLock = false; // reset variabile errori bError = false; - validErrors = new List(); + listErrPre = new Dictionary(); + listErrLink = new Dictionary(); + listWarnings = new Dictionary(); } - protected override void OnAfterRender(bool firstRender) - { - isLoading = false; - } - - /// - /// Booleana fase loading - /// - private bool isLoading = false; - /// /// Gestione update post ricezione parametri da controllo chiamante /// @@ -582,7 +579,9 @@ namespace WebWindowComplex if (ListPayload.IsPopulated() && LiveData.IsValid()) { bool updateSvg = false; - validErrors = new List(); + listErrPre = new Dictionary(); + listErrLink = new Dictionary(); + listWarnings = new Dictionary(); // controllo elenchi BasePayload siano validi... if (ListPayload.IsValid()) { @@ -600,15 +599,27 @@ namespace WebWindowComplex m_SelSVG = LiveData.SvgPreview; // Aggiornati parametri di ingresso selezionati UpdateSelParameter(); - JsonWindow WindowFromJson = JsonConvert.DeserializeObject(LiveData.CurrJwd, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", ""); - setCurrWindow(WindowFromJson); - //SOLO SE non sono in edit... - if (!editLock) + JsonWindow WindowFromJson = new JsonWindow("", "", "", ""); + // provo a deserializzare + try { - currStep = CompileStep.Tree; + WindowFromJson = JsonConvert.DeserializeObject(LiveData.CurrJwd, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", ""); + setCurrWindow(WindowFromJson); + //SOLO SE non sono in edit... + if (!editLock) + { + currStep = CompileStep.Tree; + } } + // altrimenti errore! + catch (Exception ex) + { + listErrLink.Add("Window", $"Deserializing Error:{Environment.NewLine}{ex}"); + } + updateSvg = true; } + checkWarnings(); } else if (CurrSelection != null && CurrSelection.Template != null) { @@ -618,9 +629,19 @@ namespace WebWindowComplex m_SelTemplate = CurrSelection.Template; // Aggiornamento parametri di ingresso selezionati UpdateSelParameter(); - JsonWindow WindowFromJson = JsonConvert.DeserializeObject(m_SelTemplate.JWD, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", ""); - setCurrWindow(WindowFromJson); - currStep = CompileStep.Template; + JsonWindow WindowFromJson = new JsonWindow("", "", "", ""); + // provo a deserializzare + try + { + WindowFromJson = JsonConvert.DeserializeObject(m_SelTemplate.JWD, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", ""); + setCurrWindow(WindowFromJson); + currStep = CompileStep.Template; + } + // altrimenti errore! + catch (Exception ex) + { + listErrLink.Add("Window", $"Deserializing Error:{Environment.NewLine}{ex}"); + } } updateSvg = true; } @@ -635,38 +656,72 @@ namespace WebWindowComplex } else { - // verifico 1:1 le liste e indico cosa manca - if (ListPayload.Hardware == null || ListPayload.Hardware.Count == 0) - { - validErrors.Add("Missing Hardware List!"); - } - else - { - if (ListPayload.FamilyHardware == null || ListPayload.FamilyHardware.Count == 0) - { - validErrors.Add("Missing Famly HW List!"); - } - } - if (ListPayload.Glass == null || ListPayload.Glass.Count == 0) - { - validErrors.Add("Missing Glass List!"); - } - if (ListPayload.Material == null || ListPayload.Material.Count == 0) - { - validErrors.Add("Missing Material List!"); - } - if (ListPayload.ColorMaterial == null || ListPayload.ColorMaterial.Count == 0) - { - validErrors.Add("Missing ColorMaterial List!"); - } + checkErrorPre(); } isLoading = false; } } + /// - /// Elenco errori preliminari di validazione + /// Verifica errori prelimionari per mostrare dove sia il problema /// - private List validErrors = new List(); + private void checkErrorPre() + { + // verifico 1:1 le liste e indico cosa manca + if (ListPayload.Hardware == null || ListPayload.Hardware.Count == 0) + { + listErrPre.Add("Hardware", "Missing Hardware List!"); + } + else + { + if (ListPayload.FamilyHardware == null || ListPayload.FamilyHardware.Count == 0) + { + listErrPre.Add("FamilyHardware", "Missing Famly HW List!"); + } + } + if (ListPayload.Glass == null || ListPayload.Glass.Count == 0) + { + listErrPre.Add("Glass", "Missing Glass List!"); + } + if (ListPayload.Material == null || ListPayload.Material.Count == 0) + { + listErrPre.Add("Material", "Missing Material List!"); + } + if (ListPayload.ColorMaterial == null || ListPayload.ColorMaterial.Count == 0) + { + listErrPre.Add("ColorMaterial", "Missing ColorMaterial List!"); + } + } + + /// + /// Verifica warning minori (es coerenza colori...) + /// + private void checkWarnings() + { + // verifico 1:1 le liste e i valori siano coerenti... + if (ListPayload.ColorMaterial != null && ListPayload.ColorMaterial.Count > 0) + { + // verifico colore attuale sia consistente... + if (m_CurrWindow != null) + { + if (!ListPayload.ColorMaterial.Contains(m_CurrWindow.sColorMaterial)) + { + listWarnings.Add("ColorMaterial", $"Missing Color: {m_CurrWindow.sColorMaterial}"); + } + } + } + } + + /// + /// Calcola CSS warning + /// + /// + /// + protected string cssValid(string fKey) + { + return listWarnings.ContainsKey(fKey) ? "border border-danger" : ""; + } + protected void setCurrWindow(JsonWindow WindowFromJson) { if (m_CurrWindow != null) @@ -729,12 +784,40 @@ namespace WebWindowComplex #region Private Fields + private bool bError = false; + private int currAnta = 0; + private int currFill = -1; + private int currSash = -1; + private int currSplit = -1; + private CompileStep currStep; + private bool editLock = false; + + /// + /// Booleana fase loading + /// + private bool isLoading = false; + + /// + /// ELenco errori di coerenza/link dati (vanno risolti per disegnare/procedere) + /// + private Dictionary listErrLink = new Dictionary(); + + /// + /// Elenco errori preliminari (mancano elementi di base di validazione modello dati)) + /// + private Dictionary listErrPre = new Dictionary(); + + /// + /// Elenco warnings non bloccanti + /// + private Dictionary listWarnings = new Dictionary(); + private List m_FillList = new List(); private Frame? m_Frame; @@ -772,6 +855,11 @@ namespace WebWindowComplex #region Private Methods + private void AddSashToFrame(Frame f) + { + bError = f.AddSash(); + } + /// /// Metodo per andare allo step successivo /// @@ -1060,12 +1148,6 @@ namespace WebWindowComplex currStep = CompileStep.Tree; } - private bool bError = false; - private void AddSashToFrame(Frame f) - { - bError = f.AddSash(); - } - /// /// Metodo per scambiare due aree di uno split /// diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index d6131cb..b323ddc 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1009 + 2.7.10.1010 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -152,6 +152,18 @@ + + + + + + + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index be92b44..33c9542 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1009 + 2.7.10.1010 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -187,6 +187,19 @@ + + + + + + + + + + + + + From bd8aa4b025b386ba5b946bde7ea808f510f60fd5 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 10 Oct 2025 11:48:36 +0200 Subject: [PATCH 09/10] Modifica fix rimozione/riaggiunta finestra Estratto componente AreaFrame --- WebWindowComplex/AreaFrame.razor | 26 ++++++ WebWindowComplex/AreaFrame.razor.cs | 48 +++++++++++ WebWindowComplex/TableComp.razor | 8 +- WebWindowComplex/TableComp.razor.cs | 2 +- WebWindowComplex/WebWindowComplex.csproj | 8 +- WebWindowComplex/Window.cs | 80 ++++++++++++------- .../WebWindowConfigurator.csproj | 9 ++- 7 files changed, 145 insertions(+), 36 deletions(-) create mode 100644 WebWindowComplex/AreaFrame.razor create mode 100644 WebWindowComplex/AreaFrame.razor.cs diff --git a/WebWindowComplex/AreaFrame.razor b/WebWindowComplex/AreaFrame.razor new file mode 100644 index 0000000..6920bad --- /dev/null +++ b/WebWindowComplex/AreaFrame.razor @@ -0,0 +1,26 @@ +
+
+
+
+

Area frame

+
+
+ @if (CurrSashList.Count == 0 && CurrSplitList.Count == 0) + { + +
+ +
+ } +
+
+ @if (!(CurrFrameWindow.AreaList[0] is Split)) + { +
+ +
+ } +
+
+
+
\ No newline at end of file diff --git a/WebWindowComplex/AreaFrame.razor.cs b/WebWindowComplex/AreaFrame.razor.cs new file mode 100644 index 0000000..e48429e --- /dev/null +++ b/WebWindowComplex/AreaFrame.razor.cs @@ -0,0 +1,48 @@ +using Microsoft.AspNetCore.Components; + +namespace WebWindowComplex +{ + public partial class AreaFrame + { + #region Public Properties + + [Parameter] + public Frame CurrFrameWindow { get; set; } = null!; + + [Parameter] + public List CurrSashList { get; set; } = null!; + + [Parameter] + public List CurrSplitList { get; set; } = null!; + + [Parameter] + public EventCallback EC_AddSash { get; set; } + + [Parameter] + public EventCallback EC_AddWindow { get; set; } + + #endregion Public Properties + + #region Private Methods + + /// + /// Sollevo evento richiesta aggiunta sash + /// + /// + private async Task RaiseAddSash() + { + await EC_AddSash.InvokeAsync(true); + } + + /// + /// Sollevo evento richiesta aggiunta window + /// + /// + private async Task RaiseAddWindow() + { + await EC_AddWindow.InvokeAsync(true); + } + + #endregion Private Methods + } +} \ No newline at end of file diff --git a/WebWindowComplex/TableComp.razor b/WebWindowComplex/TableComp.razor index 8b262f7..12f75c3 100644 --- a/WebWindowComplex/TableComp.razor +++ b/WebWindowComplex/TableComp.razor @@ -280,7 +280,7 @@
@if (!(FrameWindow.AreaList[0] is Split) || (SashList.Count == 0 && SplitList.Count == 0)) { -
+ @*
@@ -305,7 +305,9 @@
-
+
*@ + + }
@@ -781,7 +783,7 @@
- +
@foreach (var Index in SashList) diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index 40d9aa1..caa3695 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -857,7 +857,7 @@ namespace WebWindowComplex private void AddSashToFrame(Frame f) { - bError = f.AddSash(); + bError = f.AddFirstSash(); } /// diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index b323ddc..31f6316 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1010 + 2.7.10.1011 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -170,6 +170,12 @@ + + + + + + diff --git a/WebWindowComplex/Window.cs b/WebWindowComplex/Window.cs index 614ff83..2ddbd63 100644 --- a/WebWindowComplex/Window.cs +++ b/WebWindowComplex/Window.cs @@ -265,52 +265,72 @@ namespace WebWindowComplex ParentWindow.OnUpdatePreview(ParentWindow.sSerialized()); } - public bool AddSash() + public bool AddFirstSash() { + bool answ = false; // Salvo il parent Area ParentArea = AreaList[0].ParentArea; // Creo area sash di default Sash SashArea = Sash.CreateSash(ParentArea); - SashArea.SelFamilyHardware = Sash.s_FamilyHardwareList.First(); - SashArea.RefreshHardwareList(); - if (SashArea.HardwareList.Count == 0) + // ricerco tra ttuti gli hw disponibili... + string sShape = FindSashShape(); + var listHwValid = Sash + .m_HardwareCompleteList + .Where(x => x.Shape == sShape && x.SashQty == 1) + .FirstOrDefault(); + if (listHwValid != null) { - SashArea.Remove(); - return true; - } - else - { - SashArea.SetSelHardwareFromId(SashArea.HardwareList.First().Id); - // Salvo gli oggetti già presenti e li cancello da AreaList - List ContentArea = new List(); - ContentArea.Add(AreaList[0]); - AreaList.Remove(AreaList[0]); - // Aggiungo area - AreaList.Add(SashArea); - if (SashArea.nSashQty == 1) + // seleziono la famiglia del primo hw trovato... + SashArea.SelFamilyHardware = listHwValid.FamilyName; + SashArea.RefreshHardwareList(); + if (SashArea.HardwareList.Count == 0) { - // Inserisco il riempimento precedente - AreaList[0].AreaList.Add(ContentArea[0]); - AreaList[0].AreaList[0].SetParentArea(AreaList[0]); + SashArea.Remove(); + answ = true; } else { - // All'area Sash aggiunto uno Splitted per ogni anta - for (int i = 1; i < SashArea.nSashQty; i++) + SashArea.SetSelHardwareFromId(SashArea.HardwareList.First().Id); + // Salvo gli oggetti già presenti e li cancello da AreaList + List ContentArea = new List(); + ContentArea.Add(AreaList[0]); + AreaList.Remove(AreaList[0]); + // Aggiungo area + AreaList.Add(SashArea); + if (SashArea.nSashQty == 1) { - AreaList[0].AreaList.Add(Splitted.CreateSplitted(SashArea)); + // Inserisco il riempimento precedente + AreaList[0].AreaList.Add(ContentArea[0]); + AreaList[0].AreaList[0].SetParentArea(AreaList[0]); } - Fill fill2 = (Fill)ContentArea[0]; - for (int i = 1; i < SashArea.nSashQty; i++) + else { - AreaList[0].AreaList[1].AreaList.Add(Fill.CreateFill(AreaList[0].AreaList[1], fill2.FillType)); + // All'area Sash aggiunto uno Splitted per ogni anta + for (int i = 1; i < SashArea.nSashQty; i++) + { + AreaList[0].AreaList.Add(Splitted.CreateSplitted(SashArea)); + } + Fill fill2 = (Fill)ContentArea[0]; + for (int i = 1; i < SashArea.nSashQty; i++) + { + AreaList[0].AreaList[1].AreaList.Add(Fill.CreateFill(AreaList[0].AreaList[1], fill2.FillType)); + } } + ParentWindow.OnUpdatePreview(ParentWindow.sSerialized()); } - ParentWindow.OnUpdatePreview(ParentWindow.sSerialized()); - return false; } + return answ; } + + /// + /// MockUp chiamata a c++ x scelta forma sash per Hw + /// + /// + private string FindSashShape() + { + return "Rectangular"; + } public void SwapAree() { Area tempArea; @@ -1062,12 +1082,12 @@ namespace WebWindowComplex } } - internal string SetSelFamilyHardwareFromIndex(string idHardware) + internal string SetSelFamilyHardwareFromIndex(string codHardware) { if (string.IsNullOrEmpty(m_SelFamilyHardware)) { SelFamilyHardware = (m_HardwareCompleteList - .Where(x => x.Id == idHardware) + .Where(x => x.Id == codHardware) .First()).FamilyName; } return SelFamilyHardware; diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 33c9542..385b423 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1010 + 2.7.10.1011 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -206,6 +206,13 @@ + + + + + + + From 55a84780a8185ec15a2dfd098c61ef9f4dd2b240 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 10 Oct 2025 12:18:07 +0200 Subject: [PATCH 10/10] Spostato blocco general in compoente indipendente --- WebWindowComplex/General.razor | 92 ++++++++++++++ WebWindowComplex/General.razor.cs | 102 +++++++++++++++ WebWindowComplex/TableComp.razor | 118 +----------------- WebWindowComplex/TableComp.razor.cs | 21 ++++ WebWindowComplex/WebWindowComplex.csproj | 5 +- .../WebWindowConfigurator.csproj | 6 +- 6 files changed, 225 insertions(+), 119 deletions(-) create mode 100644 WebWindowComplex/General.razor create mode 100644 WebWindowComplex/General.razor.cs diff --git a/WebWindowComplex/General.razor b/WebWindowComplex/General.razor new file mode 100644 index 0000000..b8264d3 --- /dev/null +++ b/WebWindowComplex/General.razor @@ -0,0 +1,92 @@ + +
+
+
+
+
+
+
+
+
+
General
+
+
+
+
+
+ + +
+
+ + +
+
+
+
+
+
+
+
Fill type
+
+
+
+ + +
+
+ + +
+
+
+
+
+
Color
+
+
+
+ + +
+
+ + +
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/WebWindowComplex/General.razor.cs b/WebWindowComplex/General.razor.cs new file mode 100644 index 0000000..4eb2303 --- /dev/null +++ b/WebWindowComplex/General.razor.cs @@ -0,0 +1,102 @@ +using Microsoft.AspNetCore.Components; +using WebWindowComplex.DTO; + +namespace WebWindowComplex +{ + public partial class General + { + #region Public Properties + + /// + /// Finestra corrente + /// + [Parameter] + public Window CurrWindow { get; set; } = null!; + + [Parameter] + public EventCallback EC_SelColor { get; set; } + + [Parameter] + public EventCallback EC_SelGlass { get; set; } + + [Parameter] + public EventCallback EC_SelWindMat { get; set; } + + /// + /// Elenco anagrafiche di base + /// + [Parameter] + public BaseListPayload ListPayload { get; set; } = null!; + + /// + /// Elenco Warnings attivi + /// + [Parameter] + public Dictionary ListWarnings { get; set; } = new Dictionary(); + + #endregion Public Properties + + #region Protected Properties + + protected string CurrColor + { + get => currColor; + set + { + currColor = value; + _ = EC_SelColor.InvokeAsync(value); + } + } + + protected string CurrGlass + { + get => currGlass; + set + { + currGlass = value; + _ = EC_SelGlass.InvokeAsync(value); + } + } + + protected string CurrMaterial + { + get => currMaterial; + set + { + currMaterial = value; + _ = EC_SelWindMat.InvokeAsync(value); + } + } + + #endregion Protected Properties + + #region Protected Methods + + /// + /// Calcola CSS warning + /// + /// + /// + protected string cssValid(string fKey) + { + return ListWarnings.ContainsKey(fKey) ? "border border-danger" : ""; + } + + protected override void OnParametersSet() + { + currColor = CurrWindow.sColorMaterial; + currGlass = CurrWindow.sGlass; + currMaterial = CurrWindow.sMaterial; + } + + #endregion Protected Methods + + #region Private Fields + + private string currColor = ""; + private string currGlass = ""; + private string currMaterial = ""; + + #endregion Private Fields + } +} \ No newline at end of file diff --git a/WebWindowComplex/TableComp.razor b/WebWindowComplex/TableComp.razor index 12f75c3..021ecc7 100644 --- a/WebWindowComplex/TableComp.razor +++ b/WebWindowComplex/TableComp.razor @@ -280,32 +280,6 @@
@if (!(FrameWindow.AreaList[0] is Split) || (SashList.Count == 0 && SplitList.Count == 0)) { - @*
-
-
-
-

Area frame

-
-
- @if (SashList.Count == 0 && SplitList.Count == 0) - { - -
- -
- } -
-
- @if (!(FrameWindow.AreaList[0] is Split)) - { -
- -
- } -
-
-
-
*@ } @@ -810,97 +784,7 @@ } else if (currStep == CompileStep.General) { -
-
-
-
-
-
-
-
-
-
General
-
-
-
-
-
- - -
-
- - -
-
-
-
-
-
-
-
Fill type
-
-
-
- - -
-
- - -
-
-
-
-
-
Color
-
-
-
- - -
-
- - -
-
-
-
-
-
-
-
-
-
-
+ }
diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index caa3695..4505d2e 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -1191,5 +1191,26 @@ namespace WebWindowComplex } #endregion Private Methods + private void SelectColor(string newVal) + { + if (m_CurrWindow != null) + { + m_CurrWindow.sColorMaterial = newVal; + } + } + private void SelectMat(string newVal) + { + if (m_CurrWindow != null) + { + m_CurrWindow.sMaterial = newVal; + } + } + private void SelectGlass(string newVal) + { + if (m_CurrWindow != null) + { + m_CurrWindow.sGlass = newVal; + } + } } } \ No newline at end of file diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 31f6316..9392c8c 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1011 + 2.7.10.1012 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -179,6 +179,9 @@ + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 385b423..dd40bd5 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1011 + 2.7.10.1012 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -216,6 +216,10 @@ + + + +