diff --git a/WebWindowComplex/Compo/AreaFrame.razor b/WebWindowComplex/Compo/AreaFrame.razor index 1b1de08..749d861 100644 --- a/WebWindowComplex/Compo/AreaFrame.razor +++ b/WebWindowComplex/Compo/AreaFrame.razor @@ -1,7 +1,7 @@ 
-
-
+
+
Area frame
diff --git a/WebWindowComplex/Compo/AreaSash.razor b/WebWindowComplex/Compo/AreaSash.razor new file mode 100644 index 0000000..e053a2d --- /dev/null +++ b/WebWindowComplex/Compo/AreaSash.razor @@ -0,0 +1,65 @@ +
+
+
Sash @(CurrSashGroup.SashList.Count == 1 ? "" : (IndexSash + 1))
+
+
+ + +
+
+ Dimension + + % +
+
+
+ +
+
+ +
+
+ @if (!(CurrAnta.AreaList[0] is Split)) + { +
+
+
+ +
+
+
+
+ +
+
+
+ } +
+ @for (int k = 0; k <= CurrSashGroup.SashList.Count - 1; k++) + { + @if (k != IndexSash) + { + int IndexCopy = k; + int IndexModify = IndexSash; +
+
+ +
+
+ } + } +
+
diff --git a/WebWindowComplex/Compo/AreaSash.razor.cs b/WebWindowComplex/Compo/AreaSash.razor.cs new file mode 100644 index 0000000..997b23d --- /dev/null +++ b/WebWindowComplex/Compo/AreaSash.razor.cs @@ -0,0 +1,106 @@ +using Microsoft.AspNetCore.Components; +using WebWindowComplex.Models; + +namespace WebWindowComplex.Compo +{ + public partial class AreaSash + { + /// + /// Sash group corrente + /// + [Parameter] + public Sash CurrSashGroup { get; set; } = null!; + + /// + /// Sash dimension corrente + /// + [Parameter] + public SashDimension CurrSashDim { get; set; } = null!; + + /// + /// Indice della sash corrente + /// + [Parameter] + public int IndexSash { get; set; } = 0; + + /// + /// Evento per cambiare l'anta su cui è presente la maniglia + /// + [Parameter] + public EventCallback EC_ChangeHandle { get; set; } + + /// + /// Evento per cambiare l'anta su cui è presente la maniglia + /// + [Parameter] + public EventCallback EC_CopyContentSash { get; set; } + + /// + /// Anta corrente + /// + public Area CurrAnta + { + get + { + if(CurrSashGroup.AreaList[IndexSash] is Splitted) +{ + return CurrSashGroup.AreaList[IndexSash]; + } + else + { + return CurrSashGroup; + } + } + set + { + CurrAnta = value; + } + } + + /// + /// Sollevo evento per cambiare l'anta su cui è presente la maniglia + /// + /// + private async Task RaiseChangeHandle(SashDimension sashDim, Sash currSash) + { + var Args = new DataChangeHandle + { + currSashDimension = sashDim, + currItem = currSash, + }; + await EC_ChangeHandle.InvokeAsync(Args); + } + + /// + /// Sollevo evento per cambiare l'anta su cui è presente la maniglia + /// + /// + private async Task RaiseCopyContentSash(Sash currSash, int indexC, int indexM) + { + var Args = new DataCopyContentSash + { + currItem = currSash, + indexCopy = indexC, + indexModify = indexM, + }; + await EC_CopyContentSash.InvokeAsync(Args); + } + } + + public class DataChangeHandle + { + public SashDimension currSashDimension { get; set; } = null!; + public Sash currItem { get; set; } = null!; + + } + + public class DataCopyContentSash + { + public Sash currItem { get; set; } = null!; + + public int indexCopy { get; set; } = 0; + + public int indexModify { get; set; } = 0; + + } +} \ No newline at end of file diff --git a/WebWindowComplex/Compo/AreaSplit.razor b/WebWindowComplex/Compo/AreaSplit.razor index 4a3400a..dcd0424 100644 --- a/WebWindowComplex/Compo/AreaSplit.razor +++ b/WebWindowComplex/Compo/AreaSplit.razor @@ -2,14 +2,7 @@
- @if (CurrSplittedList.Count > 1) - { -
Area split @(CurrSplittedList.IndexOf(CurrSplitted) + 1)
- } - else - { -
Area split
- } +
Area split @(CurrSplittedList.Count > 1 ? (CurrSplittedList.IndexOf(CurrSplitted) + 1) : "")
diff --git a/WebWindowComplex/Compo/CardFrame.razor b/WebWindowComplex/Compo/CardFrame.razor index 8ab33d3..d14199e 100644 --- a/WebWindowComplex/Compo/CardFrame.razor +++ b/WebWindowComplex/Compo/CardFrame.razor @@ -2,7 +2,7 @@
-
+
Frame
@@ -32,20 +32,18 @@
- -
Dimension
+
+
Dimension
+
@foreach (FrameDimension dimension in FrameWindow.DimensionList) { - @*
- @dimension.sName - - mm -
*@ }
-
Threshold
+
+
Threshold
+
- - - - -
*@ }
@@ -96,13 +86,13 @@
@if (SashList.Count == 0) { -
-
Bottom rail
+
+
Bottom rail
Quantity - +
} diff --git a/WebWindowComplex/Compo/CardSashGroup.razor b/WebWindowComplex/Compo/CardSashGroup.razor new file mode 100644 index 0000000..510970a --- /dev/null +++ b/WebWindowComplex/Compo/CardSashGroup.razor @@ -0,0 +1,129 @@ +@using static WebWindowComplex.LayoutConst + +
+
+
+
+
Sash group @(SashList.Count > 1 ? (CurrIndex + 1) : "")
+
+
+
+ +
+
+
+ +
+
+
+
+
+
+
+ Qty sash + +
+
+
+
+
+
+ + +
+
+
+
+ Qty bottom rail + +
+
+
+
+
+
+
+
+
Joints
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+ @foreach (Joint joint in CurrItem.JointList) + { + + } + +
+
+
+
+
Hardware
+
+
+
+ + +
+
+ + +
+
+
+
+
+ +
+
+
+ @for (int i = 0; i < CurrItem.SashList.Count; i++) + { + + } +
+
+
+ + + \ No newline at end of file diff --git a/WebWindowComplex/Compo/CardSashGroup.razor.cs b/WebWindowComplex/Compo/CardSashGroup.razor.cs new file mode 100644 index 0000000..995c11a --- /dev/null +++ b/WebWindowComplex/Compo/CardSashGroup.razor.cs @@ -0,0 +1,131 @@ +using Microsoft.AspNetCore.Components; +using WebWindowComplex.Models; + +namespace WebWindowComplex.Compo +{ + public partial class CardSashGroup + { + /// + /// Indice della sash corrente rispetto alla lista sash + /// + [Parameter] + public int CurrIndex { get; set; } = 0; + + /// + /// Sash corrente rispetto alla lista Sash + /// + [Parameter] + public Sash CurrItem { get; set; } = null!; + + /// + /// Lista di sash + /// + [Parameter] + public List SashList { get; set; } = null!; + + /// + /// Evento per cambiare tutti i fill + /// + [Parameter] + public EventCallback EC_RemoveArea { get; set; } + + /// + /// Evento per cambiare tutti i Joints + /// + [Parameter] + public EventCallback EC_ChangeAllJoints { get; set; } + + /// + /// Evento per cambiare l'anta su cui è presente la maniglia + /// + [Parameter] + public EventCallback EC_ChangeHandle { get; set; } + + /// + /// Evento per cambiare l'anta su cui è presente la maniglia + /// + [Parameter] + public EventCallback EC_CopyContentSash { get; set; } + + /// + /// Evento per cambiare tutti i Joints + /// + [Parameter] + public EventCallback EC_UpdateSash { get; set; } + + /// + /// Evento per tornare nella pagine Tree + /// + [Parameter] + public EventCallback EC_ReqClose { get; set; } + + /// + /// Sollevo evento per rimuovere area + /// + /// area da rimuovere + /// + protected async Task RemoveArea(Area currArea) + { + await EC_RemoveArea.InvokeAsync(currArea); + } + + /// + /// Sollevo evento richiesta per cambiare tutti i Joint + /// + /// + private async Task ChangeAllJoints(Json.WindowConst.Joints JointType, Area a) + { + var Args = new DataChangeJoints + { + currJointType = JointType, + currArea = a, + }; + await EC_ChangeAllJoints.InvokeAsync(Args); + } + + /// + /// Sollevo evento per cambiare l'anta su cui è presente la maniglia + /// + /// + private async Task ChangeHandle(DataChangeHandle Args) + { + await EC_ChangeHandle.InvokeAsync(Args); + } + + /// + /// Sollevo evento per cambiare l'anta su cui è presente la maniglia + /// + /// + private async Task CopyContentSash(DataCopyContentSash Args) + { + await EC_CopyContentSash.InvokeAsync(Args); + } + + /// + /// Report aggiornamento joint + /// + /// + /// + private async Task UpdateJoint(Joint updRec) + { + // cerco il record + var currRec = CurrItem.JointList.FirstOrDefault(x => x.ParentArea == updRec.ParentArea && x.nIndex == updRec.nIndex); + // lo aggiorno + if (updRec != null) + { + currRec = updRec; + await EC_UpdateSash.InvokeAsync(CurrItem); + } + } + + /// + /// Sollevo evento per tornare alla pagina Tree + /// + private void ReqClose() + { + _ = EC_ReqClose.InvokeAsync(true); + } + + } + +} \ No newline at end of file diff --git a/WebWindowComplex/Compo/CardSplit.razor b/WebWindowComplex/Compo/CardSplit.razor new file mode 100644 index 0000000..3c266d7 --- /dev/null +++ b/WebWindowComplex/Compo/CardSplit.razor @@ -0,0 +1,132 @@ + +
+
+
+
+
@(descParentSplit(CurrItem))
+
+
+ +
+
+
+
+
+
+
Split
+
+
+ @if ((CurrItem.nSplitQtyVert == 1 && CurrItem.nSplitQtyHoriz == 0) || (CurrItem.nSplitQtyVert == 0 && CurrItem.nSplitQtyHoriz == 1)) + { +
+ +
+ } +
+
+
+ +
+
+
+
+
+
+ + +
+
+
+
+ @if (CurrItem.nSplitQtyVert > 0) + { +
+
+ QtyVert + +
+
+ } + @if (CurrItem.nSplitQtyHoriz > 0) + { +
+
+ QtyHoriz + +
+
+ } +
+
+ @if (CurrItem.SplitVertList.Count > 0 && CurrItem.SplitHorizList.Count > 0) + { +
+ @foreach (var dim in CurrItem.SplitVertList) + { +
+ Width + + % +
+ } +
+
+ @foreach (var dim in CurrItem.SplitHorizList) + { +
+ Height + + % +
+ } +
+ } + else if (CurrItem.SplitHorizList.Count > 0) + { + @foreach (var dim in CurrItem.SplitHorizList) + { +
+
+ Height + + % +
+
+ } + } + else if (CurrItem.SplitVertList.Count > 0) + { + @foreach (var dim in CurrItem.SplitVertList) + { +
+
+ Width + + % +
+
+ } + } +
+ @if (CurrItem.SelSplitShape == Json.WindowConst.SplitShapes.GRID) + { +
+
+
+
+ +
+
+ +
+
+
+
+ } +
+
diff --git a/WebWindowComplex/Compo/CardSplit.razor.cs b/WebWindowComplex/Compo/CardSplit.razor.cs new file mode 100644 index 0000000..2b952dd --- /dev/null +++ b/WebWindowComplex/Compo/CardSplit.razor.cs @@ -0,0 +1,139 @@ +using Microsoft.AspNetCore.Components; +using WebWindowComplex.Models; + +namespace WebWindowComplex.Compo +{ + public partial class CardSplit + { + /// + /// Indice del fill corrente rispetto alla lista fill + /// + [Parameter] + public int CurrIndex { get; set; } = 0; + + /// + /// Fill corrente rispetto alla lista fill + /// + [Parameter] + public Split CurrItem { get; set; } = null!; + + /// + /// Lista di sash + /// + [Parameter] + public List SashList { get; set; } = null!; + + /// + /// Lista di split + /// + [Parameter] + public List SplitList { get; set; } = null!; + + /// + /// Evento per scambiare le aree di uno split + /// + [Parameter] + public EventCallback EC_SwapTwoAree { get; set; } + + /// + /// Evento per rimuovere split + /// + [Parameter] + public EventCallback EC_RemoveArea { get; set; } + + /// + /// Evento per cambiare nel caso di split a griglia se inizia con lo split verticale + /// + [Parameter] + public EventCallback EC_ChangeStartVert { get; set; } + + /// + /// Evento per tornare nella pagine Tree + /// + [Parameter] + public EventCallback EC_ReqClose { get; set; } + + /// + /// Sollevo evento per scambiare le aree di uno split + /// + /// split corrente + /// + protected async Task SwapTwoAree(Split item) + { + await EC_SwapTwoAree.InvokeAsync(item); + } + + /// + /// Sollevo evento per rimuovere split + /// + /// split corrente + /// + protected async Task RemoveArea(Split item) + { + await EC_RemoveArea.InvokeAsync(item); + } + + /// + /// Sollevo evento per rimuovere split + /// + /// split corrente + /// + protected async Task ChangeStartVert(ChangeEventArgs e, Split item) + { + var Args = new DataChangeStartVert + { + eventArg = e, + currItem = item, + }; + await EC_ChangeStartVert.InvokeAsync(Args); + } + + /// + /// Metodo per determinare la descrizione del parent dello split corrente + /// + /// split corrente + /// + protected string descParentSplit(Split currSplit) + { + if ((currSplit.ParentArea is Splitted || currSplit.ParentArea is Sash) && SashList.Count > 0) + { + for (int j = 0; j < SashList.Count; j++) + { + if (SashList[j].Equals(currSplit.ParentArea)) + { + return "Sash " + (j + 1); + } + else if (SashList[j].Equals(currSplit.ParentArea.ParentArea)) + { + for (int k = 0; k < SashList[j].AreaList.Count; k++) + { + if (SashList[j].AreaList[k].AreaList[0].Equals(currSplit)) + { + return "Sash group " + (j + 1) + " - sash " + (k + 1); + } + } + } + } + } + else + { + return "Frame"; + } + return ""; + } + + /// + /// Sollevo evento per tornare alla pagina Tree + /// + private void ReqClose() + { + _ = EC_ReqClose.InvokeAsync(true); + } + } + + public class DataChangeStartVert + { + public ChangeEventArgs eventArg { get; set; } = null!; + public Split currItem { get; set; } + } +} \ No newline at end of file diff --git a/WebWindowComplex/Compo/General.razor b/WebWindowComplex/Compo/General.razor index 1dadeb1..9431e2c 100644 --- a/WebWindowComplex/Compo/General.razor +++ b/WebWindowComplex/Compo/General.razor @@ -1,7 +1,7 @@ 
-
+
General
diff --git a/WebWindowComplex/Json/JsonUtility.cs b/WebWindowComplex/Json/JsonUtility.cs index f5fc86a..439d5e2 100644 --- a/WebWindowComplex/Json/JsonUtility.cs +++ b/WebWindowComplex/Json/JsonUtility.cs @@ -400,7 +400,8 @@ namespace WebWindowComplex.Json newSash.JointList.Add(Joint.Deserialize((Area)ParentArea)); newSash.SetSelFamilyHardwareFromIndex(Hardware); newSash.RefreshHardwareList(); - newSash.SetSelHardwareFromId(newSash.HardwareList.First().Id); + if (newSash.HardwareList.Count() > 0) + newSash.SetSelHardwareFromId(newSash.HardwareList.First().Id); foreach (var Area in AreaList) { var AreaDeserealized = Area.Deserialize(newSash, ParentWindow); diff --git a/WebWindowComplex/Models/Frame.cs b/WebWindowComplex/Models/Frame.cs index b3e0354..c83b55c 100644 --- a/WebWindowComplex/Models/Frame.cs +++ b/WebWindowComplex/Models/Frame.cs @@ -86,22 +86,25 @@ namespace WebWindowComplex.Models Shapes SelShape = (Shapes)IdNameStruct.IdFromInd(value, m_ShapeList); if (m_Shape != SelShape) { + // salvo vecchie dimensioni + List oldDimensionList = new List(DimensionList); // verifico parametri Dimension DimensionList.Clear(); + double widthVal = oldDimensionList.Where(x => x.sName.Equals("Width")).Select(x => x.dValue).First(); // aggiungo Dimensioni switch (SelShape) { case Shapes.RECTANGLE: case Shapes.ARC_FULL: { - DimensionList.Add(new FrameDimension(this, 1, "Width", 1500, true)); + DimensionList.Add(new FrameDimension(this, 1, "Width", widthVal, true)); DimensionList.Add(new FrameDimension(this, 2, "Height", 1800, true)); break; } case Shapes.RIGHTCHAMFER: { - DimensionList.Add(new FrameDimension(this, 1, "Width", 1500, true)); + DimensionList.Add(new FrameDimension(this, 1, "Width", widthVal, true)); DimensionList.Add(new FrameDimension(this, 2, "Left Height", 1800, true)); DimensionList.Add(new FrameDimension(this, 3, "Right Height", 1500, true)); break; @@ -109,7 +112,7 @@ namespace WebWindowComplex.Models case Shapes.LEFTCHAMFER: { - DimensionList.Add(new FrameDimension(this, 1, "Width", 1500, true)); + DimensionList.Add(new FrameDimension(this, 1, "Width", widthVal, true)); DimensionList.Add(new FrameDimension(this, 2, "Left Height", 1500, true)); DimensionList.Add(new FrameDimension(this, 3, "Right Height", 1800, true)); break; @@ -118,7 +121,7 @@ namespace WebWindowComplex.Models case Shapes.DOUBLECHAMFER: case Shapes.ARC: { - DimensionList.Add(new FrameDimension(this, 1, "Width", 1500, true)); + DimensionList.Add(new FrameDimension(this, 1, "Width", widthVal, true)); DimensionList.Add(new FrameDimension(this, 2, "Height", 1500, true)); DimensionList.Add(new FrameDimension(this, 3, "Full Height", 1800, true)); break; @@ -126,7 +129,7 @@ namespace WebWindowComplex.Models case Shapes.DOUBLEARC: { - DimensionList.Add(new FrameDimension(this, 1, "Width", 1500, true)); + DimensionList.Add(new FrameDimension(this, 1, "Width", widthVal, true)); DimensionList.Add(new FrameDimension(this, 2, "Height", 1500, true)); DimensionList.Add(new FrameDimension(this, 3, "Full Height", 2400, true)); break; @@ -134,7 +137,7 @@ namespace WebWindowComplex.Models case Shapes.TRIANGLE: { - DimensionList.Add(new FrameDimension(this, 1, "Width", 2000, true)); + DimensionList.Add(new FrameDimension(this, 1, "Width", widthVal, true)); DimensionList.Add(new FrameDimension(this, 2, "Height", 1500, true)); DimensionList.Add(new FrameDimension(this, 3, "Height projection", 0, true)); break; @@ -147,7 +150,7 @@ namespace WebWindowComplex.Models } } // salvo tipo Joint - Joints oldJointType = JointList[0].SelJointType; + List oldJointType = new List(JointList); // aggiungo Joint m_JointList.Clear(); switch (SelShape) @@ -159,17 +162,17 @@ namespace WebWindowComplex.Models case Shapes.ARC: case Shapes.DOUBLEARC: { - JointList.Add(new Joint(this, 1, oldJointType)); - JointList.Add(new Joint(this, 2, oldJointType)); - JointList.Add(new Joint(this, 3, oldJointType)); - JointList.Add(new Joint(this, 4, oldJointType)); + JointList.Add(new Joint(this, 1, oldJointType[0].SelJointType)); + JointList.Add(new Joint(this, 2, oldJointType[1].SelJointType)); + JointList.Add(new Joint(this, 3, oldJointType[2].SelJointType)); + JointList.Add(new Joint(this, 4, oldJointType[3].SelJointType)); break; } case Shapes.ARC_FULL: { - JointList.Add(new Joint(this, 1, oldJointType)); - JointList.Add(new Joint(this, 2, oldJointType)); + JointList.Add(new Joint(this, 1, oldJointType[0].SelJointType)); + JointList.Add(new Joint(this, 2, oldJointType[1].SelJointType)); JointList.Add(new Joint(this, 3, Joints.ANGLED)); JointList.Add(new Joint(this, 4, Joints.ANGLED)); break; @@ -177,8 +180,8 @@ namespace WebWindowComplex.Models case Shapes.TRIANGLE: { - JointList.Add(new Joint(this, 1, oldJointType)); - JointList.Add(new Joint(this, 2, oldJointType)); + JointList.Add(new Joint(this, 1, oldJointType[0].SelJointType)); + JointList.Add(new Joint(this, 2, oldJointType[1].SelJointType)); JointList.Add(new Joint(this, 3, Joints.ANGLED)); break; } diff --git a/WebWindowComplex/Models/SplitDimension.cs b/WebWindowComplex/Models/SplitDimension.cs index 467e605..8849369 100644 --- a/WebWindowComplex/Models/SplitDimension.cs +++ b/WebWindowComplex/Models/SplitDimension.cs @@ -124,6 +124,18 @@ namespace WebWindowComplex.Models } } + public Split Parent + { + get + { + return m_Parent; + } + set + { + m_Parent = value; + } + } + #endregion Public Properties #region Public Methods diff --git a/WebWindowComplex/TableComp.razor b/WebWindowComplex/TableComp.razor index 1b52248..f0b1ed4 100644 --- a/WebWindowComplex/TableComp.razor +++ b/WebWindowComplex/TableComp.razor @@ -49,7 +49,7 @@ } @@ -85,464 +85,86 @@
-
- @if (string.IsNullOrEmpty(LiveData.CurrJwd)) + @if (string.IsNullOrEmpty(LiveData.CurrJwd)) + { + @if (currStep == CompileStep.Template && ListPayload.TemplateDTO != null) { - @if (currStep == CompileStep.Template && ListPayload.TemplateDTO != null) - { - - - - - - +
#ImageDescription
+ + + + + + + + + @foreach (var item in ListPayload.TemplateDTO) + { + string colorClass = ""; + @if (SelTemplateDTO != null && item.Index == SelTemplateDTO.Index) + colorClass = "table-success"; + else + colorClass = ""; + + + + - - - @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
@item.Index@item.Description
- } + } + + } - @if (currStep == CompileStep.Tree) + } + @if (currStep == CompileStep.Tree) + { + + } + else if (currStep == CompileStep.Frame) + { + @if (m_CurrWindow != null) { - + m_PreviousWindow = m_CurrWindow; } - else if (currStep == CompileStep.Frame) + + } + else if (currStep == CompileStep.Split) + { + @if (currSplit >= SplitList.Count || currSplit == -1) { - @if (m_CurrWindow != null) - { - m_PreviousWindow = m_CurrWindow; - } - + currStep = CompileStep.Tree; } - else if (currStep == CompileStep.Split) + else { - @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) - { -
-
-
-
- -
-
- -
-
-
-
- } -
-
-
-
-
-
-
-
-
-
- } + Split item = SplitList[currSplit]; + } - else if (currStep == CompileStep.Sash) + } + else if (currStep == CompileStep.Sash) + { + @if (currSash >= SashList.Count || currSash == -1) { - @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; -
-
- -
-
- } - } -
-
- - } - } -
-
-
-
-
-
-
-
- } + currStep = CompileStep.Tree; } - else if (currStep == CompileStep.Fill) + else { - @if (currFill >= FillList.Count || currFill == -1) - { - currStep = CompileStep.Tree; - } - else - { - Fill item = FillList[currFill]; - - } + } - else if (currStep == CompileStep.General) + } + else if (currStep == CompileStep.Fill) + { + @if (currFill >= FillList.Count || currFill == -1) { - + currStep = CompileStep.Tree; } -
+ else + { + + } + } + else if (currStep == CompileStep.General) + { + + }
@@ -576,5 +198,4 @@ -} - +} \ No newline at end of file diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index 1b87074..d03a760 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -154,8 +154,10 @@ namespace WebWindowComplex /// /// anta su cui si seleziona la maniglia /// - protected void changeHandle(SashDimension sashDim, Sash currSash) + protected void changeHandle(DataChangeHandle Args) { + SashDimension sashDim = Args.currSashDimension; + Sash currSash = Args.currItem; // Cerco la Sash che si sta considerando nella lista Sash foreach (Sash s in SashList) { @@ -198,8 +200,10 @@ namespace WebWindowComplex /// /// split su cui si sceglie /// - protected void changeStartVert(ChangeEventArgs e, Split currSplit) + protected async Task changeStartVert(DataChangeStartVert Args) { + ChangeEventArgs e = Args.eventArg; + Split currSplit = Args.currItem; // Cerco la Sash che si sta considerando nella lista Sash foreach (Split s in SplitList) { @@ -208,6 +212,7 @@ namespace WebWindowComplex s.SetSplitStartVert((bool)e.Value); } } + await DoPreviewSvg(); } /// @@ -250,9 +255,9 @@ namespace WebWindowComplex nWIndow = SashList.Count == 1 ? "" : $"{i + 1}"; // Se il nodo ha figli, salvo il numero nell'oggetto if (node.AreaList.Count >= 1) - ItemTableList.Add(new ItemTable(AreaTypes.SASH, "WIN" + nWIndow, maxRow, col, i, node.AreaList.Count)); + ItemTableList.Add(new ItemTable(AreaTypes.SASH, "SG" + nWIndow, maxRow, col, i, node.AreaList.Count)); else - ItemTableList.Add(new ItemTable(AreaTypes.SASH, "WIN" + nWIndow, maxRow, col, i, 0)); + ItemTableList.Add(new ItemTable(AreaTypes.SASH, "SG" + nWIndow, maxRow, col, i, 0)); } } maxCol++; @@ -261,9 +266,9 @@ namespace WebWindowComplex { // Se il nodo ha figli, salvo il numero nell'oggetto if (node.AreaList.Count >= 1) - ItemTableList.Add(new ItemTable(AreaTypes.SASH, "WIN", row, col, 0, node.AreaList.Count)); + ItemTableList.Add(new ItemTable(AreaTypes.SASH, "SG", row, col, 0, node.AreaList.Count)); else - ItemTableList.Add(new ItemTable(AreaTypes.SASH, "WIN", row, col, 0, 0)); + ItemTableList.Add(new ItemTable(AreaTypes.SASH, "SG", row, col, 0, 0)); maxCol++; } row++; @@ -412,39 +417,7 @@ namespace WebWindowComplex return listWarnings.ContainsKey(fKey) ? "border border-danger" : ""; } - /// - /// Metodo per determinare la descrizione del parent dello split corrente - /// - /// split corrente - /// - protected string descParentSplit(Split currSplit) - { - if ((currSplit.ParentArea is Splitted || currSplit.ParentArea is Sash) && SashList.Count > 0) - { - for (int j = 0; j < SashList.Count; j++) - { - if (SashList[j].Equals(currSplit.ParentArea)) - { - return "Sash " + (j + 1); - } - else if (SashList[j].Equals(currSplit.ParentArea.ParentArea)) - { - for (int k = 0; k < SashList[j].AreaList.Count; k++) - { - if (SashList[j].AreaList[k].AreaList[0].Equals(currSplit)) - { - return "Sash " + (j + 1) + " - anta " + (k + 1); - } - } - } - } - } - else - { - return "Frame"; - } - return ""; - } + /// /// Richiesta chiusura SENZA salvataggio (= restore prev) @@ -486,31 +459,8 @@ namespace WebWindowComplex /// Metodo di reset dei dati a quelli del template /// protected async Task DoReset() - { - // Aggiornati parametri di ingresso selezionati - Area.nCounterGroup = 0; - UpdateSelParameter(); - JsonWindow WindowFromJson; - if (string.IsNullOrEmpty(LiveData.CurrJwd)) - WindowFromJson = JsonConvert.DeserializeObject(m_SelTemplate.JWD, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", ""); - else - WindowFromJson = JsonConvert.DeserializeObject(LiveData.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; - // Aggiorante liste sash, split, splitted, fill e itemTable - UpdateLists(); - currSash = -1; - currFill = -1; - currSplit = -1; - currStep = CompileStep.Tree; - editLock = false; - bError = false; - await DoPreviewSvg(); + { + // Da fare } /// @@ -835,34 +785,7 @@ namespace WebWindowComplex /// /// Metodo per settare tutti i Joints di Frame o Sash come ANGLED o FULL_H o FULL_V /// - /// tipo di giunzione (ANGLED o FULL_H o FULL_V) - /// area su cui eseguire la funzione (Frame o Sash) - /// - //private async Task ChangeAllJoints(WindowConst.Joints type, Area area) - //{ - // if (area is Frame) - // { - // foreach (Joint joint in FrameWindow.JointList) - // { - // joint.SetSelJointType(type); - // } - // } - // else - // { - // Sash a = (Sash)area; - // foreach (Joint joint in a.JointList) - // { - // joint.SetSelJointType(type); - // } - // } - // await DoPreviewSvg(); - //} - - /// - /// Metodo per settare tutti i Joints di Frame o Sash come ANGLED o FULL_H o FULL_V - /// - /// tipo di giunzione (ANGLED o FULL_H o FULL_V) - /// area su cui eseguire la funzione (Frame o Sash) + /// /// private async Task ChangeAllJoints(DataChangeJoints Args) { @@ -959,11 +882,12 @@ namespace WebWindowComplex /// /// Metodo per copiare contenuto di un'anta in un'altra anta /// - /// Sash corrispondente all'anta - /// Indice dell'anta che si copia - /// Indice dell'anta che si modifica - private async Task CopyContentSash(Sash sashItem, int IndexCopy, int IndexModify) + /// + private async Task CopyContentSash(DataCopyContentSash Args) { + Sash sashItem = Args.currItem; + int IndexCopy = Args.indexCopy; + int IndexModify = Args.indexModify; // Anta selezionata Area sashSplitted = sashItem.AreaList[IndexModify]; // Rimuovo riempimento da anta selezionata @@ -978,8 +902,7 @@ namespace WebWindowComplex /// /// Metodo per copiare una Sash intera /// - /// Area Splitted corrente - /// Indice della Sash che si vuole copiare + /// /// private async Task CopySash(DataAreaSplit Args) { @@ -996,93 +919,6 @@ namespace WebWindowComplex await DoPreviewSvg(); } - ///// - ///// Metodo per riempire tabella con contenuto vuoto o con i simboli per rappresentare la struttura - ///// - ///// riga della cella - ///// colonna della cella - ///// - //private string FillTable(DataFillTable Args) - //{ - // int row = Args.indRow; - // int col = Args.indCol; - // List itemSameCol = new List(); - // for (int k = 0; k < row; k++) - // { - // if (ItemTableList[k].Col == col + 1) - // { - // itemSameCol.Add(ItemTableList[k]); - // } - // continue; - // } - // int numItemNextCol = 0; - // for (int k = 0; k < row; k++) - // { - // if (ItemTableList[k].Row <= row && ItemTableList[k].Col == col + 2) - // { - // numItemNextCol++; - // } - // continue; - // } - // if (itemSameCol.Count > 1) - // { - // for (int i = 0; i <= itemSameCol.Count - 2; i++) - // { - // if (itemSameCol[i].NumChild > 0) - // numItemNextCol = numItemNextCol - itemSameCol[i].NumChild; - // } - // } - // if (itemSameCol.Count > 0) - // { - // // Sono alla riga successiva di un elemento e nella stessa colonna - // if (itemSameCol.Last().Row == row) - // { - // // se ha un solo figlio - // if (itemSameCol.Last().NumChild == 1) - // { - // return "└"; - // } - // else if (itemSameCol.Last().NumChild == 0) - // { - // return " "; - // } - // else - // { - // return "├"; - // } - // } - // // Non sono alla riga successiva - // else - // { - // // se ha un solo figlio - // if (itemSameCol.Last().NumChild == 1) - // { - // return " "; - // } - // else if (col + 2 <= m_maxCol && ItemTableList[row].Col == col + 2) - // { - // if (numItemNextCol < itemSameCol.Last().NumChild && numItemNextCol != (itemSameCol.Last().NumChild - 1)) - // { - // return "├"; - // } - // return "└"; - // } - // else if (numItemNextCol < itemSameCol.Last().NumChild) - // { - // return "│"; - // } - // else - // { - // return " "; - // } - // } - // } - // else - // { - // return " "; - // } - //} - /// /// Calcola larghezza colonna header nav /// @@ -1146,7 +982,7 @@ namespace WebWindowComplex /// /// Metodo per cambiare step /// - /// argomenti passati dal componente + /// private void NextStepArgs(DataNextStep Args) { CompileStep newStep = Args.currCompileStep; @@ -1256,6 +1092,43 @@ namespace WebWindowComplex await DoPreviewSvg(); } + /// + /// Aggiornamento Sash e Frame + /// + /// nuova sash + /// + private async Task UpdateSash(Sash newSash) + { + SearchSash(m_Frame, newSash.IdGroup, newSash); + await DoPreviewSvg(); + } + + /// + /// Cerca e aggiorna la sash + /// + /// area corrente che si sta valutando + /// id della sash che si sta cercando + /// nuova sash + /// + public Area SearchSash(Area currentArea, int idSearch, Sash newSash) + { + if (currentArea.IdGroup == idSearch && currentArea.AreaType.Equals(AreaTypes.SASH)) + { + currentArea = newSash; + return currentArea; + } + foreach (Area child in currentArea.AreaList) + { + Area found = SearchSash(child, idSearch, newSash); + if (found != null) + { + return found; + } + } + return null; + } + + #endregion Private Methods } } \ No newline at end of file diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 7394983..d33bcfb 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1316 + 2.7.10.1412 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -30,90 +30,3 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index c42c5d7..842adef 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1316 + 2.7.10.1412 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -37,114 +37,3 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -