From 3f9d91996976dafa9fa28af4c5216e9629c8963c Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Fri, 10 Oct 2025 13:34:11 +0200 Subject: [PATCH 01/23] Aggiunto controllo per valore di Glass e Material scritto nel Jwd --- Test.UI/Components/Pages/EditJWD.razor.cs | 2 +- .../WebAedificaConfigurator.csproj | 2 +- WebWindowComplex/AreaFrame.razor | 4 +- WebWindowComplex/AreaFrame.razor.cs | 2 +- WebWindowComplex/TableComp.razor.cs | 10 +- WebWindowComplex/WebWindowComplex.csproj | 160 +-------------- .../WebWindowConfigurator.csproj | 189 +----------------- WebWindowTest/WebWindowTest.csproj | 2 +- 8 files changed, 19 insertions(+), 352 deletions(-) diff --git a/Test.UI/Components/Pages/EditJWD.razor.cs b/Test.UI/Components/Pages/EditJWD.razor.cs index 20a632a..1643672 100644 --- a/Test.UI/Components/Pages/EditJWD.razor.cs +++ b/Test.UI/Components/Pages/EditJWD.razor.cs @@ -122,7 +122,7 @@ namespace Test.UI.Components.Pages ColorMaterial = AvailColorMaterialList, FamilyHardware = AvailFamilyHardwareList, Glass = AvailGlassList, - //Hardware = new List(), + //FamilyHardware = new List(), //Material = new List(), Hardware = AvailHardwareList, Material = AvailMaterialList, diff --git a/WebAedificaConfigurator/WebAedificaConfigurator.csproj b/WebAedificaConfigurator/WebAedificaConfigurator.csproj index 127bb1f..9e3b60b 100644 --- a/WebAedificaConfigurator/WebAedificaConfigurator.csproj +++ b/WebAedificaConfigurator/WebAedificaConfigurator.csproj @@ -12,7 +12,7 @@ - + diff --git a/WebWindowComplex/AreaFrame.razor b/WebWindowComplex/AreaFrame.razor index 6920bad..1b068c2 100644 --- a/WebWindowComplex/AreaFrame.razor +++ b/WebWindowComplex/AreaFrame.razor @@ -1,4 +1,4 @@ -
+
@@ -17,7 +17,7 @@ @if (!(CurrFrameWindow.AreaList[0] is Split)) {
- +
}
diff --git a/WebWindowComplex/AreaFrame.razor.cs b/WebWindowComplex/AreaFrame.razor.cs index e48429e..e74d744 100644 --- a/WebWindowComplex/AreaFrame.razor.cs +++ b/WebWindowComplex/AreaFrame.razor.cs @@ -38,7 +38,7 @@ namespace WebWindowComplex /// Sollevo evento richiesta aggiunta window /// /// - private async Task RaiseAddWindow() + private async Task RaiseAddSplit() { await EC_AddWindow.InvokeAsync(true); } diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index 4505d2e..4c9fc90 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -676,7 +676,7 @@ namespace WebWindowComplex { if (ListPayload.FamilyHardware == null || ListPayload.FamilyHardware.Count == 0) { - listErrPre.Add("FamilyHardware", "Missing Famly HW List!"); + listErrPre.Add("FamilyHardware", "Missing Family HW List!"); } } if (ListPayload.Glass == null || ListPayload.Glass.Count == 0) @@ -708,6 +708,14 @@ namespace WebWindowComplex { listWarnings.Add("ColorMaterial", $"Missing Color: {m_CurrWindow.sColorMaterial}"); } + if (!ListPayload.Glass.Contains(m_CurrWindow.sGlass)) + { + listWarnings.Add("Glass", $"Missing Glass: {m_CurrWindow.sGlass}"); + } + if (!ListPayload.Material.Contains(m_CurrWindow.sMaterial)) + { + listWarnings.Add("Material", $"Missing Material: {m_CurrWindow.sMaterial}"); + } } } } diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 9392c8c..9fc1645 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1012 + 2.7.10.1013 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -18,7 +18,7 @@ - + @@ -30,159 +30,3 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index dd40bd5..5285456 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1012 + 2.7.10.1013 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -26,7 +26,7 @@ - + @@ -40,188 +40,3 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/WebWindowTest/WebWindowTest.csproj b/WebWindowTest/WebWindowTest.csproj index d06e030..42d8abe 100644 --- a/WebWindowTest/WebWindowTest.csproj +++ b/WebWindowTest/WebWindowTest.csproj @@ -12,7 +12,7 @@ - + From 0bdcefedcd9e0af9de69b4b9b6574a392e22b9f9 Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Fri, 10 Oct 2025 15:36:50 +0200 Subject: [PATCH 02/23] Aggiunta componente indipendente per Area Split --- WebWindowComplex/AreaSplit.razor | 30 +++++++++++++++++ WebWindowComplex/AreaSplit.razor.cs | 33 +++++++++++++++++++ WebWindowComplex/TableComp.razor | 9 ++--- WebWindowComplex/WebWindowComplex.csproj | 1 + .../WebWindowConfigurator.csproj | 14 +++++++- 5 files changed, 80 insertions(+), 7 deletions(-) create mode 100644 WebWindowComplex/AreaSplit.razor create mode 100644 WebWindowComplex/AreaSplit.razor.cs diff --git a/WebWindowComplex/AreaSplit.razor b/WebWindowComplex/AreaSplit.razor new file mode 100644 index 0000000..0b6adf0 --- /dev/null +++ b/WebWindowComplex/AreaSplit.razor @@ -0,0 +1,30 @@ +
+
+
+
+ @if (CurrSplittedList.Count > 1) + { +

Area split @(CurrSplittedList.IndexOf(CurrSplitted) + 1)

+ } + else + { +

Area split

+ } +
+
+
+ +
+
+ @for (int j = 0; j < CurrSashList.Count; j++) + { + int Index = j; +
+
+ +
+
+ } +
+
+
diff --git a/WebWindowComplex/AreaSplit.razor.cs b/WebWindowComplex/AreaSplit.razor.cs new file mode 100644 index 0000000..0a37662 --- /dev/null +++ b/WebWindowComplex/AreaSplit.razor.cs @@ -0,0 +1,33 @@ +using Microsoft.AspNetCore.Components; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WebWindowComplex +{ + public partial class AreaSplit + { + [Parameter] + public List CurrSplittedList { get; set; } = null; + + [Parameter] + public List CurrSashList { get; set; } = null; + + [Parameter] + public Splitted CurrSplitted { get; set; } = null; + + [Parameter] + public EventCallback EC_CopySash { get; set; } + + /// + /// Sollevo evento richiesta copia sash + /// + /// + private async Task RaiseCopySash(int indexCurrSash) + { + await EC_CopySash.InvokeAsync(indexCurrSash); + } + } +} diff --git a/WebWindowComplex/TableComp.razor b/WebWindowComplex/TableComp.razor index 021ecc7..22b82f9 100644 --- a/WebWindowComplex/TableComp.razor +++ b/WebWindowComplex/TableComp.razor @@ -737,12 +737,10 @@
@foreach (var currSplitted in SplittedList) - @* @for (int i = 0; i < SplittedList.Count; i++) *@ { - @* Splitted currSplitted = SplittedList[i]; *@ @if (currSplitted.AreaList[0].Equals(item)) { -
+ @*
@@ -761,9 +759,7 @@
@foreach (var Index in SashList) - @* @for (int j = 0; j < SashList.Count; j++) *@ { - @* int Index = j; *@
@@ -772,7 +768,8 @@ }
-
+
*@ + } }
diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 9fc1645..04c8025 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -30,3 +30,4 @@ + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 5285456..27945d8 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1013 + 2.7.10.1015 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -40,3 +40,15 @@ + + + + + + + + + + + + From 0a904e9292c3968a3eca27bf09070c034c470af9 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 10 Oct 2025 16:42:16 +0200 Subject: [PATCH 03/23] Update gestione componenti --- Test.UI/Components/Pages/EditJWD.razor | 8 +- Test.UI/Components/Pages/EditJWD.razor.cs | 4 +- WebWindowComplex/AreaSplit.razor | 4 +- WebWindowComplex/General.razor | 167 ++++++++------- WebWindowComplex/General.razor.cs | 9 + WebWindowComplex/TableComp.razor | 7 +- WebWindowComplex/TableComp.razor.cs | 190 ++++++++++-------- WebWindowComplex/WebWindowComplex.csproj | 22 +- .../WebWindowConfigurator.csproj | 22 +- 9 files changed, 246 insertions(+), 187 deletions(-) diff --git a/Test.UI/Components/Pages/EditJWD.razor b/Test.UI/Components/Pages/EditJWD.razor index 4b6c9cb..3fdf510 100644 --- a/Test.UI/Components/Pages/EditJWD.razor +++ b/Test.UI/Components/Pages/EditJWD.razor @@ -23,6 +23,8 @@ else if (!string.IsNullOrEmpty(outSave)) @outSave
} -

- @currJwd -

+
+
+ @JsonSer +
+
diff --git a/Test.UI/Components/Pages/EditJWD.razor.cs b/Test.UI/Components/Pages/EditJWD.razor.cs index 1643672..18e7367 100644 --- a/Test.UI/Components/Pages/EditJWD.razor.cs +++ b/Test.UI/Components/Pages/EditJWD.razor.cs @@ -1,4 +1,5 @@ -using EgwCoreLib.Lux.Core; +using Egw.Window.Data; +using EgwCoreLib.Lux.Core; using EgwCoreLib.Lux.Core.RestPayload; using EgwCoreLib.Lux.Data.Services; using Microsoft.AspNetCore.Components; @@ -6,7 +7,6 @@ using Newtonsoft.Json; using NLog; using System.Diagnostics; using System.Security.AccessControl; -using Egw.Window.Data; using WebWindowComplex; using WebWindowComplex.DTO; diff --git a/WebWindowComplex/AreaSplit.razor b/WebWindowComplex/AreaSplit.razor index 0b6adf0..2d36571 100644 --- a/WebWindowComplex/AreaSplit.razor +++ b/WebWindowComplex/AreaSplit.razor @@ -13,7 +13,7 @@
- +
@for (int j = 0; j < CurrSashList.Count; j++) @@ -21,7 +21,7 @@ int Index = j;
- +
} diff --git a/WebWindowComplex/General.razor b/WebWindowComplex/General.razor index b8264d3..d041093 100644 --- a/WebWindowComplex/General.razor +++ b/WebWindowComplex/General.razor @@ -1,92 +1,87 @@  -
-
-
-
-
-
-
-
-
-
General
-
-
-
-
-
- - -
-
- - -
-
-
-
-
-
-
-
Fill type
-
-
-
- - -
-
- - -
-
-
-
-
-
Color
-
-
-
- - -
-
- - -
-
-
-
-
+
+
+
+
+
General
+
+
+ +
+
+
+
+
+
+
+ + +
+
+ + +
+
+
+
+
+
+
+
Fill type
+
+
+
+ + +
+
+ + +
+
+
+
+
+
Color
+
+
+
+ + +
+
+ +
-
\ No newline at end of file +
diff --git a/WebWindowComplex/General.razor.cs b/WebWindowComplex/General.razor.cs index 4eb2303..d6ef2ff 100644 --- a/WebWindowComplex/General.razor.cs +++ b/WebWindowComplex/General.razor.cs @@ -1,4 +1,5 @@ using Microsoft.AspNetCore.Components; +using Newtonsoft.Json.Linq; using WebWindowComplex.DTO; namespace WebWindowComplex @@ -22,6 +23,9 @@ namespace WebWindowComplex [Parameter] public EventCallback EC_SelWindMat { get; set; } + [Parameter] + public EventCallback EC_ReqClose { get; set; } + /// /// Elenco anagrafiche di base /// @@ -98,5 +102,10 @@ namespace WebWindowComplex private string currMaterial = ""; #endregion Private Fields + + private void ReqClose() + { + _ = EC_ReqClose.InvokeAsync(true); + } } } \ No newline at end of file diff --git a/WebWindowComplex/TableComp.razor b/WebWindowComplex/TableComp.razor index 22b82f9..f47ea48 100644 --- a/WebWindowComplex/TableComp.razor +++ b/WebWindowComplex/TableComp.razor @@ -84,7 +84,7 @@
-
+
@if (string.IsNullOrEmpty(LiveData.CurrJwd)) { @if (currStep == CompileStep.Template && ListPayload.TemplateDTO != null) @@ -769,7 +769,8 @@
*@ - + + @* *@ } }
@@ -781,7 +782,7 @@ } else if (currStep == CompileStep.General) { - + }
diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index 4c9fc90..2d45657 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -427,6 +427,16 @@ namespace WebWindowComplex } } + /// + /// Calcola CSS warning + /// + /// + /// + protected string cssValid(string fKey) + { + return listWarnings.ContainsKey(fKey) ? "border border-danger" : ""; + } + /// /// Metodo per determinare la descrizione del parent dello split corrente /// @@ -662,74 +672,6 @@ namespace WebWindowComplex } } - /// - /// Verifica errori prelimionari per mostrare dove sia il problema - /// - 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 Family 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}"); - } - if (!ListPayload.Glass.Contains(m_CurrWindow.sGlass)) - { - listWarnings.Add("Glass", $"Missing Glass: {m_CurrWindow.sGlass}"); - } - if (!ListPayload.Material.Contains(m_CurrWindow.sMaterial)) - { - listWarnings.Add("Material", $"Missing Material: {m_CurrWindow.sMaterial}"); - } - } - } - } - - /// - /// Calcola CSS warning - /// - /// - /// - protected string cssValid(string fKey) - { - return listWarnings.ContainsKey(fKey) ? "border border-danger" : ""; - } - protected void setCurrWindow(JsonWindow WindowFromJson) { if (m_CurrWindow != null) @@ -953,6 +895,64 @@ namespace WebWindowComplex await DoPreviewSvg(); } + /// + /// Verifica errori prelimionari per mostrare dove sia il problema + /// + 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 Family 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}"); + } + if (!ListPayload.Glass.Contains(m_CurrWindow.sGlass)) + { + listWarnings.Add("Glass", $"Missing Glass: {m_CurrWindow.sGlass}"); + } + if (!ListPayload.Material.Contains(m_CurrWindow.sMaterial)) + { + listWarnings.Add("Material", $"Missing Material: {m_CurrWindow.sMaterial}"); + } + } + } + } + /// /// Metodo per copiare contenuto di un'anta in un'altra anta /// @@ -1156,6 +1156,39 @@ namespace WebWindowComplex currStep = CompileStep.Tree; } + /// + /// Ritorno step Tree + /// + /// + private void ReturnTree(bool args) + { + AdvStep(CompileStep.Tree); + } + + private void SelectColor(string newVal) + { + if (m_CurrWindow != null) + { + m_CurrWindow.sColorMaterial = newVal; + } + } + + private void SelectGlass(string newVal) + { + if (m_CurrWindow != null) + { + m_CurrWindow.sGlass = newVal; + } + } + + private void SelectMat(string newVal) + { + if (m_CurrWindow != null) + { + m_CurrWindow.sMaterial = newVal; + } + } + /// /// Metodo per scambiare due aree di uno split /// @@ -1199,26 +1232,5 @@ 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 04c8025..e8aec1a 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1013 + 2.7.10.1016 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -24,6 +24,11 @@ + + + + + @@ -31,3 +36,18 @@ + + + + + + + + + + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 27945d8..df94faa 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1015 + 2.7.10.1016 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -52,3 +52,23 @@ + + + + + + + + + + + + + + + + + + + + From 17db9b16c609b833267532c2d84927a131b5c016 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 10 Oct 2025 16:47:28 +0200 Subject: [PATCH 04/23] Riorganizzazione window in folder models --- WebWindowComplex/AreaFrame.razor.cs | 1 + WebWindowComplex/AreaSplit.razor.cs | 20 +++++++++++-------- WebWindowComplex/General.razor.cs | 2 +- WebWindowComplex/Json/JsonUtility.cs | 1 + WebWindowComplex/{ => Models}/Window.cs | 2 +- WebWindowComplex/TableComp.razor.cs | 6 +----- WebWindowComplex/WebWindowComplex.csproj | 3 +++ WebWindowComplex/_Imports.razor | 2 ++ .../WebWindowConfigurator.csproj | 8 ++++++++ 9 files changed, 30 insertions(+), 15 deletions(-) rename WebWindowComplex/{ => Models}/Window.cs (99%) diff --git a/WebWindowComplex/AreaFrame.razor.cs b/WebWindowComplex/AreaFrame.razor.cs index e74d744..285533f 100644 --- a/WebWindowComplex/AreaFrame.razor.cs +++ b/WebWindowComplex/AreaFrame.razor.cs @@ -1,4 +1,5 @@ using Microsoft.AspNetCore.Components; +using WebWindowComplex.Models; namespace WebWindowComplex { diff --git a/WebWindowComplex/AreaSplit.razor.cs b/WebWindowComplex/AreaSplit.razor.cs index 0a37662..31efbe9 100644 --- a/WebWindowComplex/AreaSplit.razor.cs +++ b/WebWindowComplex/AreaSplit.razor.cs @@ -1,16 +1,11 @@ using Microsoft.AspNetCore.Components; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using WebWindowComplex.Models; namespace WebWindowComplex { public partial class AreaSplit { - [Parameter] - public List CurrSplittedList { get; set; } = null; + #region Public Properties [Parameter] public List CurrSashList { get; set; } = null; @@ -18,9 +13,16 @@ namespace WebWindowComplex [Parameter] public Splitted CurrSplitted { get; set; } = null; + [Parameter] + public List CurrSplittedList { get; set; } = null; + [Parameter] public EventCallback EC_CopySash { get; set; } + #endregion Public Properties + + #region Private Methods + /// /// Sollevo evento richiesta copia sash /// @@ -29,5 +31,7 @@ namespace WebWindowComplex { await EC_CopySash.InvokeAsync(indexCurrSash); } + + #endregion Private Methods } -} +} \ No newline at end of file diff --git a/WebWindowComplex/General.razor.cs b/WebWindowComplex/General.razor.cs index d6ef2ff..907f980 100644 --- a/WebWindowComplex/General.razor.cs +++ b/WebWindowComplex/General.razor.cs @@ -1,6 +1,6 @@ using Microsoft.AspNetCore.Components; -using Newtonsoft.Json.Linq; using WebWindowComplex.DTO; +using WebWindowComplex.Models; namespace WebWindowComplex { diff --git a/WebWindowComplex/Json/JsonUtility.cs b/WebWindowComplex/Json/JsonUtility.cs index a1edcdf..c60fe9b 100644 --- a/WebWindowComplex/Json/JsonUtility.cs +++ b/WebWindowComplex/Json/JsonUtility.cs @@ -3,6 +3,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; using Newtonsoft.Json.Serialization; +using WebWindowComplex.Models; using static WebWindowComplex.Json.WindowConst; namespace WebWindowComplex.Json diff --git a/WebWindowComplex/Window.cs b/WebWindowComplex/Models/Window.cs similarity index 99% rename from WebWindowComplex/Window.cs rename to WebWindowComplex/Models/Window.cs index 2ddbd63..c2de926 100644 --- a/WebWindowComplex/Window.cs +++ b/WebWindowComplex/Models/Window.cs @@ -13,7 +13,7 @@ using WebWindowComplex.Json; using static WebWindowComplex.Json.WindowConst; using static WebWindowComplex.ParametriOpzioni; -namespace WebWindowComplex +namespace WebWindowComplex.Models { public class Window diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index 2d45657..736fbd4 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -1,14 +1,10 @@ using Egw.Window.Data; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Web; -using Microsoft.Net.Http.Headers; using Newtonsoft.Json; -using Newtonsoft.Json.Linq; using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; -using System.Runtime.InteropServices; using WebWindowComplex.DTO; using WebWindowComplex.Json; +using WebWindowComplex.Models; using static WebWindowComplex.Json.WindowConst; namespace WebWindowComplex diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index e8aec1a..1ad4c53 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -51,3 +51,6 @@ + + + diff --git a/WebWindowComplex/_Imports.razor b/WebWindowComplex/_Imports.razor index 7728512..123a7e8 100644 --- a/WebWindowComplex/_Imports.razor +++ b/WebWindowComplex/_Imports.razor @@ -1 +1,3 @@ @using Microsoft.AspNetCore.Components.Web +@using WebWindowComplex +@using WebWindowComplex.Models \ No newline at end of file diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index df94faa..d08ba87 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -63,6 +63,14 @@ + + + + + + + + From c5003bd6440ba5edcbd525643e4e470fb08f6131 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 10 Oct 2025 16:58:14 +0200 Subject: [PATCH 05/23] Inizio spacchettamento file window delle classi di base del modello --- WebWindowComplex/Models/Area.cs | 264 ++ WebWindowComplex/Models/Fill.cs | 117 + WebWindowComplex/Models/Frame.cs | 397 +++ WebWindowComplex/Models/FrameDimension.cs | 107 + WebWindowComplex/Models/Joint.cs | 123 + WebWindowComplex/Models/Sash.cs | 801 ++++++ WebWindowComplex/Models/SashDimension.cs | 326 +++ WebWindowComplex/Models/Split.cs | 471 ++++ WebWindowComplex/Models/SplitDimension.cs | 177 ++ WebWindowComplex/Models/Splitted.cs | 57 + WebWindowComplex/Models/Window.cs | 2463 ----------------- WebWindowComplex/WebWindowComplex.csproj | 4 +- .../WebWindowConfigurator.csproj | 3 + 13 files changed, 2846 insertions(+), 2464 deletions(-) create mode 100644 WebWindowComplex/Models/Area.cs create mode 100644 WebWindowComplex/Models/Fill.cs create mode 100644 WebWindowComplex/Models/Frame.cs create mode 100644 WebWindowComplex/Models/FrameDimension.cs create mode 100644 WebWindowComplex/Models/Joint.cs create mode 100644 WebWindowComplex/Models/Sash.cs create mode 100644 WebWindowComplex/Models/SashDimension.cs create mode 100644 WebWindowComplex/Models/Split.cs create mode 100644 WebWindowComplex/Models/SplitDimension.cs create mode 100644 WebWindowComplex/Models/Splitted.cs diff --git a/WebWindowComplex/Models/Area.cs b/WebWindowComplex/Models/Area.cs new file mode 100644 index 0000000..8cac943 --- /dev/null +++ b/WebWindowComplex/Models/Area.cs @@ -0,0 +1,264 @@ +using WebWindowComplex.Json; +using static WebWindowComplex.Json.WindowConst; + +namespace WebWindowComplex.Models +{ + public abstract class Area + { + #region Public Constructors + + public Area(Area ParentArea, Window ParentWindow) + { + m_ParentWindow = ParentWindow; + m_ParentArea = ParentArea; + } + + #endregion Public Constructors + + #region Public Properties + + public static int nCounterGroup + { + get => m_CounterGroup; + set => m_CounterGroup = value; + } + + public List AreaList + { + get + { + return m_AreaList; + } + set + { + m_AreaList = value; + } + } + + public AreaTypes AreaType + { + get + { + return m_AreaType; + } + set + { + m_AreaType = value; + } + } + + public int IdGroup + { + get + { + return m_IdGroup; + } + + set + { + m_IdGroup = value; + } + } + + public int nAreaId + { + get + { + return m_nAreaId; + } + set + { + m_nAreaId = value; + m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); + } + } + + public Area ParentArea + { + get + { + return m_ParentArea; + } + } + + public Window ParentWindow + { + get + { + return m_ParentWindow; + } + } + + #endregion Public Properties + + #region Public Methods + + public static void AddCounterGroup() + { + m_CounterGroup++; + } + + public bool AddFirstSash() + { + bool answ = false; + // Salvo il parent + Area ParentArea = AreaList[0].ParentArea; + // Creo area sash di default + Sash SashArea = Sash.CreateSash(ParentArea); + // 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) + { + // seleziono la famiglia del primo hw trovato... + SashArea.SelFamilyHardware = listHwValid.FamilyName; + SashArea.RefreshHardwareList(); + if (SashArea.HardwareList.Count == 0) + { + SashArea.Remove(); + answ = 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) + { + // Inserisco il riempimento precedente + AreaList[0].AreaList.Add(ContentArea[0]); + AreaList[0].AreaList[0].SetParentArea(AreaList[0]); + } + else + { + // 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()); + } + } + return answ; + } + + public void AddSplit(Area ParentArea) + { + List ContentArea = new List(); + // Salvo gli oggetti già presenti e li cancello da AreaList + ContentArea.Add(AreaList[0]); + AreaList.Remove(AreaList[0]); + // Aggiungo Area split di default + Split SplitArea = Split.CreateSplit(this, SplitShapes.HORIZONTAL); + // imposto i parametri di default + SplitArea.SetSplitQtyHoriz(1); + SplitArea.SetSplitStartVert(false); + // Aggiungo area + AreaList.Add(SplitArea); + // Creo le due aree Splitted + List newSplittedList = new List(); + for (int i = 0; i < 2; i++) + newSplittedList.Add(Splitted.CreateSplitted(SplitArea)); + // Inserisco nelle aree Splitted il Fill salvato e un Fill uguale (e setto ParentArea del fill) + ContentArea[0].SetParentArea(newSplittedList[0]); + newSplittedList[0].AreaList.Add(ContentArea[0]); + if (ContentArea[0] is Fill) + { + Fill fill1 = (Fill)ContentArea[0]; + Fill fill2 = Fill.CreateFill(newSplittedList[1], fill1.FillType); + newSplittedList[1].AreaList.Add(fill2); + } + else + { + Fill fill2 = Fill.CreateFill(newSplittedList[1], FillTypes.GLASS); + newSplittedList[1].AreaList.Add(fill2); + } + // All'area Split aggiunto le due aree Splitted + for (int i = 0; i < 2; i++) + AreaList[0].AreaList.Add(newSplittedList[i]); + ParentWindow.OnUpdatePreview(ParentWindow.sSerialized()); + } + + public abstract Area Copy(Area ParentArea); + + public void SetIdGroup(int nIdGroup) + { + m_IdGroup = nIdGroup; + } + + public void SwapAree() + { + Area tempArea; + if (this is Sash || this is Split) + { + tempArea = AreaList[0]; + AreaList[0] = AreaList[1]; + AreaList[1] = tempArea; + } + } + + #endregion Public Methods + + #region Internal Methods + + internal abstract JsonArea Serialize(); + + internal void SetAreaType(AreaTypes AreaType) + { + m_AreaType = AreaType; + } + + internal void SetParentArea(Area ParentArea) + { + m_ParentArea = ParentArea; + } + + #endregion Internal Methods + + #region Protected Fields + + protected int m_nAreaId = -1; + + protected Window m_ParentWindow; + + #endregion Protected Fields + + #region Private Fields + + // Conteggio dei macro elementi + private static int m_CounterGroup = 0; + + private List m_AreaList = new List(); + private AreaTypes m_AreaType; + private int m_IdGroup; + private Area m_ParentArea; + + #endregion Private Fields + + #region Private Methods + + /// + /// MockUp chiamata a c++ x scelta forma sash per Hw + /// + /// + private string FindSashShape() + { + return "Rectangular"; + } + + #endregion Private Methods + } +} \ No newline at end of file diff --git a/WebWindowComplex/Models/Fill.cs b/WebWindowComplex/Models/Fill.cs new file mode 100644 index 0000000..2651fa4 --- /dev/null +++ b/WebWindowComplex/Models/Fill.cs @@ -0,0 +1,117 @@ +using WebWindowComplex.Json; +using static WebWindowComplex.Json.WindowConst; + +namespace WebWindowComplex.Models +{ + public class Fill : Area + { + #region Public Constructors + + public Fill(Area ParentArea, Window ParentWindow) : base(ParentArea, ParentWindow) + { + } + + #endregion Public Constructors + + #region Public Properties + + public FillTypes FillType + { + get + { + return (FillTypes)m_SelFillType; + } + } + + public List FillTypeList + { + get + { + return m_FillTypeList; + } + } + + public FillTypes SelFillType + { + get + { + return m_SelFillType; + } + set + { + m_SelFillType = value; + } + } + + public int SelFillTypeIndex + { + get + { + return IdNameStruct.IndFromId((int)m_SelFillType, m_FillTypeList); + } + set + { + m_SelFillType = (FillTypes)IdNameStruct.IdFromInd(value, m_FillTypeList); + m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); + } + } + + #endregion Public Properties + + #region Public Methods + + public override Fill Copy(Area newParentArea) + { + Fill newFill = new Fill(newParentArea, m_ParentWindow); + AddCounterGroup(); + newFill.SetIdGroup(nCounterGroup); + newFill.SetFillType(SelFillType); + newFill.SetAreaType(AreaType); + return newFill; + } + + #endregion Public Methods + + #region Internal Methods + + internal static Fill CreateFill(Area AreaParent, FillTypes FillType) + { + Fill Fill = new Fill(AreaParent, AreaParent.ParentWindow); + AddCounterGroup(); + Fill.SetIdGroup(nCounterGroup); + Fill.SetAreaType(AreaTypes.FILL); + Fill.SetFillType(FillType); + return Fill; + } + + internal override JsonArea Serialize() + { + if (nCounterGroup < IdGroup) + Area.nCounterGroup = IdGroup; + JsonFill JsonFill = new JsonFill(FillType, IdGroup); + foreach (var Area in AreaList) + JsonFill.AreaList.Add(Area.Serialize()); + return JsonFill; + } + + internal void SetFillType(FillTypes value) + { + m_SelFillType = value; + m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); + } + + #endregion Internal Methods + + #region Private Fields + + private List m_FillTypeList = new List + { + new IdNameStruct((int)FillTypes.GLASS, "SvgPreview"), + new IdNameStruct((int)FillTypes.WOOD, "Wood") + }; + + private FillTypes m_SelFillType; + + #endregion Private Fields + } +} \ No newline at end of file diff --git a/WebWindowComplex/Models/Frame.cs b/WebWindowComplex/Models/Frame.cs new file mode 100644 index 0000000..0e8e266 --- /dev/null +++ b/WebWindowComplex/Models/Frame.cs @@ -0,0 +1,397 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WebWindowComplex.Json; +using static WebWindowComplex.Json.WindowConst; + +namespace WebWindowComplex.Models +{ + public class Frame : Area + { + #region Public Constructors + + public Frame(Area ParentArea, Window ParentWindow) : base(ParentArea, ParentWindow) + { + } + + #endregion Public Constructors + + #region Public Properties + + public bool BottomRail + { + get + { + return m_bBottomRail; + } + set + { + m_bBottomRail = value; + m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); + } + } + + public int BottomRailQty + { + get + { + return m_nBottomRailQty; + } + set + { + if (m_nBottomRailQty >= 0) + { + m_nBottomRailQty = value; + if (m_nBottomRailQty > 0) + { + m_bBottomRail = true; + } + else + { + m_bBottomRail = false; + } + } + m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); + } + } + + public List DimensionList + { + get + { + return m_DimensionList; + } + } + + public List JointList + { + get + { + return m_JointList; + } + set + { + m_JointList = value; + } + } + + public int SelShapeIndex + { + get + { + return IdNameStruct.IndFromId((int)m_Shape, m_ShapeList); + } + set + { + Shapes SelShape = (Shapes)IdNameStruct.IdFromInd(value, m_ShapeList); + if (m_Shape != SelShape) + { + // verifico parametri Dimension + DimensionList.Clear(); + // 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, 2, "Height", 1800, true)); + break; + } + + case Shapes.RIGHTCHAMFER: + { + DimensionList.Add(new FrameDimension(this, 1, "Width", 1500, true)); + DimensionList.Add(new FrameDimension(this, 2, "Left Height", 1800, true)); + DimensionList.Add(new FrameDimension(this, 3, "Right Height", 1500, true)); + break; + } + + case Shapes.LEFTCHAMFER: + { + DimensionList.Add(new FrameDimension(this, 1, "Width", 1500, true)); + DimensionList.Add(new FrameDimension(this, 2, "Left Height", 1500, true)); + DimensionList.Add(new FrameDimension(this, 3, "Right Height", 1800, true)); + break; + } + + case Shapes.DOUBLECHAMFER: + case Shapes.ARC: + { + DimensionList.Add(new FrameDimension(this, 1, "Width", 1500, true)); + DimensionList.Add(new FrameDimension(this, 2, "Height", 1500, true)); + DimensionList.Add(new FrameDimension(this, 3, "Full Height", 1800, true)); + break; + } + + case Shapes.DOUBLEARC: + { + DimensionList.Add(new FrameDimension(this, 1, "Width", 1500, true)); + DimensionList.Add(new FrameDimension(this, 2, "Height", 1500, true)); + DimensionList.Add(new FrameDimension(this, 3, "Full Height", 2400, true)); + break; + } + + case Shapes.TRIANGLE: + { + DimensionList.Add(new FrameDimension(this, 1, "Width", 2000, true)); + DimensionList.Add(new FrameDimension(this, 2, "Height", 1500, true)); + DimensionList.Add(new FrameDimension(this, 3, "Height projection", 0, true)); + break; + } + + case Shapes.CUSTOM: + { + DimensionList.Clear(); + break; + } + } + // salvo tipo Joint + Joints oldJointType = JointList[0].SelJointType; + // aggiungo Joint + m_JointList.Clear(); + switch (SelShape) + { + case Shapes.RECTANGLE: + case Shapes.RIGHTCHAMFER: + case Shapes.LEFTCHAMFER: + case Shapes.DOUBLECHAMFER: + 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)); + break; + } + + case Shapes.ARC_FULL: + { + JointList.Add(new Joint(this, 1, oldJointType)); + JointList.Add(new Joint(this, 2, oldJointType)); + JointList.Add(new Joint(this, 3, Joints.ANGLED)); + JointList.Add(new Joint(this, 4, Joints.ANGLED)); + break; + } + + case Shapes.TRIANGLE: + { + JointList.Add(new Joint(this, 1, oldJointType)); + JointList.Add(new Joint(this, 2, oldJointType)); + JointList.Add(new Joint(this, 3, Joints.ANGLED)); + break; + } + + case Shapes.CUSTOM: + { + JointList.Clear(); + break; + } + } + m_Shape = SelShape; + } + m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); + } + } + + public Shapes Shape + { + get + { + return m_Shape; + } + } + + public List ShapeList + { + get + { + return m_ShapeList; + } + } + + #endregion Public Properties + + #region Public Methods + + public override Frame Copy(Area ParentArea) + { + return null; + } + + #endregion Public Methods + + #region Internal Methods + + internal static Area CreateFrame(Window Window) + { + Frame NewFrame = new Frame(null, Window); + NewFrame.SetAreaType(AreaTypes.FRAME); + NewFrame.SetSelShape(Shapes.RECTANGLE); + NewFrame.SetBottomRail(false); + NewFrame.SetBottomRailQty(0); + return NewFrame; + } + + internal override JsonArea Serialize() + { + Area.nCounterGroup = 0; + if (nCounterGroup < IdGroup) + Area.nCounterGroup = IdGroup; + JsonFrame JsonFrame = new JsonFrame(m_Shape, m_bBottomRail, m_nBottomRailQty, IdGroup); + foreach (var Dimension in DimensionList) + JsonFrame.DimensionList.Add(Dimension.Serialize()); + foreach (var Joint in JointList) + JsonFrame.JointList.Add(Joint.Serialize()); + foreach (var Area in AreaList) + JsonFrame.AreaList.Add(Area.Serialize()); + return JsonFrame; + } + + internal void SetBottomRail(bool bBottomRail) + { + m_bBottomRail = bBottomRail; + } + + internal void SetBottomRailQty(int nBottomRailQty) + { + m_nBottomRailQty = nBottomRailQty; + } + + internal void SetSelShape(Shapes Value) + { + DimensionList.Clear(); + // aggiungo Dimension + switch (Value) + { + case Shapes.RECTANGLE: + case Shapes.ARC_FULL: + { + DimensionList.Add(new FrameDimension(this, 1, "Width", 1500, 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, 2, "Left Height", 1800, true)); + DimensionList.Add(new FrameDimension(this, 3, "Right Height", 1500, true)); + break; + } + + case Shapes.LEFTCHAMFER: + { + DimensionList.Add(new FrameDimension(this, 1, "Width", 1500, true)); + DimensionList.Add(new FrameDimension(this, 2, "Left Height", 1500, true)); + DimensionList.Add(new FrameDimension(this, 3, "Right Height", 1800, true)); + break; + } + + case Shapes.DOUBLECHAMFER: + case Shapes.ARC: + { + DimensionList.Add(new FrameDimension(this, 1, "Width", 1500, true)); + DimensionList.Add(new FrameDimension(this, 2, "Height", 1500, true)); + DimensionList.Add(new FrameDimension(this, 3, "Full Height", 1800, true)); + break; + } + + case Shapes.DOUBLEARC: + { + DimensionList.Add(new FrameDimension(this, 1, "Width", 1500, true)); + DimensionList.Add(new FrameDimension(this, 2, "Height", 1500, true)); + DimensionList.Add(new FrameDimension(this, 3, "Full Height", 2400, true)); + break; + } + + case Shapes.TRIANGLE: + { + DimensionList.Add(new FrameDimension(this, 1, "Width", 2000, true)); + DimensionList.Add(new FrameDimension(this, 2, "Height", 1500, true)); + DimensionList.Add(new FrameDimension(this, 3, "Height projection", 0, true)); + break; + } + + case Shapes.CUSTOM: + { + DimensionList.Clear(); + break; + } + } + // aggiungo Joint + //int nJointQty = 4; + switch (Value) + { + case Shapes.RECTANGLE: + case Shapes.RIGHTCHAMFER: + case Shapes.LEFTCHAMFER: + case Shapes.DOUBLECHAMFER: + case Shapes.ARC: + case Shapes.DOUBLEARC: + { + JointList.Add(new Joint(this, 1, Joints.FULL_H)); + JointList.Add(new Joint(this, 2, Joints.FULL_H)); + JointList.Add(new Joint(this, 3, Joints.FULL_H)); + JointList.Add(new Joint(this, 4, Joints.FULL_H)); + break; + } + + case Shapes.ARC_FULL: + { + JointList.Add(new Joint(this, 1, Joints.FULL_H)); + JointList.Add(new Joint(this, 2, Joints.FULL_H)); + JointList.Add(new Joint(this, 3, Joints.ANGLED)); + JointList.Add(new Joint(this, 4, Joints.ANGLED)); + break; + } + + case Shapes.TRIANGLE: + { + JointList.Add(new Joint(this, 1, Joints.FULL_H)); + JointList.Add(new Joint(this, 2, Joints.FULL_H)); + JointList.Add(new Joint(this, 3, Joints.ANGLED)); + break; + } + + case Shapes.CUSTOM: + { + JointList.Clear(); + break; + } + } + m_Shape = Value; + } + + #endregion Internal Methods + + #region Private Fields + + private bool m_bBottomRail; + + private List m_DimensionList = new List(); + + private List m_JointList = new List(); + + private int m_nBottomRailQty = 0; + + private Shapes m_Shape; + + private List m_ShapeList = new List + { + new IdNameStruct((int)Shapes.RECTANGLE, "Rectangle"), + new IdNameStruct((int)Shapes.RIGHTCHAMFER, "Right Chamfer"), + new IdNameStruct((int)Shapes.LEFTCHAMFER, "Left Chamfer"), + new IdNameStruct((int)Shapes.DOUBLECHAMFER, "Double Chamfer"), + new IdNameStruct((int)Shapes.ARC, "Arc"), + new IdNameStruct((int)Shapes.ARC_FULL, "Arc Full"), + new IdNameStruct((int)Shapes.DOUBLEARC, "Double Arc"), + new IdNameStruct((int)Shapes.TRIANGLE, "Triangle") + }; + + #endregion Private Fields + } +} \ No newline at end of file diff --git a/WebWindowComplex/Models/FrameDimension.cs b/WebWindowComplex/Models/FrameDimension.cs new file mode 100644 index 0000000..6028b5d --- /dev/null +++ b/WebWindowComplex/Models/FrameDimension.cs @@ -0,0 +1,107 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WebWindowComplex.Json; + +namespace WebWindowComplex.Models +{ + public class FrameDimension + { + #region Public Constructors + + public FrameDimension(Frame ParentFrame, int nIndex, string sName, double dValue, bool bIsLen) + { + m_ParentFrame = ParentFrame; + m_nIndex = nIndex; + m_sName = sName; + m_dValue = dValue; + m_bIsLen = bIsLen; + } + + #endregion Public Constructors + + #region Public Properties + + public double dValue + { + get + { + return m_dValue; + } + set + { + m_dValue = value; + if (value > MaxDim) + { + m_dValue = MaxDim; + } + else if (value < MinDim) + { + m_dValue = MinDim; + } + m_ParentFrame.ParentWindow.OnUpdatePreview(m_ParentFrame.ParentWindow.sSerialized()); + } + } + + public int nIndex + { + get + { + return m_nIndex; + } + } + + public Frame ParentFrame + { + get + { + return m_ParentFrame; + } + } + + public string sName + { + get + { + return m_sName; + } + } + + #endregion Public Properties + + #region Internal Methods + + internal JsonFrameDimension Serialize() + { + JsonFrameDimension JsonFrameDimension = new JsonFrameDimension(m_nIndex, m_sName, m_dValue); + return JsonFrameDimension; + } + + #endregion Internal Methods + + #region Protected Fields + + protected Frame m_ParentFrame; + + #endregion Protected Fields + + #region Private Fields + + private bool m_bIsLen = false; + + private double m_dValue; + + private int m_nIndex; + + private string m_sName; + + // valore massimo e minimo della dimensione del frame + private int MaxDim = 4000; + + private int MinDim = 600; + + #endregion Private Fields + } +} \ No newline at end of file diff --git a/WebWindowComplex/Models/Joint.cs b/WebWindowComplex/Models/Joint.cs new file mode 100644 index 0000000..cf67dd9 --- /dev/null +++ b/WebWindowComplex/Models/Joint.cs @@ -0,0 +1,123 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WebWindowComplex.Json; +using static WebWindowComplex.Json.WindowConst; + +namespace WebWindowComplex.Models +{ + public class Joint + { + #region Public Constructors + + public Joint(Area ParentArea, int nIndex, Joints SelJointType) + { + m_ParentArea = ParentArea; + m_nIndex = nIndex; + m_SelJointType = SelJointType; + } + + #endregion Public Constructors + + #region Public Properties + + public List JointTypeList + { + get + { + return m_JointTypeList; + } + } + + public int nIndex + { + get + { + return m_nIndex; + } + } + + public Area ParentArea + { + get + { + return m_ParentArea; + } + } + + public Joints SelJointType + { + get + { + return m_SelJointType; + } + set + { + m_SelJointType = value; + } + } + + public int SelJointTypeIndex + { + get + { + return IdNameStruct.IndFromId((int)m_SelJointType, m_JointTypeList); + } + set + { + m_SelJointType = (Joints)IdNameStruct.IdFromInd(value, m_JointTypeList); + m_ParentArea.ParentWindow.OnUpdatePreview(m_ParentArea.ParentWindow.sSerialized()); + } + } + + #endregion Public Properties + + #region Public Methods + + public Joint Copy() + { + Joint newJoint = new Joint(ParentArea, nIndex, SelJointType); + return newJoint; + } + + #endregion Public Methods + + #region Internal Methods + + internal JsonJoint Serialize() + { + JsonJoint JsonJoint = new JsonJoint(m_nIndex, m_SelJointType); + return JsonJoint; + } + + internal void SetSelJointType(Joints value) + { + m_SelJointType = value; + //NotifyPropertyChanged(nameof(SelJointTypeIndex)); + } + + #endregion Internal Methods + + #region Protected Fields + + protected Area m_ParentArea; + + #endregion Protected Fields + + #region Private Fields + + private List m_JointTypeList = new List + { + new IdNameStruct((int)Joints.ANGLED, "Angled"), + new IdNameStruct((int)Joints.FULL_H, "Full H"), + new IdNameStruct((int)Joints.FULL_V, "Full V") + }; + + private int m_nIndex; + private Joints m_SelJointType; + + #endregion Private Fields + } +} \ No newline at end of file diff --git a/WebWindowComplex/Models/Sash.cs b/WebWindowComplex/Models/Sash.cs new file mode 100644 index 0000000..83af86a --- /dev/null +++ b/WebWindowComplex/Models/Sash.cs @@ -0,0 +1,801 @@ +using Egw.Window.Data; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WebWindowComplex.Json; +using static WebWindowComplex.Json.WindowConst; + +namespace WebWindowComplex.Models +{ + public class Sash : Area + { + #region Public Fields + + // Lista hardware completa passata dal chiamante del componente + public static List m_HardwareCompleteList = new List(); + + // Lista hardware completa passata dal chiamante del componente + public static List s_FamilyHardwareList = new List(); + + #endregion Public Fields + + #region Public Constructors + + public Sash(Area ParentArea, Window ParentWindow) : base(ParentArea, ParentWindow) + { + } + + #endregion Public Constructors + + #region Public Properties + + public bool bIsMeasureGlass + { + get + { + return m_bIsMeasureGlass; + } + set + { + m_bIsMeasureGlass = value; + } + } + + public bool bIsPercentage + { + get + { + return m_bIsPercentage; + } + } + + public bool bIsSashVertical + { + get + { + return m_bIsSashVertical; + } + set + { + m_bIsSashVertical = value; + } + } + + public List HardwareList + { + get + { + return m_HardwareList; + } + } + + public List HwdOptionList + { + get + { + return m_HwdOptionList; + } + } + + public List JointList + { + get + { + return m_JointList; + } + set + { + m_JointList = value; + } + } + + public int nSashQty + { + get + { + return m_SashList.Count > 0 ? m_SashList.Count : 1; + } + set + { + if (value >= 0 && value <= 4) + { + if (value > m_SashList.Count) + { + // recupero larghezza ultimo + double dLastDimension = 100; + double dNewDimension = 100; + if (m_SashList.Count > 0) + { + dLastDimension = m_SashList[m_SashList.Count - 1].dDimension; + dNewDimension = dLastDimension / (value + 1 - nSashQty); + m_SashList[m_SashList.Count - 1].SetDimension(dNewDimension); + } + else + dNewDimension = dLastDimension / (value + 1 - nSashQty); + // aggiungo area Sash di default + for (var SplitIndex = m_SashList.Count; SplitIndex <= value - 1; SplitIndex++) + { + SashList.Add(new SashDimension(dNewDimension, true, this, SplitIndex + 1)); + } + } + else if (value < m_SashList.Count) + { + if (value > 0) + { + double dLastDimension = 0; + for (var SplitIndex = m_SashList.Count - 1; SplitIndex >= value; SplitIndex += -1) + { + dLastDimension += m_SashList[SplitIndex].dDimension; + SashList.RemoveAt(SplitIndex); + } + dLastDimension += m_SashList[SashList.Count - 1].dDimension; + SashList[SashList.Count - 1].SetDimension(dLastDimension); + if (value == 1) + SashList[0].SetHasHandle(true); + } + else + { + SashList.RemoveAt(0); + } + } + if (m_SashList.Count == 0) + { + Area child = AreaList[0]; + // Se nella singola anta ho uno split + if (!(child is Fill)) + { + child = child.AreaList[0].AreaList[0]; + } + child.SetParentArea(this.ParentArea); + this.ParentArea.AreaList.Remove(this); + this.ParentArea.AreaList.Add(child); + } + // Se ho singola anta + else if (m_SashList.Count == 1) + { + // Metto come padre dell'area nello splitted l'anta stessa + List ContentArea = new List(); + ContentArea.Add(AreaList[0].AreaList[0]); + ContentArea[0].SetParentArea(this); + AreaList.Clear(); + AreaList.Add(ContentArea[0]); + } + else + { + // Se aggiungo ante + if (SashList.Count > AreaList.Count) + { + List ContentArea = new List(); + // Salvo in ContentArea il sottoalbero delle singole aree che mantengo + if (AreaList.Count >= 1 & SashList.Count > AreaList.Count) + { + foreach (Area area in AreaList) + { + if (area is Splitted) + ContentArea.Add(area.AreaList[0]); + else + ContentArea.Add(area); + } + AreaList.Clear(); + } + for (int SplitIndex = AreaList.Count; SplitIndex <= SashList.Count - 1; SplitIndex++) + { + AreaList.Add(Splitted.CreateSplitted(this)); + } + // Riaggiungo i sottoalberi che avevo salvato + for (int i = 0; i < AreaList.Count - 1; i++) + { + if (AreaList.Count == 2) + { + ContentArea[i].SetParentArea(AreaList[i]); + } + AreaList[i].AreaList.Add(ContentArea[i]); + } + // Aggiungo all'ultimo Splitted l'area di vetro + Fill newFill = Fill.CreateFill(AreaList[1], FillTypes.GLASS); + //Fill newFill = new Fill(AreaList[1], ParentWindow); + //newFill.SetFillType(FillTypes.GLASS); + newFill.SetAreaType(AreaTypes.FILL); + AreaList[AreaList.Count - 1].AreaList.Add(newFill); + } + // Se tolgo anta + else + { + for (int SplitIndex = SashList.Count; SplitIndex <= AreaList.Count() - 1; SplitIndex++) + { + AreaList.Remove(AreaList[AreaList.Count - 1]); + break; + } + } + } + } + RefreshHardwareList(); + RefreshHardwareOptionList(); + SetFirstHardware(); + m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); + } + } + + public OrientationSash OrientationSashType + { + get + { + return (OrientationSash)m_SelOrientationSashType; + } + } + + public List OrientationSashTypeList + { + get + { + return m_OrientationSashTypeList; + } + } + + public bool SashBottomRail + { + get + { + return m_bSashBottomRail; + } + set + { + m_bSashBottomRail = value; + } + } + + public int SashBottomRailQty + { + get + { + return m_nSashBottomRailQty; + } + set + { + // Controllo che il valore inserito sia positivo + if (value >= 0) + { + m_nSashBottomRailQty = value; + if (m_nSashBottomRailQty > 0) + { + m_bSashBottomRail = true; + } + else + { + m_bSashBottomRail = false; + } + m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); + } + } + } + + public List SashList + { + get + { + return m_SashList; + } + set + { + m_SashList = value; + } + } + + public SashTypes SashType + { + get + { + return m_SashType; + } + set + { + m_SashType = value; + } + } + + public string SelFamilyHardware + { + get + { + return m_SelFamilyHardware; + } + set + { + m_SelFamilyHardware = value; + RefreshHardwareList(); + RefreshHardwareOptionList(); + SetFirstHardware(); + m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); + } + } + + public Hardware SelHardware + { + get + { + return m_SelHardware; + } + set + { + m_SelHardware = value; + // if (m_SelHardware != null && m_SelHardware.sId != "000000") + // { + // string sHwdOptPath = ""; + // var gf = EgtLuaCreateGlobTable("WDG"); + // var tft = EgtLuaSetGlobIntVar("WDG.AREAID", m_nAreaId); + // var tfy = EgtLuaSetGlobStringVar("WDG.HDWFAVOURITE", value.sId); + // SashDimension HandleSash = m_SashList.FirstOrDefault(x => x.bHasHandle); + // string sHandle = "Dx"; + // switch (GetOpeningSide(HandleSash.OpeningType)) + // { + // case object _ when OpeningSides.LEFT: + // { + // sHandle = "Sx"; + // break; + // } + + // case object _ when OpeningSides.RIGHT: + // { + // sHandle = "Dx"; + // break; + // } + // } + // var tfd = EgtLuaSetGlobStringVar("WDG.HDWHANDLE", sHandle); + // var tlt = EgtLuaCallFunction("WinCreate_GetHardwareOptionPath"); + // var tltf = EgtLuaGetGlobStringVar("WDG.HWDOPTPATH", sHwdOptPath); + // if (!string.IsNullOrWhiteSpace(sHwdOptPath)) + // { + // XmlSerializer serializer = new XmlSerializer(typeof(ParametriOpzioni)); + // ParametriOpzioni HwdOptions = null/* TODO Change to default(_) if this is not a reference type */; + // string sHdwOptPath = Path.ChangeExtension(sHwdOptPath, ".opt"); + // bool bHdwOptFound = false; + // for (var WaitIndex = 0; WaitIndex <= 100; WaitIndex++) + // { + // if (File.Exists(sHdwOptPath)) + // { + // bHdwOptFound = true; + // break; + // } + // System.Threading.Thread.Sleep(100); + // } + // if (bHdwOptFound) + // { + // string sHwdOptText = ""; + // try + // { + // sHwdOptText = File.ReadAllText(sHdwOptPath); + // } + // catch (Exception ex) + // { + // EgtOutLog("Hardware file opt not found or read!"); + // } + // if (!string.IsNullOrWhiteSpace(sHwdOptText)) + // { + // using (TextReader reader = new StringReader(sHwdOptText)) + // { + // HwdOptions = serializer.Deserialize(reader); + // } + // if (!IsNothing(HwdOptions)) + // { + // m_HwdOptionList.Clear(); + // foreach (var HdwOption in HwdOptions.Items) + // m_HwdOptionList.Add(new AGBOption(HdwOption)); + // NotifyPropertyChanged(nameof(HwdOptionList)); + // } + // } + // } + // var ud = EgtLuaResetGlobVar("WDG"); + // } + // } + } + } + + public string SelHardwareFromId + { + get + { + return m_SelHardware.Id; + } + set + { + m_SelHardware = m_HardwareList.FirstOrDefault(x => !string.IsNullOrEmpty(value) && x.Id.Equals(value)) ?? new Hardware("", "", "", Enums.OpeningTypes.Null, "", 0, 0); + ParentWindow.OnUpdatePreview(ParentWindow.sSerialized()); + } + } + + public OrientationSash SelOrientationSashType + { + get + { + return m_SelOrientationSashType; + } + set + { + m_SelOrientationSashType = value; + } + } + + public int SelOrientationSashTypeIndex + { + get + { + return IdNameStruct.IndFromId((int)m_SelOrientationSashType, m_OrientationSashTypeList); + } + set + { + m_SelOrientationSashType = (OrientationSash)IdNameStruct.IdFromInd(value, m_OrientationSashTypeList); + if (value == 0) + { + m_bIsSashVertical = true; + } + else + { + m_bIsSashVertical = false; + } + m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); + } + } + + #endregion Public Properties + + #region Public Methods + + public override Sash Copy(Area newParentArea) + { + Sash newSash = new Sash(newParentArea, m_ParentWindow); + AddCounterGroup(); + newSash.SetIdGroup(nCounterGroup); + newSash.SetAreaType(AreaType); + // Imposta la quantità di ante e definisce SashDimension di ogni anta ai valori di default + newSash.SetSashQty(nSashQty); + newSash.SetIsSashVertical(bIsSashVertical); + newSash.SetOrientationSashType(OrientationSashType); + newSash.SetSashBottomRailQty(SashBottomRailQty); + newSash.SetSelFamilyHardwareFromIndex(SelHardware.Id); + newSash.RefreshHardwareList(); + newSash.RefreshHardwareOptionList(); + newSash.SetSelHardware(SelHardware); + for (int i = 0; i < SashList.Count; i++) + { + //Cancello SashDimension di default e aggiungo la copia + newSash.SashList.RemoveAt(i); + SashDimension newSashDim = SashList[i].Copy(); + newSash.SashList.Insert(i, newSashDim); + } + foreach (var item in JointList) + { + Joint newJoint = item.Copy(); + newSash.JointList.Add(newJoint); + } + foreach (var item in AreaList) + { + Area newArea = item.Copy(newSash); + newSash.AreaList.Add(newArea); + } + return newSash; + } + + public void RefreshHardwareList() + { + if (m_HardwareCompleteList != null && m_HardwareCompleteList.Count > 0) + { + m_HardwareList.Clear(); + string sSashShape = FindSashShape(); + Enums.OpeningTypes sOpeningType = ConvertOpeningType(); + var iComp = StringComparison.InvariantCultureIgnoreCase; + var rawList = m_HardwareCompleteList + .Where(x => x.Id == "000000" || + (!string.IsNullOrEmpty(m_SelFamilyHardware) && x.FamilyName.Equals(m_SelFamilyHardware, iComp) && x.SashQty == nSashQty && x.Shape.Equals(sSashShape, iComp) && x.OpeningType == sOpeningType) + ) + .ToList(); + if (rawList != null && rawList.Count > 0) + { + m_HardwareList = new List(rawList); + } + else + { + m_HardwareList = new List(); + } + } + } + + public void Remove() + { + ParentArea.AreaList.Remove(this); + Fill newFill = Fill.CreateFill(ParentArea, FillTypes.GLASS); + newFill.SetAreaType(AreaTypes.FILL); + ParentArea.AreaList.Add(newFill); + m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); + } + + #endregion Public Methods + + #region Internal Methods + + internal static Sash CreateSash(Area Area) + { + Sash newSash = new Sash(Area, Area.ParentWindow); + AddCounterGroup(); + newSash.SetIdGroup(nCounterGroup); + newSash.SetAreaType(AreaTypes.SASH); + newSash.SetSashQty(1); + newSash.SetOrientationSashType(OrientationSash.VERTICAL); + newSash.SetIsSashVertical(true); + for (var JointIndex = 0; JointIndex <= 3; JointIndex++) + newSash.JointList.Add(new Joint(newSash, JointIndex + 1, Joints.FULL_H)); + newSash.SetSashBottomRail(false); + newSash.SetSashBottomRailQty(0); + newSash.SelFamilyHardware = Sash.s_FamilyHardwareList.First(); + newSash.RefreshHardwareList(); + newSash.RefreshHardwareOptionList(); + newSash.SetFirstHardware(); + return newSash; + } + + internal OpeningSides GetOpeningSide(Openings OpeningType) + { + switch (OpeningType) + { + case Openings.TURNONLY_LEFT: + case Openings.TILTTURN_LEFT: + case Openings.TILTONLY_TOP: + case Openings.COMPLANARSLIDE_LEFT: + case Openings.LIFTSLIDE_LEFT: + { + return OpeningSides.LEFT; + } + + case Openings.TURNONLY_RIGHT: + case Openings.TILTTURN_RIGHT: + case Openings.TILTONLY_BOTTOM: + case Openings.COMPLANARSLIDE_RIGHT: + case Openings.LIFTSLIDE_RIGHT: + { + return OpeningSides.RIGHT; + } + + default: + { + return OpeningSides.NULL; + } + } + } + + internal Enums.OpeningTypes GetOpeningType(Openings OpeningType) + { + switch (OpeningType) + { + case Openings.TURNONLY_LEFT: + case Openings.TURNONLY_RIGHT: + { + return Enums.OpeningTypes.TurnOnly; + } + + case Openings.TILTTURN_LEFT: + case Openings.TILTTURN_RIGHT: + { + return Enums.OpeningTypes.TiltTurn; + } + + case Openings.TILTONLY_TOP: + case Openings.TILTONLY_BOTTOM: + { + return Enums.OpeningTypes.TiltOnly; + } + + case Openings.PIVOT: + { + return Enums.OpeningTypes.Pivot; + } + + case Openings.FIXED: + { + return Enums.OpeningTypes.Fixed; + } + + case Openings.COMPLANARSLIDE_LEFT: + case Openings.COMPLANARSLIDE_RIGHT: + { + return Enums.OpeningTypes.ComplanarSlide; + } + + case Openings.LIFTSLIDE_LEFT: + case Openings.LIFTSLIDE_RIGHT: + { + return Enums.OpeningTypes.LiftSlide; + } + + default: + { + return Enums.OpeningTypes.Null; + } + } + } + + internal void RefreshHardwareOptionList() + { + m_HwdOptionList.Clear(); + } + + internal override JsonArea Serialize() + { + if (nCounterGroup < IdGroup) + Area.nCounterGroup = IdGroup; + JsonSash JsonSash = new JsonSash(m_bIsSashVertical, m_SashType, m_bSashBottomRail, m_nSashBottomRailQty, m_SelHardware.Id, IdGroup); + foreach (var SashDimension in SashList) + JsonSash.SashList.Add(SashDimension.Serialize()); + foreach (var Joint in JointList) + JsonSash.JointList.Add(Joint.Serialize()); + foreach (var Area in AreaList) + JsonSash.AreaList.Add(Area.Serialize()); + return JsonSash; + } + + internal void SetFirstHardware() + { + if (m_HardwareList.Count > 0) + { + m_SelHardware = m_HardwareList[0]; + } + } + + internal void SetIsMeasureGlass(bool IsMeasureGlass) + { + m_bIsMeasureGlass = IsMeasureGlass; + } + + internal void SetIsSashVertical(bool IsSashVertical) + { + m_bIsSashVertical = IsSashVertical; + if (IsSashVertical) + { + m_SelOrientationSashType = OrientationSash.VERTICAL; + } + else + { + m_SelOrientationSashType = OrientationSash.HORIZONTAL; + } + } + + internal void SetOrientationSashType(OrientationSash value) + { + m_SelOrientationSashType = value; + } + + internal void SetSashBottomRail(bool bBottomRail) + { + m_bSashBottomRail = bBottomRail; + } + + internal void SetSashBottomRailQty(int nBottomRailQty) + { + m_nSashBottomRailQty = nBottomRailQty; + } + + internal void SetSashQty(int Qty) + { + if (Qty >= 0 && Qty <= 4) + { + if (Qty > m_SashList.Count) + { + // recupero larghezza ultimo + double dLastDimension = 100; + double dNewDimension = 100; + if (m_SashList.Count > 0) + { + dLastDimension = m_SashList[m_SashList.Count - 1].dDimension; + dNewDimension = dLastDimension / (Qty + 1 - nSashQty); + m_SashList[m_SashList.Count - 1].dDimension = dNewDimension; + } + else + dNewDimension = dLastDimension / (Qty + 1 - nSashQty); + // aggiungo area Sash di default + for (var SplitIndex = m_SashList.Count; SplitIndex <= Qty - 1; SplitIndex++) + SashList.Add(new SashDimension(dNewDimension, true, this, SplitIndex + 1)); + } + else if (Qty < m_SashList.Count) + { + for (var SplitIndex = m_SashList.Count - 1; SplitIndex >= Qty; SplitIndex += -1) + SashList.RemoveAt(SplitIndex); + } + } + } + + internal void SetSashType(SashTypes SashType) + { + m_SashType = SashType; + } + + internal string SetSelFamilyHardwareFromIndex(string codHardware) + { + if (string.IsNullOrEmpty(m_SelFamilyHardware)) + { + SelFamilyHardware = (m_HardwareCompleteList + .Where(x => x.Id == codHardware) + .First()).FamilyName; + } + return SelFamilyHardware; + } + + internal void SetSelHardware(Hardware value) + { + m_SelHardware = value; + } + + internal void SetSelHardwareFromId(string sId) + { + if (m_HardwareList.Count == 0) + m_SelHardware = m_HardwareCompleteList.FirstOrDefault(x => x.Id.Equals(sId)) ?? new Hardware("", "", "", Enums.OpeningTypes.Null, "", 0, 0); + else + m_SelHardware = m_HardwareList.FirstOrDefault(x => x.Id.Equals(sId)) ?? new Hardware("", "", "", Enums.OpeningTypes.Null, "", 0, 0); + if (m_SelHardware == null) + m_SelHardware = m_HardwareList[0]; + //SelFamilyHardware = m_SelHardware.FamilyName; + } + + #endregion Internal Methods + + #region Private Fields + + private bool m_bIsMeasureGlass; + + private bool m_bIsPercentage = true; + + private bool m_bIsSashVertical; + + private bool m_bSashBottomRail; + + private List m_HardwareList = new List(); + + private List m_HwdOptionList = new List(); + + private List m_JointList = new List(); + + private int m_nSashBottomRailQty; + + private List m_OrientationSashTypeList = new List + { + new IdNameStruct((int)OrientationSash.VERTICAL, "Vertical"), + new IdNameStruct((int)OrientationSash.HORIZONTAL, "Horizontal"), + }; + + private List m_SashList = new List(); + private SashTypes m_SashType; + private string m_SelFamilyHardware; + private Hardware m_SelHardware; + private OrientationSash m_SelOrientationSashType; + + #endregion Private Fields + + #region Private Methods + + private Enums.OpeningTypes ConvertOpeningType() + { + var answ = Enums.OpeningTypes.Null; + if (m_SashList.Count > 1) + { + for (int i = 0; i < m_SashList.Count; i++) + { + if (m_SashList[i].bHasHandle) + { + answ = GetOpeningType(m_SashList[i].OpeningType); + } + } + } + else + { + answ = GetOpeningType(m_SashList[0].OpeningType); + } + return answ; + } + + private string FindSashShape() + { + return "Rectangular"; + } + + #endregion Private Methods + } +} \ No newline at end of file diff --git a/WebWindowComplex/Models/SashDimension.cs b/WebWindowComplex/Models/SashDimension.cs new file mode 100644 index 0000000..cde5c8c --- /dev/null +++ b/WebWindowComplex/Models/SashDimension.cs @@ -0,0 +1,326 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WebWindowComplex.Json; +using static WebWindowComplex.Json.WindowConst; + +namespace WebWindowComplex.Models +{ + public class SashDimension + { + #region Public Constructors + + public SashDimension(double dDimension, bool bIsRelative, Sash Parent, int nSashId) + { + m_dDimension = dDimension; + m_bIsRelative = bIsRelative; + m_Parent = Parent; + m_nSashId = nSashId; + // assengno maniglia + if (Parent.SashList.Count == 0 || !Parent.SashList.Any(x => x.bHasHandle)) + m_bHasHandle = true; + // assegno tipo di anta + if (Parent.SashList.Count == 0) + SetOpeningType(Openings.TILTTURN_LEFT); + else if (Parent.SashList.Count == 1) + { + switch (Parent.SashList[0].OpeningType) + { + case Openings.TURNONLY_LEFT: + { + SetOpeningType(Openings.TURNONLY_RIGHT); + break; + } + + case Openings.TURNONLY_RIGHT: + { + SetOpeningType(Openings.TURNONLY_LEFT); + break; + } + + case Openings.TILTTURN_LEFT: + { + SetOpeningType(Openings.TURNONLY_RIGHT); + break; + } + + case Openings.TILTTURN_RIGHT: + { + SetOpeningType(Openings.TURNONLY_LEFT); + break; + } + + case Openings.TILTONLY_TOP: + { + SetOpeningType(Openings.TILTONLY_BOTTOM); + break; + } + + case Openings.TILTONLY_BOTTOM: + { + SetOpeningType(Openings.TILTONLY_TOP); + break; + } + + case Openings.COMPLANARSLIDE_LEFT: + { + SetOpeningType(Openings.COMPLANARSLIDE_RIGHT); + break; + } + + case Openings.COMPLANARSLIDE_RIGHT: + { + SetOpeningType(Openings.COMPLANARSLIDE_LEFT); + break; + } + + case Openings.LIFTSLIDE_LEFT: + { + SetOpeningType(Openings.LIFTSLIDE_RIGHT); + break; + } + + case Openings.LIFTSLIDE_RIGHT: + { + SetOpeningType(Openings.LIFTSLIDE_LEFT); + break; + } + } + } + else + SetOpeningType(Parent.SashList[Parent.SashList.Count - 1].OpeningType); + } + + #endregion Public Constructors + + #region Public Properties + + public bool bHasHandle + { + get + { + return m_bHasHandle; + } + set + { + m_bHasHandle = value; + m_Parent.ParentWindow.OnUpdatePreview(m_Parent.ParentWindow.sSerialized()); + } + } + + public bool bIsRelative + { + get + { + return m_bIsRelative; + } + } + + public double dDimension + { + get + { + return m_dDimension; + } + set + { + // Controllo che il valore inserito sia compreso tra 0 e 100 + if (value > 0 && value < 100) + { + // se sono in percentuale + if (m_bIsRelative) + { + // verifico se ci sono assoluti + List RelativeDimList = m_Parent.SashList.Where(x => x.bIsRelative).ToList(); + if (RelativeDimList.Count > 0) + { + if (m_Parent.bIsPercentage) + { + int nIndex = RelativeDimList.IndexOf(this); + // se diminuisce dimensione + if (value < m_dDimension) + { + if (nIndex < RelativeDimList.Count - 1) + RelativeDimList[nIndex + 1].SetDimension(RelativeDimList[nIndex + 1].dDimension + (m_dDimension - value)); + else if (RelativeDimList.Count > 1) + RelativeDimList[nIndex - 1].SetDimension(RelativeDimList[nIndex - 1].dDimension + (m_dDimension - value)); + else + { + m_dDimension = 100; + return; + } + } + // se aumenta dimensione + else + { + double dRes = value; + // se non ultima anta + if (nIndex < RelativeDimList.Count - 1) + { + for (var nInd = 0; nInd <= nIndex - 1; nInd++) + dRes += RelativeDimList[nInd].dDimension; + dRes = (100 - dRes) / (RelativeDimList.Count - nIndex - 1); + for (var Ind = nIndex + 1; Ind <= RelativeDimList.Count - 1; Ind++) + RelativeDimList[Ind].SetDimension(dRes); + } + // se ultima anta + else if (RelativeDimList.Count > 1) + { + if (RelativeDimList.Count > 2) + { + for (var Ind = 0; Ind <= nIndex - 2; Ind++) + dRes += RelativeDimList[Ind].dDimension; + } + + //for (var Ind = nIndex + 1; Ind <= RelativeDimList.Count - 1; Ind++) + // dRes += RelativeDimList[Ind].dDimension; + dRes = (100 - dRes); + RelativeDimList[nIndex - 1].SetDimension(dRes); + //for (var nInd = 0; nInd <= nIndex - 1; nInd++) + // RelativeDimList[nInd].SetDimension(dRes); + } + else + { + m_dDimension = 100; + return; + } + } + } + } + } + m_dDimension = value; + m_Parent.ParentWindow.OnUpdatePreview(m_Parent.ParentWindow.sSerialized()); + } + } + } + + public int nSashId + { + get + { + return m_nSashId; + } + } + + public Openings OpeningType + { + get + { + return (Openings)m_SelOpeningType; + } + } + + public List OpeningTypeList + { + get + { + return m_OpeningTypeList; + } + } + + public Openings SelOpeningType + { + get + { + return m_SelOpeningType; + } + set + { + m_SelOpeningType = value; + m_Parent.RefreshHardwareList(); + m_Parent.RefreshHardwareOptionList(); + m_Parent.SetFirstHardware(); + } + } + + public int SelOpeningTypeIndex + { + get + { + return IdNameStruct.IndFromId((int)m_SelOpeningType, m_OpeningTypeList); + } + set + { + m_SelOpeningType = (Openings)IdNameStruct.IdFromInd(value, m_OpeningTypeList); + m_Parent.RefreshHardwareList(); + m_Parent.RefreshHardwareOptionList(); + m_Parent.SetFirstHardware(); + m_Parent.ParentWindow.OnUpdatePreview(m_Parent.ParentWindow.sSerialized()); + } + } + + #endregion Public Properties + + #region Public Methods + + public SashDimension Copy() + { + SashDimension newSashDim = new SashDimension(dDimension, bIsRelative, m_Parent, m_nSashId); + newSashDim.SetOpeningType(SelOpeningType); + newSashDim.SetHasHandle(bHasHandle); + return newSashDim; + } + + #endregion Public Methods + + #region Internal Methods + + internal JsonSashDimension Serialize() + { + JsonSashDimension JsonSashDimension = new JsonSashDimension(OpeningType, m_bHasHandle, m_dDimension, m_nSashId); + return JsonSashDimension; + } + + internal void SetDimension(double dValue) + { + m_dDimension = dValue; + } + + internal void SetHasHandle(bool value) + { + m_bHasHandle = value; + } + + internal void SetOpeningType(Openings value) + { + m_SelOpeningType = value; + } + + #endregion Internal Methods + + #region Private Fields + + private bool m_bHasHandle; + + private bool m_bIsRelative = false; + + private double m_dDimension; + + private int m_nSashId; + + private List m_OpeningTypeList = new List + { + new IdNameStruct((int)Openings.TURNONLY_LEFT, ">"), + new IdNameStruct((int)Openings.TURNONLY_RIGHT, "<"), + new IdNameStruct((int)Openings.TILTTURN_LEFT, ">*"), + new IdNameStruct((int)Openings.TILTTURN_RIGHT, "<*"), + new IdNameStruct((int)Openings.TILTONLY_TOP, "˄"), + new IdNameStruct((int)Openings.TILTONLY_BOTTOM, "˅"), + new IdNameStruct((int)Openings.PIVOT, "◊"), + new IdNameStruct((int)Openings.FIXED, "X"), + new IdNameStruct((int)Openings.COMPLANARSLIDE_LEFT, "-→"), + new IdNameStruct((int)Openings.COMPLANARSLIDE_RIGHT, "←-"), + new IdNameStruct((int)Openings.LIFTSLIDE_LEFT, "┌→"), + new IdNameStruct((int)Openings.LIFTSLIDE_RIGHT, "←┐") + }; + + // reference + private Sash m_Parent; + + private Openings m_SelOpeningType; + + #endregion Private Fields + } +} \ No newline at end of file diff --git a/WebWindowComplex/Models/Split.cs b/WebWindowComplex/Models/Split.cs new file mode 100644 index 0000000..df18735 --- /dev/null +++ b/WebWindowComplex/Models/Split.cs @@ -0,0 +1,471 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WebWindowComplex.Json; +using static WebWindowComplex.Json.WindowConst; + +namespace WebWindowComplex.Models +{ + public class Split : Area + { + #region Public Constructors + + public Split(Area ParentArea, Window ParentWindow) : base(ParentArea, ParentWindow) + { + } + + #endregion Public Constructors + + #region Public Properties + + public bool bIsPercentage + { + get + { + return m_bIsPercentage; + } + } + + public bool bSplitStartVert + { + get + { + return m_bSplitStartVert; + } + set + { + m_bSplitStartVert = value; + m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); + } + } + + public int nSplitQtyHoriz + { + get + { + return m_SplitHorizList.Count > 0 ? m_SplitHorizList.Count - 1 : 0; + } + set + { + if (value == 0) + { + for (var SplitIndex = m_SplitHorizList.Count - 1; SplitIndex >= value; SplitIndex += -1) + m_SplitHorizList.RemoveAt(SplitIndex); + if (nSplitQtyVert == 0) + { + ParentArea.AreaList.Remove(this); + Fill newFill = Fill.CreateFill(ParentArea, FillTypes.GLASS); + newFill.SetAreaType(AreaTypes.FILL); + ParentArea.AreaList.Add(newFill); + } + else + SetSplitShape(SplitShapes.VERTICAL); + } + else + { + // Ricalcolo dimensioni aggiungendo split + if (value > m_SplitHorizList.Count - 1) + { + // recupero larghezza ultimo + double dLastDimension = 100; + double dNewDimension = 100; + if (m_SplitHorizList.Count > 0) + { + dLastDimension = m_SplitHorizList[m_SplitHorizList.Count - 1].dDimension; + dNewDimension = dLastDimension / (value + 1 - nSplitQtyHoriz); + m_SplitHorizList[m_SplitHorizList.Count - 1].SetDimension(dNewDimension); + } + else + dNewDimension = dLastDimension / (value + 1 - nSplitQtyHoriz); + // aggiungo area Split di default + for (var SplitIndex = m_SplitHorizList.Count; SplitIndex <= value; SplitIndex++) + m_SplitHorizList.Add(new SplitDimension(dNewDimension, true, this, false)); + } + // Ricalcolo dimensioni rimuovendo split + else + { + double dLastDimension = 0; + for (var SplitIndex = m_SplitHorizList.Count - 1; SplitIndex >= value + 1; SplitIndex += -1) + { + dLastDimension += m_SplitHorizList[SplitIndex].dDimension; + m_SplitHorizList.RemoveAt(SplitIndex); + } + dLastDimension += m_SplitHorizList[m_SplitHorizList.Count - 1].dDimension; + m_SplitHorizList[m_SplitHorizList.Count - 1].SetDimension(dLastDimension); + } + // Controllo quanti split verticali ci sono + int nVert = m_SplitVertList.Count > 0 ? m_SplitVertList.Count : 1; + // Se aggiungo split devo aggiungere vetro nell'area splitted aggiunta + for (var SplitIndex = AreaList.Count; SplitIndex <= (m_SplitHorizList.Count * nVert) - 1; SplitIndex++) + { + AreaList.Add(Splitted.CreateSplitted(this)); + Fill newFill = Fill.CreateFill(AreaList[SplitIndex], FillTypes.GLASS); + newFill.SetAreaType(AreaTypes.FILL); + AreaList[AreaList.Count - 1].AreaList.Add(newFill); + } + // Se ho più di uno split, elimino l'ultimo + if (AreaList.Count > 2) + { + int nAreaList = AreaList.Count - 1; + for (var SplitIndex = (m_SplitHorizList.Count * nVert); SplitIndex <= nAreaList; SplitIndex++) + { + AreaList.Remove(AreaList[AreaList.Count - 1]); + } + } + // Se elimino l'unico split presente + else + { + Splitted s = (Splitted)AreaList[0]; + s.SetParentArea(ParentArea); + ParentArea.AreaList.Add(s); + ParentArea.AreaList.Remove(this); + } + } + m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); + } + } + + public int nSplitQtyVert + { + get + { + return m_SplitVertList.Count > 0 ? m_SplitVertList.Count - 1 : 0; + } + set + { + if (value == 0) + { + for (var SplitIndex = m_SplitVertList.Count - 1; SplitIndex >= value; SplitIndex += -1) + m_SplitVertList.RemoveAt(SplitIndex); + if (nSplitQtyHoriz == 0) + { + ParentArea.AreaList.Remove(this); + Fill newFill = Fill.CreateFill(ParentArea, FillTypes.GLASS); + newFill.SetAreaType(AreaTypes.FILL); + ParentArea.AreaList.Add(newFill); + } + else + SetSplitShape(SplitShapes.HORIZONTAL); + } + else + { + // Ricalcolo dimensioni aggiungendo split + if (value > m_SplitVertList.Count - 1) + { + // recupero larghezza ultimo + double dLastDimension = 100; + double dNewDimension = 100; + if (m_SplitVertList.Count > 0) + { + dLastDimension = m_SplitVertList[m_SplitVertList.Count - 1].dDimension; + dNewDimension = dLastDimension / (value + 1 - nSplitQtyVert); + m_SplitVertList[m_SplitVertList.Count - 1].SetDimension(dNewDimension); + } + else + dNewDimension = dLastDimension / (value + 1 - nSplitQtyVert); + // aggiungo area Split di default + for (var SplitIndex = m_SplitVertList.Count; SplitIndex <= value; SplitIndex++) + m_SplitVertList.Add(new SplitDimension(dNewDimension, true, this, true)); + } + else if (value == 0) + { + m_SplitVertList.RemoveAt(1); + m_SplitVertList.RemoveAt(0); + } + // Ricalcolo dimensioni rimuovendo split + else + { + double dLastDimension = 0; + for (var SplitIndex = m_SplitVertList.Count - 1; SplitIndex >= value + 1; SplitIndex += -1) + { + dLastDimension += m_SplitVertList[SplitIndex].dDimension; + m_SplitVertList.RemoveAt(SplitIndex); + } + dLastDimension += m_SplitVertList[m_SplitVertList.Count - 1].dDimension; + m_SplitVertList[m_SplitVertList.Count - 1].SetDimension(dLastDimension); + } + // Controllo quanti split orizzontali ci sono + int nHoriz = m_SplitHorizList.Count > 0 ? m_SplitHorizList.Count : 1; + // Se aggiungo split devo aggiungere vetro nell'area splitted aggiunta + for (var SplitIndex = AreaList.Count; SplitIndex <= (m_SplitVertList.Count * nHoriz) - 1; SplitIndex++) + { + AreaList.Add(Splitted.CreateSplitted(this)); + Fill newFill = Fill.CreateFill(AreaList[SplitIndex], FillTypes.GLASS); + newFill.SetAreaType(AreaTypes.FILL); + AreaList[AreaList.Count - 1].AreaList.Add(newFill); + } + // Se ho più di uno split, elimino l'ultimo + if (AreaList.Count > 2) + { + int nAreaList = AreaList.Count - 1; + for (var SplitIndex = (m_SplitVertList.Count * nHoriz); SplitIndex <= nAreaList; SplitIndex++) + { + AreaList.Remove(AreaList[AreaList.Count - 1]); + } + } + // Se elimino l'unico split presente + else + { + Splitted s = (Splitted)AreaList[0]; + s.SetParentArea(ParentArea); + ParentArea.AreaList.Add(s); + ParentArea.AreaList.Remove(this); + } + } + m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); + } + } + + public int SelSplitShapeIndex + { + get + { + return IdNameStruct.IndFromId((int)m_SelSplitShape, m_SplitShapeList); + } + set + { + m_SelSplitShape = (SplitShapes)IdNameStruct.IdFromInd(value, m_SplitShapeList); + // Cancello elementi nello split e azzero quantità orizzontale e verticale + AreaList.Clear(); + SetSplitQtyVert(0); + SetSplitQtyHoriz(0); + if (m_SelSplitShape == SplitShapes.VERTICAL) + { + // Inserisco valori di default + SetSplitQtyVert(1); + SetSplitStartVert(true); + } + else if (m_SelSplitShape == SplitShapes.HORIZONTAL) + { + // Inserisco valori di default + SetSplitQtyHoriz(1); + SetSplitStartVert(false); + } + else + { + // Inserisco valori di default + SetSplitQtyVert(1); + SetSplitQtyHoriz(1); + SetSplitStartVert(true); + } + // Aggiungo area Splitted e vetro + int nVert = m_SplitVertList.Count > 0 ? m_SplitVertList.Count : 1; + int nHoriz = m_SplitHorizList.Count > 0 ? m_SplitHorizList.Count : 1; + for (var SplitIndex = 0; SplitIndex <= (nVert * nHoriz) - 1; SplitIndex++) + { + AreaList.Add(Splitted.CreateSplitted(this)); + Fill newFill = Fill.CreateFill(AreaList[SplitIndex], FillTypes.GLASS); + newFill.SetAreaType(AreaTypes.FILL); + AreaList[SplitIndex].AreaList.Add(newFill); + } + m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); + } + } + + public List SplitHorizList + { + get + { + return m_SplitHorizList; + } + set + { + m_SplitHorizList = value; + } + } + + public List SplitPositionList + { + get + { + return m_SplitPositionList; + } + set + { + m_SplitPositionList = value; + } + } + + public List SplitShapeList + { + get + { + return m_SplitShapeList; + } + } + + public List SplitVertList + { + get + { + return m_SplitVertList; + } + set + { + m_SplitVertList = value; + } + } + + #endregion Public Properties + + #region Public Methods + + public override Split Copy(Area newParentArea) + { + Split newSplit = new Split(newParentArea, ParentWindow); + AddCounterGroup(); + newSplit.SetIdGroup(nCounterGroup); + newSplit.SetSplitStartVert(bSplitStartVert); + newSplit.SetSplitQtyVert(nSplitQtyVert); + newSplit.SetSplitQtyHoriz(nSplitQtyHoriz); + newSplit.SetSplitShape(SelSplitShape, true); + newSplit.SetAreaType(AreaType); + foreach (var item in AreaList) + { + Area a = item.Copy(newSplit); + newSplit.AreaList.Add(a); + } + return newSplit; + } + + public void Remove() + { + ParentArea.AreaList.Remove(this); + Fill newFill = Fill.CreateFill(ParentArea, FillTypes.GLASS); + newFill.SetAreaType(AreaTypes.FILL); + ParentArea.AreaList.Add(newFill); + m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); + } + + #endregion Public Methods + + #region Internal Properties + + internal SplitShapes SelSplitShape + { + get + { + return m_SelSplitShape; + } + } + + #endregion Internal Properties + + #region Internal Methods + + internal static Split CreateSplit(Area Area, SplitShapes SplitShape) + { + Split Split = new Split(Area, Area.ParentWindow); + AddCounterGroup(); + Split.SetIdGroup(nCounterGroup); + Split.SetAreaType(AreaTypes.SPLIT); + Split.SetSplitShape(SplitShape, true); + return Split; + } + + internal override JsonArea Serialize() + { + if (nCounterGroup < IdGroup) + Area.nCounterGroup = IdGroup; + JsonSplit JsonSplit = new JsonSplit(m_SelSplitShape, IdGroup); + //foreach (var SplitPosition in m_SplitPositionList) + // JsonSplit.SplitPositionList.Add(SplitPosition.Serialize()); + JsonSplit.SplitStartVert = bSplitStartVert; + foreach (var SplitVert in m_SplitVertList) + JsonSplit.SplitVertList.Add(SplitVert.Serialize()); + foreach (var SplitHoriz in m_SplitHorizList) + JsonSplit.SplitHorizList.Add(SplitHoriz.Serialize()); + foreach (var Area in AreaList) + JsonSplit.AreaList.Add(Area.Serialize()); + return JsonSplit; + } + + internal void SetSplitQtyHoriz(int QtyHoriz, bool NotifyProperty = false) + { + if (QtyHoriz > m_SplitHorizList.Count) + { + // recupero larghezza ultimo + double dLastDimension = 100; + double dNewDimension = 100; + if (m_SplitHorizList.Count > 0) + { + dLastDimension = m_SplitHorizList[m_SplitHorizList.Count - 1].dDimension; + dNewDimension = dLastDimension / (QtyHoriz + 1 - nSplitQtyHoriz); + m_SplitHorizList[m_SplitHorizList.Count - 1].dDimension = dNewDimension; + } + else + dNewDimension = dLastDimension / (QtyHoriz + 1 - nSplitQtyHoriz); + // aggiungo area Split di default + for (var SplitIndex = m_SplitHorizList.Count; SplitIndex <= QtyHoriz; SplitIndex++) + m_SplitHorizList.Add(new SplitDimension(dNewDimension, true, this, false)); + } + else if (QtyHoriz < m_SplitHorizList.Count) + { + for (var SplitIndex = m_SplitHorizList.Count - 1; SplitIndex >= QtyHoriz; SplitIndex += -1) + m_SplitHorizList.RemoveAt(SplitIndex); + } + } + + internal void SetSplitQtyVert(int QtyVert, bool NotifyProperty = false) + { + if (QtyVert > m_SplitVertList.Count) + { + // recupero larghezza ultimo + double dLastDimension = 100; + double dNewDimension = 100; + if (m_SplitVertList.Count > 0) + { + dLastDimension = m_SplitVertList[m_SplitVertList.Count - 1].dDimension; + dNewDimension = dLastDimension / (QtyVert + 1 - nSplitQtyVert); + m_SplitVertList[m_SplitVertList.Count - 1].dDimension = dNewDimension; + } + else + dNewDimension = dLastDimension / (QtyVert + 1 - nSplitQtyVert); + // aggiungo area Split di default + for (var SplitIndex = m_SplitVertList.Count; SplitIndex <= QtyVert; SplitIndex++) + m_SplitVertList.Add(new SplitDimension(dNewDimension, true, this, true)); + } + else if (QtyVert < m_SplitVertList.Count) + { + for (var SplitIndex = m_SplitVertList.Count - 1; SplitIndex >= QtyVert; SplitIndex += -1) + m_SplitVertList.RemoveAt(SplitIndex); + } + } + + internal void SetSplitShape(SplitShapes Value, bool NotifyProperty = false) + { + m_SelSplitShape = Value; + } + + internal void SetSplitStartVert(bool SplitStartVert) + { + bSplitStartVert = SplitStartVert; + } + + #endregion Internal Methods + + #region Private Fields + + private bool m_bIsPercentage = true; + private bool m_bSplitStartVert = true; + private SplitShapes m_SelSplitShape; + + private List m_SplitHorizList = new List(); + + private List m_SplitPositionList = new List(); + + private List m_SplitShapeList = new List + { + new IdNameStruct((int)SplitShapes.VERTICAL, "Vertical"), + new IdNameStruct((int)SplitShapes.HORIZONTAL, "Horizontal"), + new IdNameStruct((int)SplitShapes.GRID, "Grid"), + new IdNameStruct((int)SplitShapes.CUSTOM, "Custom") + }; + + private List m_SplitVertList = new List(); + + #endregion Private Fields + } +} \ No newline at end of file diff --git a/WebWindowComplex/Models/SplitDimension.cs b/WebWindowComplex/Models/SplitDimension.cs new file mode 100644 index 0000000..467e605 --- /dev/null +++ b/WebWindowComplex/Models/SplitDimension.cs @@ -0,0 +1,177 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WebWindowComplex.Json; + +namespace WebWindowComplex.Models +{ + public class SplitDimension + { + #region Public Constructors + + public SplitDimension(double dDimension, bool bIsRelative, Split Parent, bool IsVertList) + { + m_dDimension = dDimension; + m_bIsRelative = bIsRelative; + m_Parent = Parent; + m_bIsVertListDim = IsVertList; + } + + #endregion Public Constructors + + #region Public Properties + + public bool bIsRelative + { + get + { + return m_bIsRelative; + } + } + + public bool bIsVertListDim + { + get + { + return m_bIsVertListDim; + } + } + + public double dDimension + { + get + { + return m_dDimension; + } + set + { + // Controllo che il valore inserito sia compreso tra 0 e 100 + if (value > 0 && value < 100) + { + // se sono in percentuale + if (m_bIsRelative) + { + List RelativeDimList = new List(); + if (bIsVertListDim) + RelativeDimList = m_Parent.SplitVertList.Where(x => x.bIsRelative).ToList(); + else + RelativeDimList = m_Parent.SplitHorizList.Where(x => x.bIsRelative).ToList(); + // verifico se ci sono assoluti + //List RelativeDimList = m_Parent.SplitPositionList.Where(x => x.bIsRelative).ToList(); + if (RelativeDimList.Count > 0) + { + if (m_Parent.bIsPercentage) + { + int nIndex = RelativeDimList.IndexOf(this); + if (value < m_dDimension) + { + if (nIndex < RelativeDimList.Count - 1) + RelativeDimList[nIndex + 1].SetDimension(RelativeDimList[nIndex + 1].dDimension + (m_dDimension - value)); + else if (RelativeDimList.Count > 1) + RelativeDimList[nIndex - 1].SetDimension(RelativeDimList[nIndex - 1].dDimension + (m_dDimension - value)); + else + { + m_dDimension = 100; + return; + } + } + else + { + double dRes = value; + if (nIndex < RelativeDimList.Count - 1) + { + for (var nInd = 0; nInd <= nIndex - 1; nInd++) + dRes += RelativeDimList[nInd].dDimension; + dRes = (100 - dRes) / (RelativeDimList.Count - nIndex - 1); + if (dRes != 0) + { + for (var Ind = nIndex + 1; Ind <= RelativeDimList.Count - 1; Ind++) + RelativeDimList[Ind].SetDimension(dRes); + } + else + return; + } + else if (RelativeDimList.Count > 1) + { + if (RelativeDimList.Count > 2) + { + for (var Ind = 0; Ind <= nIndex - 2; Ind++) + dRes += RelativeDimList[Ind].dDimension; + } + dRes = (100 - dRes); + if (dRes != 0) + RelativeDimList[nIndex - 1].SetDimension(dRes); + else + return; + } + else + { + m_dDimension = 100; + return; + } + } + } + else + { + } + } + } + m_dDimension = value; + m_Parent.ParentWindow.OnUpdatePreview(m_Parent.ParentWindow.sSerialized()); + } + } + } + + #endregion Public Properties + + #region Public Methods + + public SplitDimension Copy() + { + SplitDimension newSplitDim = new SplitDimension(dDimension, bIsRelative, m_Parent, bIsVertListDim); + return newSplitDim; + } + + #endregion Public Methods + + #region Internal Methods + + internal JsonSplitDimension Serialize() + { + JsonSplitDimension JsonSplitDimension = new JsonSplitDimension(m_bIsRelative, m_dDimension); + return JsonSplitDimension; + } + + internal void SetDimension(double dValue) + { + m_dDimension = dValue; + } + + internal void SetIsRelative(bool value) + { + m_bIsRelative = value; + } + + internal void SetIsVertListDim(bool value) + { + m_bIsVertListDim = value; + } + + #endregion Internal Methods + + #region Private Fields + + private bool m_bIsRelative = false; + + private bool m_bIsVertListDim = false; + + private double m_dDimension; + + // reference + private Split m_Parent; + + #endregion Private Fields + } +} \ No newline at end of file diff --git a/WebWindowComplex/Models/Splitted.cs b/WebWindowComplex/Models/Splitted.cs new file mode 100644 index 0000000..17ba514 --- /dev/null +++ b/WebWindowComplex/Models/Splitted.cs @@ -0,0 +1,57 @@ +using WebWindowComplex.Json; +using static WebWindowComplex.Json.WindowConst; + +namespace WebWindowComplex.Models +{ + public class Splitted : Area + { + #region Public Constructors + + public Splitted(Area ParentArea, Window ParentWindow) : base(ParentArea, ParentWindow) + { + } + + #endregion Public Constructors + + #region Public Methods + + public override Splitted Copy(Area newParentArea) + { + Splitted newSplitted = new Splitted(newParentArea, ParentWindow); + AddCounterGroup(); + newSplitted.SetIdGroup(nCounterGroup); + newSplitted.SetAreaType(AreaType); + foreach (var item in AreaList) + { + Area a = item.Copy(newSplitted); + newSplitted.AreaList.Add(a); + } + return newSplitted; + } + + #endregion Public Methods + + #region Internal Methods + + internal static Splitted CreateSplitted(Area ParentArea) + { + Splitted Splitted = new Splitted(ParentArea, ParentArea.ParentWindow); + AddCounterGroup(); + Splitted.SetIdGroup(nCounterGroup); + Splitted.SetAreaType(AreaTypes.SPLITTED); + return Splitted; + } + + internal override JsonArea Serialize() + { + if (nCounterGroup < IdGroup) + Area.nCounterGroup = IdGroup; + JsonSplitted JsonSplitted = new JsonSplitted(IdGroup); + foreach (var Area in AreaList) + JsonSplitted.AreaList.Add(Area.Serialize()); + return JsonSplitted; + } + + #endregion Internal Methods + } +} \ No newline at end of file diff --git a/WebWindowComplex/Models/Window.cs b/WebWindowComplex/Models/Window.cs index c2de926..f6aac9c 100644 --- a/WebWindowComplex/Models/Window.cs +++ b/WebWindowComplex/Models/Window.cs @@ -122,1968 +122,6 @@ namespace WebWindowComplex.Models } } - public abstract class Area - { - // Conteggio dei macro elementi - private static int m_CounterGroup = 0; - public static void AddCounterGroup() - { - m_CounterGroup++; - } - public static int nCounterGroup - { - get => m_CounterGroup; - set => m_CounterGroup = value; - } - - private int m_IdGroup; - public int IdGroup - { - get - { - return m_IdGroup; - } - - set - { - m_IdGroup = value; - } - } - public void SetIdGroup(int nIdGroup) - { - m_IdGroup = nIdGroup; - } - - protected Window m_ParentWindow; - public Window ParentWindow - { - get - { - return m_ParentWindow; - } - } - - protected int m_nAreaId = -1; - public int nAreaId - { - get - { - return m_nAreaId; - } - set - { - m_nAreaId = value; - m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); - } - } - - private List m_AreaList = new List(); - public List AreaList - { - get - { - return m_AreaList; - } - set - { - m_AreaList = value; - } - } - - private AreaTypes m_AreaType; - public AreaTypes AreaType - { - get - { - return m_AreaType; - } - set - { - m_AreaType = value; - } - } - internal void SetAreaType(AreaTypes AreaType) - { - m_AreaType = AreaType; - } - - private Area m_ParentArea; - public Area ParentArea - { - get - { - return m_ParentArea; - } - } - internal void SetParentArea(Area ParentArea) - { - m_ParentArea = ParentArea; - } - - public Area(Area ParentArea, Window ParentWindow) - { - m_ParentWindow = ParentWindow; - m_ParentArea = ParentArea; - } - - internal abstract JsonArea Serialize(); - - public void AddSplit(Area ParentArea) - { - List ContentArea = new List(); - // Salvo gli oggetti già presenti e li cancello da AreaList - ContentArea.Add(AreaList[0]); - AreaList.Remove(AreaList[0]); - // Aggiungo Area split di default - Split SplitArea = Split.CreateSplit(this, SplitShapes.HORIZONTAL); - // imposto i parametri di default - SplitArea.SetSplitQtyHoriz(1); - SplitArea.SetSplitStartVert(false); - // Aggiungo area - AreaList.Add(SplitArea); - // Creo le due aree Splitted - List newSplittedList = new List(); - for (int i = 0; i < 2; i++) - newSplittedList.Add(Splitted.CreateSplitted(SplitArea)); - // Inserisco nelle aree Splitted il Fill salvato e un Fill uguale (e setto ParentArea del fill) - ContentArea[0].SetParentArea(newSplittedList[0]); - newSplittedList[0].AreaList.Add(ContentArea[0]); - if (ContentArea[0] is Fill) - { - Fill fill1 = (Fill)ContentArea[0]; - Fill fill2 = Fill.CreateFill(newSplittedList[1], fill1.FillType); - newSplittedList[1].AreaList.Add(fill2); - } - else - { - Fill fill2 = Fill.CreateFill(newSplittedList[1], FillTypes.GLASS); - newSplittedList[1].AreaList.Add(fill2); - } - // All'area Split aggiunto le due aree Splitted - for (int i = 0; i < 2; i++) - AreaList[0].AreaList.Add(newSplittedList[i]); - ParentWindow.OnUpdatePreview(ParentWindow.sSerialized()); - } - - public bool AddFirstSash() - { - bool answ = false; - // Salvo il parent - Area ParentArea = AreaList[0].ParentArea; - // Creo area sash di default - Sash SashArea = Sash.CreateSash(ParentArea); - // 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) - { - // seleziono la famiglia del primo hw trovato... - SashArea.SelFamilyHardware = listHwValid.FamilyName; - SashArea.RefreshHardwareList(); - if (SashArea.HardwareList.Count == 0) - { - SashArea.Remove(); - answ = 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) - { - // Inserisco il riempimento precedente - AreaList[0].AreaList.Add(ContentArea[0]); - AreaList[0].AreaList[0].SetParentArea(AreaList[0]); - } - else - { - // 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()); - } - } - return answ; - } - - - /// - /// MockUp chiamata a c++ x scelta forma sash per Hw - /// - /// - private string FindSashShape() - { - return "Rectangular"; - } - public void SwapAree() - { - Area tempArea; - if (this is Sash || this is Split) - { - tempArea = AreaList[0]; - AreaList[0] = AreaList[1]; - AreaList[1] = tempArea; - } - } - - public abstract Area Copy(Area ParentArea); - } - - public class Frame : Area - { - - private List m_ShapeList = new List - { - new IdNameStruct((int)Shapes.RECTANGLE, "Rectangle"), - new IdNameStruct((int)Shapes.RIGHTCHAMFER, "Right Chamfer"), - new IdNameStruct((int)Shapes.LEFTCHAMFER, "Left Chamfer"), - new IdNameStruct((int)Shapes.DOUBLECHAMFER, "Double Chamfer"), - new IdNameStruct((int)Shapes.ARC, "Arc"), - new IdNameStruct((int)Shapes.ARC_FULL, "Arc Full"), - new IdNameStruct((int)Shapes.DOUBLEARC, "Double Arc"), - new IdNameStruct((int)Shapes.TRIANGLE, "Triangle") - }; - public List ShapeList - { - get - { - return m_ShapeList; - } - } - - private Shapes m_Shape; - public Shapes Shape - { - get - { - return m_Shape; - } - } - public int SelShapeIndex - { - get - { - return IdNameStruct.IndFromId((int)m_Shape, m_ShapeList); - } - set - { - Shapes SelShape = (Shapes)IdNameStruct.IdFromInd(value, m_ShapeList); - if (m_Shape != SelShape) - { - // verifico parametri Dimension - DimensionList.Clear(); - // 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, 2, "Height", 1800, true)); - break; - } - - case Shapes.RIGHTCHAMFER: - { - DimensionList.Add(new FrameDimension(this, 1, "Width", 1500, true)); - DimensionList.Add(new FrameDimension(this, 2, "Left Height", 1800, true)); - DimensionList.Add(new FrameDimension(this, 3, "Right Height", 1500, true)); - break; - } - - case Shapes.LEFTCHAMFER: - { - DimensionList.Add(new FrameDimension(this, 1, "Width", 1500, true)); - DimensionList.Add(new FrameDimension(this, 2, "Left Height", 1500, true)); - DimensionList.Add(new FrameDimension(this, 3, "Right Height", 1800, true)); - break; - } - - case Shapes.DOUBLECHAMFER: - case Shapes.ARC: - { - DimensionList.Add(new FrameDimension(this, 1, "Width", 1500, true)); - DimensionList.Add(new FrameDimension(this, 2, "Height", 1500, true)); - DimensionList.Add(new FrameDimension(this, 3, "Full Height", 1800, true)); - break; - } - - case Shapes.DOUBLEARC: - { - DimensionList.Add(new FrameDimension(this, 1, "Width", 1500, true)); - DimensionList.Add(new FrameDimension(this, 2, "Height", 1500, true)); - DimensionList.Add(new FrameDimension(this, 3, "Full Height", 2400, true)); - break; - } - - case Shapes.TRIANGLE: - { - DimensionList.Add(new FrameDimension(this, 1, "Width", 2000, true)); - DimensionList.Add(new FrameDimension(this, 2, "Height", 1500, true)); - DimensionList.Add(new FrameDimension(this, 3, "Height projection", 0, true)); - break; - } - - case Shapes.CUSTOM: - { - DimensionList.Clear(); - break; - } - } - // salvo tipo Joint - Joints oldJointType = JointList[0].SelJointType; - // aggiungo Joint - m_JointList.Clear(); - switch (SelShape) - { - case Shapes.RECTANGLE: - case Shapes.RIGHTCHAMFER: - case Shapes.LEFTCHAMFER: - case Shapes.DOUBLECHAMFER: - 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)); - break; - } - - case Shapes.ARC_FULL: - { - JointList.Add(new Joint(this, 1, oldJointType)); - JointList.Add(new Joint(this, 2, oldJointType)); - JointList.Add(new Joint(this, 3, Joints.ANGLED)); - JointList.Add(new Joint(this, 4, Joints.ANGLED)); - break; - } - - case Shapes.TRIANGLE: - { - JointList.Add(new Joint(this, 1, oldJointType)); - JointList.Add(new Joint(this, 2, oldJointType)); - JointList.Add(new Joint(this, 3, Joints.ANGLED)); - break; - } - - case Shapes.CUSTOM: - { - JointList.Clear(); - break; - } - } - m_Shape = SelShape; - } - m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); - } - } - internal void SetSelShape(Shapes Value) - { - DimensionList.Clear(); - // aggiungo Dimension - switch (Value) - { - case Shapes.RECTANGLE: - case Shapes.ARC_FULL: - { - DimensionList.Add(new FrameDimension(this, 1, "Width", 1500, 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, 2, "Left Height", 1800, true)); - DimensionList.Add(new FrameDimension(this, 3, "Right Height", 1500, true)); - break; - } - - case Shapes.LEFTCHAMFER: - { - DimensionList.Add(new FrameDimension(this, 1, "Width", 1500, true)); - DimensionList.Add(new FrameDimension(this, 2, "Left Height", 1500, true)); - DimensionList.Add(new FrameDimension(this, 3, "Right Height", 1800, true)); - break; - } - - case Shapes.DOUBLECHAMFER: - case Shapes.ARC: - { - DimensionList.Add(new FrameDimension(this, 1, "Width", 1500, true)); - DimensionList.Add(new FrameDimension(this, 2, "Height", 1500, true)); - DimensionList.Add(new FrameDimension(this, 3, "Full Height", 1800, true)); - break; - } - - case Shapes.DOUBLEARC: - { - DimensionList.Add(new FrameDimension(this, 1, "Width", 1500, true)); - DimensionList.Add(new FrameDimension(this, 2, "Height", 1500, true)); - DimensionList.Add(new FrameDimension(this, 3, "Full Height", 2400, true)); - break; - } - - case Shapes.TRIANGLE: - { - DimensionList.Add(new FrameDimension(this, 1, "Width", 2000, true)); - DimensionList.Add(new FrameDimension(this, 2, "Height", 1500, true)); - DimensionList.Add(new FrameDimension(this, 3, "Height projection", 0, true)); - break; - } - - case Shapes.CUSTOM: - { - DimensionList.Clear(); - break; - } - } - // aggiungo Joint - //int nJointQty = 4; - switch (Value) - { - case Shapes.RECTANGLE: - case Shapes.RIGHTCHAMFER: - case Shapes.LEFTCHAMFER: - case Shapes.DOUBLECHAMFER: - case Shapes.ARC: - case Shapes.DOUBLEARC: - { - JointList.Add(new Joint(this, 1, Joints.FULL_H)); - JointList.Add(new Joint(this, 2, Joints.FULL_H)); - JointList.Add(new Joint(this, 3, Joints.FULL_H)); - JointList.Add(new Joint(this, 4, Joints.FULL_H)); - break; - } - - case Shapes.ARC_FULL: - { - JointList.Add(new Joint(this, 1, Joints.FULL_H)); - JointList.Add(new Joint(this, 2, Joints.FULL_H)); - JointList.Add(new Joint(this, 3, Joints.ANGLED)); - JointList.Add(new Joint(this, 4, Joints.ANGLED)); - break; - } - - case Shapes.TRIANGLE: - { - JointList.Add(new Joint(this, 1, Joints.FULL_H)); - JointList.Add(new Joint(this, 2, Joints.FULL_H)); - JointList.Add(new Joint(this, 3, Joints.ANGLED)); - break; - } - - case Shapes.CUSTOM: - { - JointList.Clear(); - break; - } - } - m_Shape = Value; - } - - private List m_DimensionList = new List(); - public List DimensionList - { - get - { - return m_DimensionList; - } - } - - private List m_JointList = new List(); - public List JointList - { - get - { - return m_JointList; - } - set - { - m_JointList = value; - } - } - - private bool m_bBottomRail; - public bool BottomRail - { - get - { - return m_bBottomRail; - } - set - { - m_bBottomRail = value; - m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); - } - } - internal void SetBottomRail(bool bBottomRail) - { - m_bBottomRail = bBottomRail; - } - - private int m_nBottomRailQty = 0; - public int BottomRailQty - { - get - { - return m_nBottomRailQty; - } - set - { - if (m_nBottomRailQty >= 0) - { - m_nBottomRailQty = value; - if (m_nBottomRailQty > 0) - { - m_bBottomRail = true; - } - else - { - m_bBottomRail = false; - } - } - m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); - } - } - internal void SetBottomRailQty(int nBottomRailQty) - { - m_nBottomRailQty = nBottomRailQty; - } - - public Frame(Area ParentArea, Window ParentWindow) : base(ParentArea, ParentWindow) - { - } - - internal static Area CreateFrame(Window Window) - { - Frame NewFrame = new Frame(null, Window); - NewFrame.SetAreaType(AreaTypes.FRAME); - NewFrame.SetSelShape(Shapes.RECTANGLE); - NewFrame.SetBottomRail(false); - NewFrame.SetBottomRailQty(0); - return NewFrame; - } - - public override Frame Copy(Area ParentArea) - { - return null; - } - - internal override JsonArea Serialize() - { - Area.nCounterGroup = 0; - if (nCounterGroup < IdGroup) - Area.nCounterGroup = IdGroup; - JsonFrame JsonFrame = new JsonFrame(m_Shape, m_bBottomRail, m_nBottomRailQty, IdGroup); - foreach (var Dimension in DimensionList) - JsonFrame.DimensionList.Add(Dimension.Serialize()); - foreach (var Joint in JointList) - JsonFrame.JointList.Add(Joint.Serialize()); - foreach (var Area in AreaList) - JsonFrame.AreaList.Add(Area.Serialize()); - return JsonFrame; - } - } - - public class Sash : Area - { - // Lista hardware completa passata dal chiamante del componente - public static List m_HardwareCompleteList = new List(); - // Lista hardware completa passata dal chiamante del componente - public static List s_FamilyHardwareList = new List(); - - public int nSashQty - { - get - { - return m_SashList.Count > 0 ? m_SashList.Count : 1; - } - set - { - if (value >= 0 && value <= 4) - { - if (value > m_SashList.Count) - { - // recupero larghezza ultimo - double dLastDimension = 100; - double dNewDimension = 100; - if (m_SashList.Count > 0) - { - dLastDimension = m_SashList[m_SashList.Count - 1].dDimension; - dNewDimension = dLastDimension / (value + 1 - nSashQty); - m_SashList[m_SashList.Count - 1].SetDimension(dNewDimension); - } - else - dNewDimension = dLastDimension / (value + 1 - nSashQty); - // aggiungo area Sash di default - for (var SplitIndex = m_SashList.Count; SplitIndex <= value - 1; SplitIndex++) - { - SashList.Add(new SashDimension(dNewDimension, true, this, SplitIndex + 1)); - } - } - else if (value < m_SashList.Count) - { - if (value > 0) - { - double dLastDimension = 0; - for (var SplitIndex = m_SashList.Count - 1; SplitIndex >= value; SplitIndex += -1) - { - dLastDimension += m_SashList[SplitIndex].dDimension; - SashList.RemoveAt(SplitIndex); - } - dLastDimension += m_SashList[SashList.Count - 1].dDimension; - SashList[SashList.Count - 1].SetDimension(dLastDimension); - if (value == 1) - SashList[0].SetHasHandle(true); - } - else - { - SashList.RemoveAt(0); - } - } - if (m_SashList.Count == 0) - { - Area child = AreaList[0]; - // Se nella singola anta ho uno split - if (!(child is Fill)) - { - child = child.AreaList[0].AreaList[0]; - } - child.SetParentArea(this.ParentArea); - this.ParentArea.AreaList.Remove(this); - this.ParentArea.AreaList.Add(child); - } - // Se ho singola anta - else if (m_SashList.Count == 1) - { - // Metto come padre dell'area nello splitted l'anta stessa - List ContentArea = new List(); - ContentArea.Add(AreaList[0].AreaList[0]); - ContentArea[0].SetParentArea(this); - AreaList.Clear(); - AreaList.Add(ContentArea[0]); - } - else - { - // Se aggiungo ante - if (SashList.Count > AreaList.Count) - { - List ContentArea = new List(); - // Salvo in ContentArea il sottoalbero delle singole aree che mantengo - if (AreaList.Count >= 1 & SashList.Count > AreaList.Count) - { - foreach (Area area in AreaList) - { - if (area is Splitted) - ContentArea.Add(area.AreaList[0]); - else - ContentArea.Add(area); - } - AreaList.Clear(); - } - for (int SplitIndex = AreaList.Count; SplitIndex <= SashList.Count - 1; SplitIndex++) - { - AreaList.Add(Splitted.CreateSplitted(this)); - } - // Riaggiungo i sottoalberi che avevo salvato - for (int i = 0; i < AreaList.Count - 1; i++) - { - if (AreaList.Count == 2) - { - ContentArea[i].SetParentArea(AreaList[i]); - } - AreaList[i].AreaList.Add(ContentArea[i]); - - } - // Aggiungo all'ultimo Splitted l'area di vetro - Fill newFill = Fill.CreateFill(AreaList[1], FillTypes.GLASS); - //Fill newFill = new Fill(AreaList[1], ParentWindow); - //newFill.SetFillType(FillTypes.GLASS); - newFill.SetAreaType(AreaTypes.FILL); - AreaList[AreaList.Count - 1].AreaList.Add(newFill); - } - // Se tolgo anta - else - { - for (int SplitIndex = SashList.Count; SplitIndex <= AreaList.Count() - 1; SplitIndex++) - { - AreaList.Remove(AreaList[AreaList.Count - 1]); - break; - } - } - } - } - RefreshHardwareList(); - RefreshHardwareOptionList(); - SetFirstHardware(); - m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); - } - } - internal void SetSashQty(int Qty) - { - if (Qty >= 0 && Qty <= 4) - { - if (Qty > m_SashList.Count) - { - // recupero larghezza ultimo - double dLastDimension = 100; - double dNewDimension = 100; - if (m_SashList.Count > 0) - { - dLastDimension = m_SashList[m_SashList.Count - 1].dDimension; - dNewDimension = dLastDimension / (Qty + 1 - nSashQty); - m_SashList[m_SashList.Count - 1].dDimension = dNewDimension; - } - else - dNewDimension = dLastDimension / (Qty + 1 - nSashQty); - // aggiungo area Sash di default - for (var SplitIndex = m_SashList.Count; SplitIndex <= Qty - 1; SplitIndex++) - SashList.Add(new SashDimension(dNewDimension, true, this, SplitIndex + 1)); - } - else if (Qty < m_SashList.Count) - { - for (var SplitIndex = m_SashList.Count - 1; SplitIndex >= Qty; SplitIndex += -1) - SashList.RemoveAt(SplitIndex); - } - } - } - - private List m_OrientationSashTypeList = new List - { - new IdNameStruct((int)OrientationSash.VERTICAL, "Vertical"), - new IdNameStruct((int)OrientationSash.HORIZONTAL, "Horizontal"), - }; - public List OrientationSashTypeList - { - get - { - return m_OrientationSashTypeList; - } - } - - private OrientationSash m_SelOrientationSashType; - public OrientationSash SelOrientationSashType - { - get - { - return m_SelOrientationSashType; - } - set - { - m_SelOrientationSashType = value; - } - } - - public OrientationSash OrientationSashType - { - get - { - return (OrientationSash)m_SelOrientationSashType; - } - } - internal void SetOrientationSashType(OrientationSash value) - { - m_SelOrientationSashType = value; - } - public int SelOrientationSashTypeIndex - { - get - { - return IdNameStruct.IndFromId((int)m_SelOrientationSashType, m_OrientationSashTypeList); - } - set - { - m_SelOrientationSashType = (OrientationSash)IdNameStruct.IdFromInd(value, m_OrientationSashTypeList); - if (value == 0) - { - m_bIsSashVertical = true; - } - else - { - m_bIsSashVertical = false; - } - m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); - } - } - - private bool m_bIsSashVertical; - public bool bIsSashVertical - { - get - { - return m_bIsSashVertical; - } - set - { - m_bIsSashVertical = value; - } - } - internal void SetIsSashVertical(bool IsSashVertical) - { - m_bIsSashVertical = IsSashVertical; - if (IsSashVertical) - { - m_SelOrientationSashType = OrientationSash.VERTICAL; - } - else - { - m_SelOrientationSashType = OrientationSash.HORIZONTAL; - } - } - - private bool m_bIsMeasureGlass; - public bool bIsMeasureGlass - { - get - { - return m_bIsMeasureGlass; - } - set - { - m_bIsMeasureGlass = value; - } - } - internal void SetIsMeasureGlass(bool IsMeasureGlass) - { - m_bIsMeasureGlass = IsMeasureGlass; - } - - private List m_SashList = new List(); - public List SashList - { - get - { - return m_SashList; - } - set - { - m_SashList = value; - } - } - - private SashTypes m_SashType; - public SashTypes SashType - { - get - { - return m_SashType; - } - set - { - m_SashType = value; - } - } - internal void SetSashType(SashTypes SashType) - { - m_SashType = SashType; - } - - private List m_JointList = new List(); - public List JointList - { - get - { - return m_JointList; - } - set - { - m_JointList = value; - } - } - - private bool m_bSashBottomRail; - public bool SashBottomRail - { - get - { - return m_bSashBottomRail; - } - set - { - m_bSashBottomRail = value; - } - } - internal void SetSashBottomRail(bool bBottomRail) - { - m_bSashBottomRail = bBottomRail; - } - - private int m_nSashBottomRailQty; - public int SashBottomRailQty - { - get - { - return m_nSashBottomRailQty; - } - set - { - // Controllo che il valore inserito sia positivo - if (value >= 0) - { - m_nSashBottomRailQty = value; - if (m_nSashBottomRailQty > 0) - { - m_bSashBottomRail = true; - } - else - { - m_bSashBottomRail = false; - } - m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); - } - } - } - internal void SetSashBottomRailQty(int nBottomRailQty) - { - m_nSashBottomRailQty = nBottomRailQty; - } - - private bool m_bIsPercentage = true; - public bool bIsPercentage - { - get - { - return m_bIsPercentage; - } - } - - private string m_SelFamilyHardware; - public string SelFamilyHardware - { - get - { - return m_SelFamilyHardware; - } - set - { - m_SelFamilyHardware = value; - RefreshHardwareList(); - RefreshHardwareOptionList(); - SetFirstHardware(); - m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); - } - } - - internal string SetSelFamilyHardwareFromIndex(string codHardware) - { - if (string.IsNullOrEmpty(m_SelFamilyHardware)) - { - SelFamilyHardware = (m_HardwareCompleteList - .Where(x => x.Id == codHardware) - .First()).FamilyName; - } - return SelFamilyHardware; - } - - private List m_HardwareList = new List(); - public List HardwareList - { - get - { - return m_HardwareList; - } - } - - private Hardware m_SelHardware; - public Hardware SelHardware - { - get - { - return m_SelHardware; - } - set - { - m_SelHardware = value; - // if (m_SelHardware != null && m_SelHardware.sId != "000000") - // { - // string sHwdOptPath = ""; - // var gf = EgtLuaCreateGlobTable("WDG"); - // var tft = EgtLuaSetGlobIntVar("WDG.AREAID", m_nAreaId); - // var tfy = EgtLuaSetGlobStringVar("WDG.HDWFAVOURITE", value.sId); - // SashDimension HandleSash = m_SashList.FirstOrDefault(x => x.bHasHandle); - // string sHandle = "Dx"; - // switch (GetOpeningSide(HandleSash.OpeningType)) - // { - // case object _ when OpeningSides.LEFT: - // { - // sHandle = "Sx"; - // break; - // } - - // case object _ when OpeningSides.RIGHT: - // { - // sHandle = "Dx"; - // break; - // } - // } - // var tfd = EgtLuaSetGlobStringVar("WDG.HDWHANDLE", sHandle); - // var tlt = EgtLuaCallFunction("WinCreate_GetHardwareOptionPath"); - // var tltf = EgtLuaGetGlobStringVar("WDG.HWDOPTPATH", sHwdOptPath); - // if (!string.IsNullOrWhiteSpace(sHwdOptPath)) - // { - // XmlSerializer serializer = new XmlSerializer(typeof(ParametriOpzioni)); - // ParametriOpzioni HwdOptions = null/* TODO Change to default(_) if this is not a reference type */; - // string sHdwOptPath = Path.ChangeExtension(sHwdOptPath, ".opt"); - // bool bHdwOptFound = false; - // for (var WaitIndex = 0; WaitIndex <= 100; WaitIndex++) - // { - // if (File.Exists(sHdwOptPath)) - // { - // bHdwOptFound = true; - // break; - // } - // System.Threading.Thread.Sleep(100); - // } - // if (bHdwOptFound) - // { - // string sHwdOptText = ""; - // try - // { - // sHwdOptText = File.ReadAllText(sHdwOptPath); - // } - // catch (Exception ex) - // { - // EgtOutLog("Hardware file opt not found or read!"); - // } - // if (!string.IsNullOrWhiteSpace(sHwdOptText)) - // { - // using (TextReader reader = new StringReader(sHwdOptText)) - // { - // HwdOptions = serializer.Deserialize(reader); - // } - // if (!IsNothing(HwdOptions)) - // { - // m_HwdOptionList.Clear(); - // foreach (var HdwOption in HwdOptions.Items) - // m_HwdOptionList.Add(new AGBOption(HdwOption)); - // NotifyPropertyChanged(nameof(HwdOptionList)); - // } - // } - // } - // var ud = EgtLuaResetGlobVar("WDG"); - // } - // } - } - } - - internal void SetSelHardware(Hardware value) - { - m_SelHardware = value; - } - - internal void SetSelHardwareFromId(string sId) - { - if (m_HardwareList.Count == 0) - m_SelHardware = m_HardwareCompleteList.FirstOrDefault(x => x.Id.Equals(sId)) ?? new Hardware("", "", "", Enums.OpeningTypes.Null, "", 0, 0); - else - m_SelHardware = m_HardwareList.FirstOrDefault(x => x.Id.Equals(sId)) ?? new Hardware("", "", "", Enums.OpeningTypes.Null, "", 0, 0); - if (m_SelHardware == null) - m_SelHardware = m_HardwareList[0]; - //SelFamilyHardware = m_SelHardware.FamilyName; - } - - public string SelHardwareFromId - { - get - { - return m_SelHardware.Id; - } - set - { - m_SelHardware = m_HardwareList.FirstOrDefault(x => !string.IsNullOrEmpty(value) && x.Id.Equals(value)) ?? new Hardware("", "", "", Enums.OpeningTypes.Null, "", 0, 0); - ParentWindow.OnUpdatePreview(ParentWindow.sSerialized()); - } - } - - internal void SetFirstHardware() - { - if (m_HardwareList.Count > 0) - { - m_SelHardware = m_HardwareList[0]; - } - } - - private List m_HwdOptionList = new List(); - public List HwdOptionList - { - get - { - return m_HwdOptionList; - } - } - - public Sash(Area ParentArea, Window ParentWindow) : base(ParentArea, ParentWindow) - { - } - - internal static Sash CreateSash(Area Area) - { - Sash newSash = new Sash(Area, Area.ParentWindow); - AddCounterGroup(); - newSash.SetIdGroup(nCounterGroup); - newSash.SetAreaType(AreaTypes.SASH); - newSash.SetSashQty(1); - newSash.SetOrientationSashType(OrientationSash.VERTICAL); - newSash.SetIsSashVertical(true); - for (var JointIndex = 0; JointIndex <= 3; JointIndex++) - newSash.JointList.Add(new Joint(newSash, JointIndex + 1, Joints.FULL_H)); - newSash.SetSashBottomRail(false); - newSash.SetSashBottomRailQty(0); - newSash.SelFamilyHardware = Sash.s_FamilyHardwareList.First(); - newSash.RefreshHardwareList(); - newSash.RefreshHardwareOptionList(); - newSash.SetFirstHardware(); - return newSash; - } - private string FindSashShape() - { - return "Rectangular"; - } - - internal Enums.OpeningTypes GetOpeningType(Openings OpeningType) - { - switch (OpeningType) - { - case Openings.TURNONLY_LEFT: - case Openings.TURNONLY_RIGHT: - { - return Enums.OpeningTypes.TurnOnly; - } - - case Openings.TILTTURN_LEFT: - case Openings.TILTTURN_RIGHT: - { - return Enums.OpeningTypes.TiltTurn; - } - - case Openings.TILTONLY_TOP: - case Openings.TILTONLY_BOTTOM: - { - return Enums.OpeningTypes.TiltOnly; - } - - case Openings.PIVOT: - { - return Enums.OpeningTypes.Pivot; - } - - case Openings.FIXED: - { - return Enums.OpeningTypes.Fixed; - } - - case Openings.COMPLANARSLIDE_LEFT: - case Openings.COMPLANARSLIDE_RIGHT: - { - return Enums.OpeningTypes.ComplanarSlide; - } - - case Openings.LIFTSLIDE_LEFT: - case Openings.LIFTSLIDE_RIGHT: - { - return Enums.OpeningTypes.LiftSlide; - } - - default: - { - return Enums.OpeningTypes.Null; - } - } - } - private Enums.OpeningTypes ConvertOpeningType() - { - var answ = Enums.OpeningTypes.Null; - if (m_SashList.Count > 1) - { - for (int i = 0; i < m_SashList.Count; i++) - { - if (m_SashList[i].bHasHandle) - { - answ = GetOpeningType(m_SashList[i].OpeningType); - } - - } - } - else - { - answ = GetOpeningType(m_SashList[0].OpeningType); - } - return answ; - } - - public void RefreshHardwareList() - { - if (m_HardwareCompleteList != null && m_HardwareCompleteList.Count > 0) - { - m_HardwareList.Clear(); - string sSashShape = FindSashShape(); - Enums.OpeningTypes sOpeningType = ConvertOpeningType(); - var iComp = StringComparison.InvariantCultureIgnoreCase; - var rawList = m_HardwareCompleteList - .Where(x => x.Id == "000000" || - (!string.IsNullOrEmpty(m_SelFamilyHardware) && x.FamilyName.Equals(m_SelFamilyHardware, iComp) && x.SashQty == nSashQty && x.Shape.Equals(sSashShape, iComp) && x.OpeningType == sOpeningType) - ) - .ToList(); - if (rawList != null && rawList.Count > 0) - { - m_HardwareList = new List(rawList); - } - else - { - m_HardwareList = new List(); - } - } - } - - internal void RefreshHardwareOptionList() - { - m_HwdOptionList.Clear(); - } - - internal OpeningSides GetOpeningSide(Openings OpeningType) - { - switch (OpeningType) - { - case Openings.TURNONLY_LEFT: - case Openings.TILTTURN_LEFT: - case Openings.TILTONLY_TOP: - case Openings.COMPLANARSLIDE_LEFT: - case Openings.LIFTSLIDE_LEFT: - { - return OpeningSides.LEFT; - } - - case Openings.TURNONLY_RIGHT: - case Openings.TILTTURN_RIGHT: - case Openings.TILTONLY_BOTTOM: - case Openings.COMPLANARSLIDE_RIGHT: - case Openings.LIFTSLIDE_RIGHT: - { - return OpeningSides.RIGHT; - } - - default: - { - return OpeningSides.NULL; - } - } - } - - public override Sash Copy(Area newParentArea) - { - Sash newSash = new Sash(newParentArea, m_ParentWindow); - AddCounterGroup(); - newSash.SetIdGroup(nCounterGroup); - newSash.SetAreaType(AreaType); - // Imposta la quantità di ante e definisce SashDimension di ogni anta ai valori di default - newSash.SetSashQty(nSashQty); - newSash.SetIsSashVertical(bIsSashVertical); - newSash.SetOrientationSashType(OrientationSashType); - newSash.SetSashBottomRailQty(SashBottomRailQty); - newSash.SetSelFamilyHardwareFromIndex(SelHardware.Id); - newSash.RefreshHardwareList(); - newSash.RefreshHardwareOptionList(); - newSash.SetSelHardware(SelHardware); - for (int i = 0; i < SashList.Count; i++) - { - //Cancello SashDimension di default e aggiungo la copia - newSash.SashList.RemoveAt(i); - SashDimension newSashDim = SashList[i].Copy(); - newSash.SashList.Insert(i, newSashDim); - } - foreach (var item in JointList) - { - Joint newJoint = item.Copy(); - newSash.JointList.Add(newJoint); - } - foreach (var item in AreaList) - { - Area newArea = item.Copy(newSash); - newSash.AreaList.Add(newArea); - } - return newSash; - } - - public void Remove() - { - ParentArea.AreaList.Remove(this); - Fill newFill = Fill.CreateFill(ParentArea, FillTypes.GLASS); - newFill.SetAreaType(AreaTypes.FILL); - ParentArea.AreaList.Add(newFill); - m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); - } - - internal override JsonArea Serialize() - { - if (nCounterGroup < IdGroup) - Area.nCounterGroup = IdGroup; - JsonSash JsonSash = new JsonSash(m_bIsSashVertical, m_SashType, m_bSashBottomRail, m_nSashBottomRailQty, m_SelHardware.Id, IdGroup); - foreach (var SashDimension in SashList) - JsonSash.SashList.Add(SashDimension.Serialize()); - foreach (var Joint in JointList) - JsonSash.JointList.Add(Joint.Serialize()); - foreach (var Area in AreaList) - JsonSash.AreaList.Add(Area.Serialize()); - return JsonSash; - } - } - - public class Split : Area - { - private bool m_bSplitStartVert = true; - public bool bSplitStartVert - { - get - { - return m_bSplitStartVert; - } - set - { - m_bSplitStartVert = value; - m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); - } - } - internal void SetSplitStartVert(bool SplitStartVert) - { - bSplitStartVert = SplitStartVert; - } - public int nSplitQtyVert - { - get - { - return m_SplitVertList.Count > 0 ? m_SplitVertList.Count - 1 : 0; - } - set - { - if (value == 0) - { - for (var SplitIndex = m_SplitVertList.Count - 1; SplitIndex >= value; SplitIndex += -1) - m_SplitVertList.RemoveAt(SplitIndex); - if (nSplitQtyHoriz == 0) - { - ParentArea.AreaList.Remove(this); - Fill newFill = Fill.CreateFill(ParentArea, FillTypes.GLASS); - newFill.SetAreaType(AreaTypes.FILL); - ParentArea.AreaList.Add(newFill); - } - else - SetSplitShape(SplitShapes.HORIZONTAL); - } - else - { - // Ricalcolo dimensioni aggiungendo split - if (value > m_SplitVertList.Count - 1) - { - // recupero larghezza ultimo - double dLastDimension = 100; - double dNewDimension = 100; - if (m_SplitVertList.Count > 0) - { - dLastDimension = m_SplitVertList[m_SplitVertList.Count - 1].dDimension; - dNewDimension = dLastDimension / (value + 1 - nSplitQtyVert); - m_SplitVertList[m_SplitVertList.Count - 1].SetDimension(dNewDimension); - } - else - dNewDimension = dLastDimension / (value + 1 - nSplitQtyVert); - // aggiungo area Split di default - for (var SplitIndex = m_SplitVertList.Count; SplitIndex <= value; SplitIndex++) - m_SplitVertList.Add(new SplitDimension(dNewDimension, true, this, true)); - } - else if (value == 0) - { - m_SplitVertList.RemoveAt(1); - m_SplitVertList.RemoveAt(0); - } - // Ricalcolo dimensioni rimuovendo split - else - { - double dLastDimension = 0; - for (var SplitIndex = m_SplitVertList.Count - 1; SplitIndex >= value + 1; SplitIndex += -1) - { - dLastDimension += m_SplitVertList[SplitIndex].dDimension; - m_SplitVertList.RemoveAt(SplitIndex); - } - dLastDimension += m_SplitVertList[m_SplitVertList.Count - 1].dDimension; - m_SplitVertList[m_SplitVertList.Count - 1].SetDimension(dLastDimension); - } - // Controllo quanti split orizzontali ci sono - int nHoriz = m_SplitHorizList.Count > 0 ? m_SplitHorizList.Count : 1; - // Se aggiungo split devo aggiungere vetro nell'area splitted aggiunta - for (var SplitIndex = AreaList.Count; SplitIndex <= (m_SplitVertList.Count * nHoriz) - 1; SplitIndex++) - { - AreaList.Add(Splitted.CreateSplitted(this)); - Fill newFill = Fill.CreateFill(AreaList[SplitIndex], FillTypes.GLASS); - newFill.SetAreaType(AreaTypes.FILL); - AreaList[AreaList.Count - 1].AreaList.Add(newFill); - } - // Se ho più di uno split, elimino l'ultimo - if (AreaList.Count > 2) - { - int nAreaList = AreaList.Count - 1; - for (var SplitIndex = (m_SplitVertList.Count * nHoriz); SplitIndex <= nAreaList; SplitIndex++) - { - AreaList.Remove(AreaList[AreaList.Count - 1]); - } - } - // Se elimino l'unico split presente - else - { - Splitted s = (Splitted)AreaList[0]; - s.SetParentArea(ParentArea); - ParentArea.AreaList.Add(s); - ParentArea.AreaList.Remove(this); - } - } - m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); - } - } - internal void SetSplitQtyVert(int QtyVert, bool NotifyProperty = false) - { - if (QtyVert > m_SplitVertList.Count) - { - // recupero larghezza ultimo - double dLastDimension = 100; - double dNewDimension = 100; - if (m_SplitVertList.Count > 0) - { - dLastDimension = m_SplitVertList[m_SplitVertList.Count - 1].dDimension; - dNewDimension = dLastDimension / (QtyVert + 1 - nSplitQtyVert); - m_SplitVertList[m_SplitVertList.Count - 1].dDimension = dNewDimension; - } - else - dNewDimension = dLastDimension / (QtyVert + 1 - nSplitQtyVert); - // aggiungo area Split di default - for (var SplitIndex = m_SplitVertList.Count; SplitIndex <= QtyVert; SplitIndex++) - m_SplitVertList.Add(new SplitDimension(dNewDimension, true, this, true)); - } - else if (QtyVert < m_SplitVertList.Count) - { - for (var SplitIndex = m_SplitVertList.Count - 1; SplitIndex >= QtyVert; SplitIndex += -1) - m_SplitVertList.RemoveAt(SplitIndex); - } - } - - public int nSplitQtyHoriz - { - get - { - return m_SplitHorizList.Count > 0 ? m_SplitHorizList.Count - 1 : 0; - } - set - { - if (value == 0) - { - for (var SplitIndex = m_SplitHorizList.Count - 1; SplitIndex >= value; SplitIndex += -1) - m_SplitHorizList.RemoveAt(SplitIndex); - if (nSplitQtyVert == 0) - { - ParentArea.AreaList.Remove(this); - Fill newFill = Fill.CreateFill(ParentArea, FillTypes.GLASS); - newFill.SetAreaType(AreaTypes.FILL); - ParentArea.AreaList.Add(newFill); - } - else - SetSplitShape(SplitShapes.VERTICAL); - } - else - { - // Ricalcolo dimensioni aggiungendo split - if (value > m_SplitHorizList.Count - 1) - { - // recupero larghezza ultimo - double dLastDimension = 100; - double dNewDimension = 100; - if (m_SplitHorizList.Count > 0) - { - dLastDimension = m_SplitHorizList[m_SplitHorizList.Count - 1].dDimension; - dNewDimension = dLastDimension / (value + 1 - nSplitQtyHoriz); - m_SplitHorizList[m_SplitHorizList.Count - 1].SetDimension(dNewDimension); - } - else - dNewDimension = dLastDimension / (value + 1 - nSplitQtyHoriz); - // aggiungo area Split di default - for (var SplitIndex = m_SplitHorizList.Count; SplitIndex <= value; SplitIndex++) - m_SplitHorizList.Add(new SplitDimension(dNewDimension, true, this, false)); - } - // Ricalcolo dimensioni rimuovendo split - else - { - double dLastDimension = 0; - for (var SplitIndex = m_SplitHorizList.Count - 1; SplitIndex >= value + 1; SplitIndex += -1) - { - dLastDimension += m_SplitHorizList[SplitIndex].dDimension; - m_SplitHorizList.RemoveAt(SplitIndex); - } - dLastDimension += m_SplitHorizList[m_SplitHorizList.Count - 1].dDimension; - m_SplitHorizList[m_SplitHorizList.Count - 1].SetDimension(dLastDimension); - } - // Controllo quanti split verticali ci sono - int nVert = m_SplitVertList.Count > 0 ? m_SplitVertList.Count : 1; - // Se aggiungo split devo aggiungere vetro nell'area splitted aggiunta - for (var SplitIndex = AreaList.Count; SplitIndex <= (m_SplitHorizList.Count * nVert) - 1; SplitIndex++) - { - AreaList.Add(Splitted.CreateSplitted(this)); - Fill newFill = Fill.CreateFill(AreaList[SplitIndex], FillTypes.GLASS); - newFill.SetAreaType(AreaTypes.FILL); - AreaList[AreaList.Count - 1].AreaList.Add(newFill); - } - // Se ho più di uno split, elimino l'ultimo - if (AreaList.Count > 2) - { - int nAreaList = AreaList.Count - 1; - for (var SplitIndex = (m_SplitHorizList.Count * nVert); SplitIndex <= nAreaList; SplitIndex++) - { - AreaList.Remove(AreaList[AreaList.Count - 1]); - } - } - // Se elimino l'unico split presente - else - { - Splitted s = (Splitted)AreaList[0]; - s.SetParentArea(ParentArea); - ParentArea.AreaList.Add(s); - ParentArea.AreaList.Remove(this); - } - } - m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); - } - } - internal void SetSplitQtyHoriz(int QtyHoriz, bool NotifyProperty = false) - { - if (QtyHoriz > m_SplitHorizList.Count) - { - // recupero larghezza ultimo - double dLastDimension = 100; - double dNewDimension = 100; - if (m_SplitHorizList.Count > 0) - { - dLastDimension = m_SplitHorizList[m_SplitHorizList.Count - 1].dDimension; - dNewDimension = dLastDimension / (QtyHoriz + 1 - nSplitQtyHoriz); - m_SplitHorizList[m_SplitHorizList.Count - 1].dDimension = dNewDimension; - } - else - dNewDimension = dLastDimension / (QtyHoriz + 1 - nSplitQtyHoriz); - // aggiungo area Split di default - for (var SplitIndex = m_SplitHorizList.Count; SplitIndex <= QtyHoriz; SplitIndex++) - m_SplitHorizList.Add(new SplitDimension(dNewDimension, true, this, false)); - } - else if (QtyHoriz < m_SplitHorizList.Count) - { - for (var SplitIndex = m_SplitHorizList.Count - 1; SplitIndex >= QtyHoriz; SplitIndex += -1) - m_SplitHorizList.RemoveAt(SplitIndex); - } - } - - private List m_SplitShapeList = new List - { - new IdNameStruct((int)SplitShapes.VERTICAL, "Vertical"), - new IdNameStruct((int)SplitShapes.HORIZONTAL, "Horizontal"), - new IdNameStruct((int)SplitShapes.GRID, "Grid"), - new IdNameStruct((int)SplitShapes.CUSTOM, "Custom") - }; - public List SplitShapeList - { - get - { - return m_SplitShapeList; - } - } - - private SplitShapes m_SelSplitShape; - public int SelSplitShapeIndex - { - get - { - return IdNameStruct.IndFromId((int)m_SelSplitShape, m_SplitShapeList); - } - set - { - m_SelSplitShape = (SplitShapes)IdNameStruct.IdFromInd(value, m_SplitShapeList); - // Cancello elementi nello split e azzero quantità orizzontale e verticale - AreaList.Clear(); - SetSplitQtyVert(0); - SetSplitQtyHoriz(0); - if (m_SelSplitShape == SplitShapes.VERTICAL) - { - // Inserisco valori di default - SetSplitQtyVert(1); - SetSplitStartVert(true); - } - else if (m_SelSplitShape == SplitShapes.HORIZONTAL) - { - // Inserisco valori di default - SetSplitQtyHoriz(1); - SetSplitStartVert(false); - } - else - { - // Inserisco valori di default - SetSplitQtyVert(1); - SetSplitQtyHoriz(1); - SetSplitStartVert(true); - } - // Aggiungo area Splitted e vetro - int nVert = m_SplitVertList.Count > 0 ? m_SplitVertList.Count : 1; - int nHoriz = m_SplitHorizList.Count > 0 ? m_SplitHorizList.Count : 1; - for (var SplitIndex = 0; SplitIndex <= (nVert * nHoriz) - 1; SplitIndex++) - { - AreaList.Add(Splitted.CreateSplitted(this)); - Fill newFill = Fill.CreateFill(AreaList[SplitIndex], FillTypes.GLASS); - newFill.SetAreaType(AreaTypes.FILL); - AreaList[SplitIndex].AreaList.Add(newFill); - } - m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); - } - } - internal void SetSplitShape(SplitShapes Value, bool NotifyProperty = false) - { - m_SelSplitShape = Value; - } - internal SplitShapes SelSplitShape - { - get - { - return m_SelSplitShape; - } - } - - private bool m_bIsPercentage = true; - public bool bIsPercentage - { - get - { - return m_bIsPercentage; - } - } - - private List m_SplitPositionList = new List(); - public List SplitPositionList - { - get - { - return m_SplitPositionList; - } - set - { - m_SplitPositionList = value; - } - } - - private List m_SplitVertList = new List(); - public List SplitVertList - { - get - { - return m_SplitVertList; - } - set - { - m_SplitVertList = value; - } - } - - private List m_SplitHorizList = new List(); - public List SplitHorizList - { - get - { - return m_SplitHorizList; - } - set - { - m_SplitHorizList = value; - } - } - - public Split(Area ParentArea, Window ParentWindow) : base(ParentArea, ParentWindow) - { - } - - internal static Split CreateSplit(Area Area, SplitShapes SplitShape) - { - Split Split = new Split(Area, Area.ParentWindow); - AddCounterGroup(); - Split.SetIdGroup(nCounterGroup); - Split.SetAreaType(AreaTypes.SPLIT); - Split.SetSplitShape(SplitShape, true); - return Split; - } - - public override Split Copy(Area newParentArea) - { - Split newSplit = new Split(newParentArea, ParentWindow); - AddCounterGroup(); - newSplit.SetIdGroup(nCounterGroup); - newSplit.SetSplitStartVert(bSplitStartVert); - newSplit.SetSplitQtyVert(nSplitQtyVert); - newSplit.SetSplitQtyHoriz(nSplitQtyHoriz); - newSplit.SetSplitShape(SelSplitShape, true); - newSplit.SetAreaType(AreaType); - foreach (var item in AreaList) - { - Area a = item.Copy(newSplit); - newSplit.AreaList.Add(a); - } - return newSplit; - } - - public void Remove() - { - ParentArea.AreaList.Remove(this); - Fill newFill = Fill.CreateFill(ParentArea, FillTypes.GLASS); - newFill.SetAreaType(AreaTypes.FILL); - ParentArea.AreaList.Add(newFill); - m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); - } - - internal override JsonArea Serialize() - { - if (nCounterGroup < IdGroup) - Area.nCounterGroup = IdGroup; - JsonSplit JsonSplit = new JsonSplit(m_SelSplitShape, IdGroup); - //foreach (var SplitPosition in m_SplitPositionList) - // JsonSplit.SplitPositionList.Add(SplitPosition.Serialize()); - JsonSplit.SplitStartVert = bSplitStartVert; - foreach (var SplitVert in m_SplitVertList) - JsonSplit.SplitVertList.Add(SplitVert.Serialize()); - foreach (var SplitHoriz in m_SplitHorizList) - JsonSplit.SplitHorizList.Add(SplitHoriz.Serialize()); - foreach (var Area in AreaList) - JsonSplit.AreaList.Add(Area.Serialize()); - return JsonSplit; - } - } - - public class Splitted : Area - { - public Splitted(Area ParentArea, Window ParentWindow) : base(ParentArea, ParentWindow) - { - } - - internal static Splitted CreateSplitted(Area ParentArea) - { - Splitted Splitted = new Splitted(ParentArea, ParentArea.ParentWindow); - AddCounterGroup(); - Splitted.SetIdGroup(nCounterGroup); - Splitted.SetAreaType(AreaTypes.SPLITTED); - return Splitted; - } - - public override Splitted Copy(Area newParentArea) - { - Splitted newSplitted = new Splitted(newParentArea, ParentWindow); - AddCounterGroup(); - newSplitted.SetIdGroup(nCounterGroup); - newSplitted.SetAreaType(AreaType); - foreach (var item in AreaList) - { - Area a = item.Copy(newSplitted); - newSplitted.AreaList.Add(a); - } - return newSplitted; - } - - internal override JsonArea Serialize() - { - if (nCounterGroup < IdGroup) - Area.nCounterGroup = IdGroup; - JsonSplitted JsonSplitted = new JsonSplitted(IdGroup); - foreach (var Area in AreaList) - JsonSplitted.AreaList.Add(Area.Serialize()); - return JsonSplitted; - } - } - - public class Fill : Area - { - private List m_FillTypeList = new List - { - new IdNameStruct((int)FillTypes.GLASS, "SvgPreview"), - new IdNameStruct((int)FillTypes.WOOD, "Wood") - }; - public List FillTypeList - { - get - { - return m_FillTypeList; - } - } - - private FillTypes m_SelFillType; - public FillTypes SelFillType - { - get - { - return m_SelFillType; - } - set - { - m_SelFillType = value; - } - } - - public FillTypes FillType - { - get - { - return (FillTypes)m_SelFillType; - } - } - internal void SetFillType(FillTypes value) - { - m_SelFillType = value; - m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); - } - public int SelFillTypeIndex - { - get - { - return IdNameStruct.IndFromId((int)m_SelFillType, m_FillTypeList); - } - set - { - m_SelFillType = (FillTypes)IdNameStruct.IdFromInd(value, m_FillTypeList); - m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); - } - } - - public Fill(Area ParentArea, Window ParentWindow) : base(ParentArea, ParentWindow) - { - } - - internal static Fill CreateFill(Area AreaParent, FillTypes FillType) - { - Fill Fill = new Fill(AreaParent, AreaParent.ParentWindow); - AddCounterGroup(); - Fill.SetIdGroup(nCounterGroup); - Fill.SetAreaType(AreaTypes.FILL); - Fill.SetFillType(FillType); - return Fill; - } - - public override Fill Copy(Area newParentArea) - { - Fill newFill = new Fill(newParentArea, m_ParentWindow); - AddCounterGroup(); - newFill.SetIdGroup(nCounterGroup); - newFill.SetFillType(SelFillType); - newFill.SetAreaType(AreaType); - return newFill; - } - - internal override JsonArea Serialize() - { - if (nCounterGroup < IdGroup) - Area.nCounterGroup = IdGroup; - JsonFill JsonFill = new JsonFill(FillType, IdGroup); - foreach (var Area in AreaList) - JsonFill.AreaList.Add(Area.Serialize()); - return JsonFill; - } - } - - public class Joint - { - protected Area m_ParentArea; - public Area ParentArea - { - get - { - return m_ParentArea; - } - } - - private int m_nIndex; - public int nIndex - { - get - { - return m_nIndex; - } - } - - private List m_JointTypeList = new List - { - new IdNameStruct((int)Joints.ANGLED, "Angled"), - new IdNameStruct((int)Joints.FULL_H, "Full H"), - new IdNameStruct((int)Joints.FULL_V, "Full V") - }; - public List JointTypeList - { - get - { - return m_JointTypeList; - } - } - - private Joints m_SelJointType; - public int SelJointTypeIndex - { - get - { - return IdNameStruct.IndFromId((int)m_SelJointType, m_JointTypeList); - } - set - { - m_SelJointType = (Joints)IdNameStruct.IdFromInd(value, m_JointTypeList); - m_ParentArea.ParentWindow.OnUpdatePreview(m_ParentArea.ParentWindow.sSerialized()); - } - } - public Joints SelJointType - { - get - { - return m_SelJointType; - } - set - { - m_SelJointType = value; - } - } - internal void SetSelJointType(Joints value) - { - m_SelJointType = value; - //NotifyPropertyChanged(nameof(SelJointTypeIndex)); - } - - public Joint Copy() - { - Joint newJoint = new Joint(ParentArea, nIndex, SelJointType); - return newJoint; - } - - public Joint(Area ParentArea, int nIndex, Joints SelJointType) - { - m_ParentArea = ParentArea; - m_nIndex = nIndex; - m_SelJointType = SelJointType; - } - - internal JsonJoint Serialize() - { - JsonJoint JsonJoint = new JsonJoint(m_nIndex, m_SelJointType); - return JsonJoint; - } - } - public partial class ParametriOpzioni { public enum HDWOPTIONTYPES : int @@ -2219,507 +257,6 @@ namespace WebWindowComplex.Models } } - public class FrameDimension - { - // valore massimo e minimo della dimensione del frame - int MaxDim = 4000; - int MinDim = 600; - - protected Frame m_ParentFrame; - public Frame ParentFrame - { - get - { - return m_ParentFrame; - } - } - - private bool m_bIsLen = false; - - private int m_nIndex; - public int nIndex - { - get - { - return m_nIndex; - } - } - - private string m_sName; - public string sName - { - get - { - return m_sName; - } - } - - private double m_dValue; - public double dValue - { - get - { - return m_dValue; - } - set - { - m_dValue = value; - if (value > MaxDim) - { - m_dValue = MaxDim; - } - else if (value < MinDim) - { - m_dValue = MinDim; - } - m_ParentFrame.ParentWindow.OnUpdatePreview(m_ParentFrame.ParentWindow.sSerialized()); - } - } - - public FrameDimension(Frame ParentFrame, int nIndex, string sName, double dValue, bool bIsLen) - { - m_ParentFrame = ParentFrame; - m_nIndex = nIndex; - m_sName = sName; - m_dValue = dValue; - m_bIsLen = bIsLen; - } - - internal JsonFrameDimension Serialize() - { - JsonFrameDimension JsonFrameDimension = new JsonFrameDimension(m_nIndex, m_sName, m_dValue); - return JsonFrameDimension; - } - } - - public class SashDimension - { - // reference - private Sash m_Parent; - - private int m_nSashId; - public int nSashId - { - get - { - return m_nSashId; - } - } - - private bool m_bIsRelative = false; - public bool bIsRelative - { - get - { - return m_bIsRelative; - } - } - - private List m_OpeningTypeList = new List - { - new IdNameStruct((int)Openings.TURNONLY_LEFT, ">"), - new IdNameStruct((int)Openings.TURNONLY_RIGHT, "<"), - new IdNameStruct((int)Openings.TILTTURN_LEFT, ">*"), - new IdNameStruct((int)Openings.TILTTURN_RIGHT, "<*"), - new IdNameStruct((int)Openings.TILTONLY_TOP, "˄"), - new IdNameStruct((int)Openings.TILTONLY_BOTTOM, "˅"), - new IdNameStruct((int)Openings.PIVOT, "◊"), - new IdNameStruct((int)Openings.FIXED, "X"), - new IdNameStruct((int)Openings.COMPLANARSLIDE_LEFT, "-→"), - new IdNameStruct((int)Openings.COMPLANARSLIDE_RIGHT, "←-"), - new IdNameStruct((int)Openings.LIFTSLIDE_LEFT, "┌→"), - new IdNameStruct((int)Openings.LIFTSLIDE_RIGHT, "←┐") - }; - public List OpeningTypeList - { - get - { - return m_OpeningTypeList; - } - } - - private Openings m_SelOpeningType; - public Openings SelOpeningType - { - get - { - return m_SelOpeningType; - } - set - { - m_SelOpeningType = value; - m_Parent.RefreshHardwareList(); - m_Parent.RefreshHardwareOptionList(); - m_Parent.SetFirstHardware(); - } - } - public Openings OpeningType - { - get - { - return (Openings)m_SelOpeningType; - } - } - internal void SetOpeningType(Openings value) - { - m_SelOpeningType = value; - } - public int SelOpeningTypeIndex - { - get - { - return IdNameStruct.IndFromId((int)m_SelOpeningType, m_OpeningTypeList); - } - set - { - m_SelOpeningType = (Openings)IdNameStruct.IdFromInd(value, m_OpeningTypeList); - m_Parent.RefreshHardwareList(); - m_Parent.RefreshHardwareOptionList(); - m_Parent.SetFirstHardware(); - m_Parent.ParentWindow.OnUpdatePreview(m_Parent.ParentWindow.sSerialized()); - } - } - - private bool m_bHasHandle; - public bool bHasHandle - { - get - { - return m_bHasHandle; - } - set - { - m_bHasHandle = value; - m_Parent.ParentWindow.OnUpdatePreview(m_Parent.ParentWindow.sSerialized()); - } - } - internal void SetHasHandle(bool value) - { - m_bHasHandle = value; - } - - private double m_dDimension; - public double dDimension - { - get - { - return m_dDimension; - } - set - { - // Controllo che il valore inserito sia compreso tra 0 e 100 - if (value > 0 && value < 100) - { - // se sono in percentuale - if (m_bIsRelative) - { - // verifico se ci sono assoluti - List RelativeDimList = m_Parent.SashList.Where(x => x.bIsRelative).ToList(); - if (RelativeDimList.Count > 0) - { - if (m_Parent.bIsPercentage) - { - int nIndex = RelativeDimList.IndexOf(this); - // se diminuisce dimensione - if (value < m_dDimension) - { - if (nIndex < RelativeDimList.Count - 1) - RelativeDimList[nIndex + 1].SetDimension(RelativeDimList[nIndex + 1].dDimension + (m_dDimension - value)); - else if (RelativeDimList.Count > 1) - RelativeDimList[nIndex - 1].SetDimension(RelativeDimList[nIndex - 1].dDimension + (m_dDimension - value)); - else - { - m_dDimension = 100; - return; - } - } - // se aumenta dimensione - else - { - double dRes = value; - // se non ultima anta - if (nIndex < RelativeDimList.Count - 1) - { - for (var nInd = 0; nInd <= nIndex - 1; nInd++) - dRes += RelativeDimList[nInd].dDimension; - dRes = (100 - dRes) / (RelativeDimList.Count - nIndex - 1); - for (var Ind = nIndex + 1; Ind <= RelativeDimList.Count - 1; Ind++) - RelativeDimList[Ind].SetDimension(dRes); - } - // se ultima anta - else if (RelativeDimList.Count > 1) - { - if (RelativeDimList.Count > 2) - { - for (var Ind = 0; Ind <= nIndex - 2; Ind++) - dRes += RelativeDimList[Ind].dDimension; - } - - //for (var Ind = nIndex + 1; Ind <= RelativeDimList.Count - 1; Ind++) - // dRes += RelativeDimList[Ind].dDimension; - dRes = (100 - dRes); - RelativeDimList[nIndex - 1].SetDimension(dRes); - //for (var nInd = 0; nInd <= nIndex - 1; nInd++) - // RelativeDimList[nInd].SetDimension(dRes); - } - else - { - m_dDimension = 100; - return; - } - } - } - } - } - m_dDimension = value; - m_Parent.ParentWindow.OnUpdatePreview(m_Parent.ParentWindow.sSerialized()); - } - } - } - internal void SetDimension(double dValue) - { - m_dDimension = dValue; - } - - public SashDimension Copy() - { - SashDimension newSashDim = new SashDimension(dDimension, bIsRelative, m_Parent, m_nSashId); - newSashDim.SetOpeningType(SelOpeningType); - newSashDim.SetHasHandle(bHasHandle); - return newSashDim; - } - - public SashDimension(double dDimension, bool bIsRelative, Sash Parent, int nSashId) - { - m_dDimension = dDimension; - m_bIsRelative = bIsRelative; - m_Parent = Parent; - m_nSashId = nSashId; - // assengno maniglia - if (Parent.SashList.Count == 0 || !Parent.SashList.Any(x => x.bHasHandle)) - m_bHasHandle = true; - // assegno tipo di anta - if (Parent.SashList.Count == 0) - SetOpeningType(Openings.TILTTURN_LEFT); - else if (Parent.SashList.Count == 1) - { - switch (Parent.SashList[0].OpeningType) - { - case Openings.TURNONLY_LEFT: - { - SetOpeningType(Openings.TURNONLY_RIGHT); - break; - } - - case Openings.TURNONLY_RIGHT: - { - SetOpeningType(Openings.TURNONLY_LEFT); - break; - } - - case Openings.TILTTURN_LEFT: - { - SetOpeningType(Openings.TURNONLY_RIGHT); - break; - } - - case Openings.TILTTURN_RIGHT: - { - SetOpeningType(Openings.TURNONLY_LEFT); - break; - } - - case Openings.TILTONLY_TOP: - { - SetOpeningType(Openings.TILTONLY_BOTTOM); - break; - } - - case Openings.TILTONLY_BOTTOM: - { - SetOpeningType(Openings.TILTONLY_TOP); - break; - } - - case Openings.COMPLANARSLIDE_LEFT: - { - SetOpeningType(Openings.COMPLANARSLIDE_RIGHT); - break; - } - - case Openings.COMPLANARSLIDE_RIGHT: - { - SetOpeningType(Openings.COMPLANARSLIDE_LEFT); - break; - } - - case Openings.LIFTSLIDE_LEFT: - { - SetOpeningType(Openings.LIFTSLIDE_RIGHT); - break; - } - - case Openings.LIFTSLIDE_RIGHT: - { - SetOpeningType(Openings.LIFTSLIDE_LEFT); - break; - } - } - } - else - SetOpeningType(Parent.SashList[Parent.SashList.Count - 1].OpeningType); - } - - internal JsonSashDimension Serialize() - { - JsonSashDimension JsonSashDimension = new JsonSashDimension(OpeningType, m_bHasHandle, m_dDimension, m_nSashId); - return JsonSashDimension; - } - } - - public class SplitDimension - { - // reference - private Split m_Parent; - - private bool m_bIsRelative = false; - public bool bIsRelative - { - get - { - return m_bIsRelative; - } - } - internal void SetIsRelative(bool value) - { - m_bIsRelative = value; - } - - private bool m_bIsVertListDim = false; - public bool bIsVertListDim - { - get - { - return m_bIsVertListDim; - } - } - internal void SetIsVertListDim(bool value) - { - m_bIsVertListDim = value; - } - - - private double m_dDimension; - public double dDimension - { - get - { - return m_dDimension; - } - set - { - // Controllo che il valore inserito sia compreso tra 0 e 100 - if (value > 0 && value < 100) - { - // se sono in percentuale - if (m_bIsRelative) - { - List RelativeDimList = new List(); - if (bIsVertListDim) - RelativeDimList = m_Parent.SplitVertList.Where(x => x.bIsRelative).ToList(); - else - RelativeDimList = m_Parent.SplitHorizList.Where(x => x.bIsRelative).ToList(); - // verifico se ci sono assoluti - //List RelativeDimList = m_Parent.SplitPositionList.Where(x => x.bIsRelative).ToList(); - if (RelativeDimList.Count > 0) - { - if (m_Parent.bIsPercentage) - { - int nIndex = RelativeDimList.IndexOf(this); - if (value < m_dDimension) - { - if (nIndex < RelativeDimList.Count - 1) - RelativeDimList[nIndex + 1].SetDimension(RelativeDimList[nIndex + 1].dDimension + (m_dDimension - value)); - else if (RelativeDimList.Count > 1) - RelativeDimList[nIndex - 1].SetDimension(RelativeDimList[nIndex - 1].dDimension + (m_dDimension - value)); - else - { - m_dDimension = 100; - return; - } - } - else - { - double dRes = value; - if (nIndex < RelativeDimList.Count - 1) - { - for (var nInd = 0; nInd <= nIndex - 1; nInd++) - dRes += RelativeDimList[nInd].dDimension; - dRes = (100 - dRes) / (RelativeDimList.Count - nIndex - 1); - if (dRes != 0) - { - for (var Ind = nIndex + 1; Ind <= RelativeDimList.Count - 1; Ind++) - RelativeDimList[Ind].SetDimension(dRes); - } - else - return; - } - else if (RelativeDimList.Count > 1) - { - if (RelativeDimList.Count > 2) - { - for (var Ind = 0; Ind <= nIndex - 2; Ind++) - dRes += RelativeDimList[Ind].dDimension; - } - dRes = (100 - dRes); - if (dRes != 0) - RelativeDimList[nIndex - 1].SetDimension(dRes); - else - return; - } - else - { - m_dDimension = 100; - return; - } - } - } - else - { - } - } - } - m_dDimension = value; - m_Parent.ParentWindow.OnUpdatePreview(m_Parent.ParentWindow.sSerialized()); - } - - } - } - internal void SetDimension(double dValue) - { - m_dDimension = dValue; - } - - public SplitDimension Copy() - { - SplitDimension newSplitDim = new SplitDimension(dDimension, bIsRelative, m_Parent, bIsVertListDim); - return newSplitDim; - } - public SplitDimension(double dDimension, bool bIsRelative, Split Parent, bool IsVertList) - { - m_dDimension = dDimension; - m_bIsRelative = bIsRelative; - m_Parent = Parent; - m_bIsVertListDim = IsVertList; - } - - internal JsonSplitDimension Serialize() - { - JsonSplitDimension JsonSplitDimension = new JsonSplitDimension(m_bIsRelative, m_dDimension); - return JsonSplitDimension; - } - } - public struct IdNameStruct { private int m_Id; diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 1ad4c53..4e8377a 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -27,7 +27,6 @@ - @@ -51,6 +50,9 @@ + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index d08ba87..8ea5b20 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -76,6 +76,9 @@ + + + From c6867f4c0dd28fefad32d4adfab99fa818072de6 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 10 Oct 2025 17:03:04 +0200 Subject: [PATCH 06/23] Completata separazione huge file --- WebWindowComplex/Models/AGBOptionCombo.cs | 54 +++ WebWindowComplex/Models/AGBOptionParameter.cs | 48 +++ WebWindowComplex/Models/AGBOptionText.cs | 43 +++ WebWindowComplex/Models/IdNameStruct.cs | 126 +++++++ WebWindowComplex/Models/OnPreviewEventArgs.cs | 26 ++ WebWindowComplex/Models/ParametriOpzioni.cs | 84 +++++ WebWindowComplex/Models/Window.cs | 340 +++--------------- WebWindowComplex/WebWindowComplex.csproj | 5 +- .../WebWindowConfigurator.csproj | 5 +- 9 files changed, 440 insertions(+), 291 deletions(-) create mode 100644 WebWindowComplex/Models/AGBOptionCombo.cs create mode 100644 WebWindowComplex/Models/AGBOptionParameter.cs create mode 100644 WebWindowComplex/Models/AGBOptionText.cs create mode 100644 WebWindowComplex/Models/IdNameStruct.cs create mode 100644 WebWindowComplex/Models/OnPreviewEventArgs.cs create mode 100644 WebWindowComplex/Models/ParametriOpzioni.cs diff --git a/WebWindowComplex/Models/AGBOptionCombo.cs b/WebWindowComplex/Models/AGBOptionCombo.cs new file mode 100644 index 0000000..8413114 --- /dev/null +++ b/WebWindowComplex/Models/AGBOptionCombo.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WebWindowComplex.Models +{ + public class AGBOptionCombo : ParametriOpzioni + { + #region Public Constructors + + public AGBOptionCombo(ParametriOpzioniParametri HdwOptionParam) : base(HdwOptionParam) + { + m_Type = HDWOPTIONTYPES.COMBO; + foreach (var Value in HdwOptionParam.Opzioni) + m_ValueList.Add(new AGBOptionParameter(Value.Valore, Value.DescrizioneOpzione)); + m_sValue = m_ValueList.FirstOrDefault(x => x.sValue == HdwOptionParam.ValoreCorrente) ?? new AGBOptionParameter("", ""); + } + + #endregion Public Constructors + + #region Public Properties + + public AGBOptionParameter sValue + { + get + { + return m_sValue; + } + set + { + m_sValue = value; + } + } + + public List ValueList + { + get + { + return m_ValueList; + } + } + + #endregion Public Properties + + #region Private Fields + + private AGBOptionParameter m_sValue; + private List m_ValueList = new List(); + + #endregion Private Fields + } +} \ No newline at end of file diff --git a/WebWindowComplex/Models/AGBOptionParameter.cs b/WebWindowComplex/Models/AGBOptionParameter.cs new file mode 100644 index 0000000..8e90c21 --- /dev/null +++ b/WebWindowComplex/Models/AGBOptionParameter.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WebWindowComplex.Models +{ + public class AGBOptionParameter + { + #region Public Constructors + + public AGBOptionParameter(string sValue, string sDescription) + { + m_sValue = sValue; + m_sDescription = sDescription; + } + + #endregion Public Constructors + + #region Public Properties + + public string sDescription + { + get + { + return m_sDescription; + } + } + + public string sValue + { + get + { + return m_sValue; + } + } + + #endregion Public Properties + + #region Private Fields + + private string m_sDescription; + private string m_sValue; + + #endregion Private Fields + } +} \ No newline at end of file diff --git a/WebWindowComplex/Models/AGBOptionText.cs b/WebWindowComplex/Models/AGBOptionText.cs new file mode 100644 index 0000000..252c814 --- /dev/null +++ b/WebWindowComplex/Models/AGBOptionText.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WebWindowComplex.Models +{ + public class AGBOptionText : ParametriOpzioni + { + #region Public Constructors + + public AGBOptionText(ParametriOpzioniParametri HdwOptionParam) : base(HdwOptionParam) + { + m_Type = HDWOPTIONTYPES.TEXT; + m_sValue = HdwOptionParam.ValoreCorrente; + } + + #endregion Public Constructors + + #region Public Properties + + public string sValue + { + get + { + return m_sValue; + } + set + { + m_sValue = value; + } + } + + #endregion Public Properties + + #region Private Fields + + private string m_sValue; + + #endregion Private Fields + } +} \ No newline at end of file diff --git a/WebWindowComplex/Models/IdNameStruct.cs b/WebWindowComplex/Models/IdNameStruct.cs new file mode 100644 index 0000000..06cf1af --- /dev/null +++ b/WebWindowComplex/Models/IdNameStruct.cs @@ -0,0 +1,126 @@ +namespace WebWindowComplex.Models +{ + public struct IdNameStruct + { + #region Public Constructors + + public IdNameStruct(int Id, string Name) + { + this = default(IdNameStruct); + m_Id = Id; + m_Name = Name; + } + + #endregion Public Constructors + + #region Public Properties + + public int Id + { + get + { + return m_Id; + } + set + { + m_Id = value; + } + } + + public string Name + { + get + { + return m_Name; + } + set + { + m_Name = value; + } + } + + #endregion Public Properties + + #region Public Methods + + public static int IdFromInd(int Ind, List List) + { + return List[Ind].Id; + } + + public static int IdFromInd(int Ind, List List) + { + if (List[Ind] is IdNameStruct) + { + return ((IdNameStruct)List[Ind]).Id; + } + + return 0; + } + + public static int IdFromName(string Name, List List) + { + checked + { + int num = List.Count - 1; + for (int i = 0; i <= num; i++) + { + if (string.Compare(((IdNameStruct)List[i]).Name, Name, false) == 0) + { + return ((IdNameStruct)List[i]).Id; + } + } + return 0; + } + } + + public static int IndFromId(int Id, List List) + { + checked + { + int num = List.Count - 1; + for (int i = 0; i <= num; i++) + { + if (List[i].Id == Id) + { + return i; + } + } + + return 0; + } + } + + public static int IndFromId(int Id, List List) + { + checked + { + int num = List.Count - 1; + for (int i = 0; i <= num; i++) + { + if (List[i] is IdNameStruct && ((IdNameStruct)List[i]).Id == Id) + { + return i; + } + } + + return 0; + } + } + + public override string ToString() + { + return Name; + } + + #endregion Public Methods + + #region Private Fields + + private int m_Id; + + private string m_Name; + + #endregion Private Fields + } +} \ No newline at end of file diff --git a/WebWindowComplex/Models/OnPreviewEventArgs.cs b/WebWindowComplex/Models/OnPreviewEventArgs.cs new file mode 100644 index 0000000..d6585e0 --- /dev/null +++ b/WebWindowComplex/Models/OnPreviewEventArgs.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WebWindowComplex.Models +{ + public class OnPreviewEventArgs : EventArgs + { + #region Public Fields + + public string sJwd; + + #endregion Public Fields + + #region Public Constructors + + public OnPreviewEventArgs(string sJwd) + { + this.sJwd = sJwd; + } + + #endregion Public Constructors + } +} \ No newline at end of file diff --git a/WebWindowComplex/Models/ParametriOpzioni.cs b/WebWindowComplex/Models/ParametriOpzioni.cs new file mode 100644 index 0000000..5ad6324 --- /dev/null +++ b/WebWindowComplex/Models/ParametriOpzioni.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using static WebWindowComplex.Json.WindowConst; + +namespace WebWindowComplex.Models +{ + public partial class ParametriOpzioni + { + #region Public Constructors + + public ParametriOpzioni(ParametriOpzioniParametri HdwOptionParam) + { + m_sName = HdwOptionParam.NomeParametro; + m_sDescription = HdwOptionParam.DescrizioneParametro; + m_OptVisibility = Visibility.VISIBLE; // If(HdwOptionParam.Visible.ToLower = "true", Visibility.Visible, Visibility.Collapsed) + } + + #endregion Public Constructors + + #region Public Enums + + public enum HDWOPTIONTYPES : int + { + TEXT = 1, + LENGHT = 2, + COMBO = 3 + } + + #endregion Public Enums + + #region Public Properties + + public Visibility OptVisibility + { + get + { + return m_OptVisibility; + } + } + + public string sDescription + { + get + { + return m_sDescription; + } + } + + public string sName + { + get + { + return m_sName; + } + } + + public HDWOPTIONTYPES Type + { + get + { + return m_Type; + } + } + + #endregion Public Properties + + #region Protected Fields + + protected HDWOPTIONTYPES m_Type; + + #endregion Protected Fields + + #region Private Fields + + private Visibility m_OptVisibility; + private string m_sDescription; + private string m_sName; + + #endregion Private Fields + } +} \ No newline at end of file diff --git a/WebWindowComplex/Models/Window.cs b/WebWindowComplex/Models/Window.cs index f6aac9c..3a41a7d 100644 --- a/WebWindowComplex/Models/Window.cs +++ b/WebWindowComplex/Models/Window.cs @@ -15,39 +15,28 @@ using static WebWindowComplex.ParametriOpzioni; namespace WebWindowComplex.Models { - public class Window { + #region Public Events + public event EventHandler OnPreview = delegate { }; - private string m_sProfilePath; - public string sProfilePath + #endregion Public Events + + #region Public Properties + + public List AreaList { get { - return m_sProfilePath; + return m_AreaList; } set { - m_sProfilePath = value; + m_AreaList = value; } } - private string m_sMaterial; - public string sMaterial - { - get - { - return m_sMaterial; - } - set - { - m_sMaterial = value; - OnUpdatePreview(sSerialized()); - } - } - - private string m_sColorMaterial; public string sColorMaterial { get @@ -61,7 +50,6 @@ namespace WebWindowComplex.Models } } - private string m_sGlass; public string sGlass { get @@ -75,16 +63,42 @@ namespace WebWindowComplex.Models } } - private List m_AreaList = new List(); - public List AreaList + public string sMaterial { get { - return m_AreaList; + return m_sMaterial; } set { - m_AreaList = value; + m_sMaterial = value; + OnUpdatePreview(sSerialized()); + } + } + + public string sProfilePath + { + get + { + return m_sProfilePath; + } + set + { + m_sProfilePath = value; + } + } + + #endregion Public Properties + + #region Internal Methods + + internal void OnUpdatePreview(string sJwd) + { + OnPreviewEventArgs e = new OnPreviewEventArgs(sJwd); + EventHandler handler = OnPreview; + if (handler != null) + { + handler(this, e); } } @@ -101,268 +115,16 @@ namespace WebWindowComplex.Models return JsonConvert.SerializeObject(Serialize(), Formatting.Indented); } - internal void OnUpdatePreview(string sJwd) - { - OnPreviewEventArgs e = new OnPreviewEventArgs(sJwd); - EventHandler handler = OnPreview; - if (handler != null) - { - handler(this, e); - } - } + #endregion Internal Methods + + #region Private Fields + + private List m_AreaList = new List(); + private string m_sColorMaterial; + private string m_sGlass; + private string m_sMaterial; + private string m_sProfilePath; + + #endregion Private Fields } - - public class OnPreviewEventArgs : EventArgs - { - public string sJwd; - - public OnPreviewEventArgs(string sJwd) - { - this.sJwd = sJwd; - } - } - - public partial class ParametriOpzioni - { - public enum HDWOPTIONTYPES : int - { - TEXT = 1, - LENGHT = 2, - COMBO = 3 - } - - protected HDWOPTIONTYPES m_Type; - public HDWOPTIONTYPES Type - { - get - { - return m_Type; - } - } - - private string m_sName; - public string sName - { - get - { - return m_sName; - } - } - - private string m_sDescription; - public string sDescription - { - get - { - return m_sDescription; - } - } - - private Visibility m_OptVisibility; - public Visibility OptVisibility - { - get - { - return m_OptVisibility; - } - } - - public ParametriOpzioni(ParametriOpzioniParametri HdwOptionParam) - { - m_sName = HdwOptionParam.NomeParametro; - m_sDescription = HdwOptionParam.DescrizioneParametro; - m_OptVisibility = Visibility.VISIBLE; // If(HdwOptionParam.Visible.ToLower = "true", Visibility.Visible, Visibility.Collapsed) - } - } - - public class AGBOptionCombo : ParametriOpzioni - { - private List m_ValueList = new List(); - public List ValueList - { - get - { - return m_ValueList; - } - } - - private AGBOptionParameter m_sValue; - public AGBOptionParameter sValue - { - get - { - return m_sValue; - } - set - { - m_sValue = value; - } - } - - public AGBOptionCombo(ParametriOpzioniParametri HdwOptionParam) : base(HdwOptionParam) - { - m_Type = HDWOPTIONTYPES.COMBO; - foreach (var Value in HdwOptionParam.Opzioni) - m_ValueList.Add(new AGBOptionParameter(Value.Valore, Value.DescrizioneOpzione)); - m_sValue = m_ValueList.FirstOrDefault(x => x.sValue == HdwOptionParam.ValoreCorrente) ?? new AGBOptionParameter("", ""); - } - } - - public class AGBOptionParameter - { - private string m_sValue; - public string sValue - { - get - { - return m_sValue; - } - } - - private string m_sDescription; - public string sDescription - { - get - { - return m_sDescription; - } - } - - public AGBOptionParameter(string sValue, string sDescription) - { - m_sValue = sValue; - m_sDescription = sDescription; - } - } - - public class AGBOptionText : ParametriOpzioni - { - private string m_sValue; - public string sValue - { - get - { - return m_sValue; - } - set - { - m_sValue = value; - } - } - - public AGBOptionText(ParametriOpzioniParametri HdwOptionParam) : base(HdwOptionParam) - { - m_Type = HDWOPTIONTYPES.TEXT; - m_sValue = HdwOptionParam.ValoreCorrente; - } - } - - public struct IdNameStruct - { - private int m_Id; - - private string m_Name; - - public int Id - { - get - { - return m_Id; - } - set - { - m_Id = value; - } - } - - public string Name - { - get - { - return m_Name; - } - set - { - m_Name = value; - } - } - - public IdNameStruct(int Id, string Name) - { - this = default(IdNameStruct); - m_Id = Id; - m_Name = Name; - } - - public override string ToString() - { - return Name; - } - - public static int IndFromId(int Id, List List) - { - checked - { - int num = List.Count - 1; - for (int i = 0; i <= num; i++) - { - if (List[i].Id == Id) - { - return i; - } - } - - return 0; - } - } - - public static int IdFromInd(int Ind, List List) - { - return List[Ind].Id; - } - - public static int IndFromId(int Id, List List) - { - checked - { - int num = List.Count - 1; - for (int i = 0; i <= num; i++) - { - if (List[i] is IdNameStruct && ((IdNameStruct)List[i]).Id == Id) - { - return i; - } - } - - return 0; - } - } - - public static int IdFromInd(int Ind, List List) - { - if (List[Ind] is IdNameStruct) - { - return ((IdNameStruct)List[Ind]).Id; - } - - return 0; - } - - public static int IdFromName(string Name, List List) - { - checked - { - int num = List.Count - 1; - for (int i = 0; i <= num; i++) - { - if (string.Compare(((IdNameStruct)List[i]).Name, Name, false) == 0) - { - return ((IdNameStruct)List[i]).Id; - } - } - return 0; - } - } - } - -} +} \ No newline at end of file diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 4e8377a..452cdf6 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1016 + 2.7.10.1017 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -52,6 +52,9 @@ + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 8ea5b20..1b82b4e 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1016 + 2.7.10.1017 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -79,6 +79,9 @@ + + + From 01f7e5b0724ba290863e52ff008f1e4b429cd8fa Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 10 Oct 2025 17:05:25 +0200 Subject: [PATCH 07/23] Inizio riorganizzazione sotto-componenti --- WebWindowComplex/{ => Compo}/AreaFrame.razor | 0 WebWindowComplex/{ => Compo}/AreaFrame.razor.cs | 2 +- WebWindowComplex/{ => Compo}/AreaSplit.razor | 0 WebWindowComplex/{ => Compo}/AreaSplit.razor.cs | 2 +- WebWindowComplex/{ => Compo}/General.razor | 0 WebWindowComplex/{ => Compo}/General.razor.cs | 2 +- WebWindowComplex/WebWindowComplex.csproj | 6 ++---- WebWindowComplex/_Imports.razor | 1 + WebWindowConfigurator/WebWindowConfigurator.csproj | 2 ++ 9 files changed, 8 insertions(+), 7 deletions(-) rename WebWindowComplex/{ => Compo}/AreaFrame.razor (100%) rename WebWindowComplex/{ => Compo}/AreaFrame.razor.cs (97%) rename WebWindowComplex/{ => Compo}/AreaSplit.razor (100%) rename WebWindowComplex/{ => Compo}/AreaSplit.razor.cs (96%) rename WebWindowComplex/{ => Compo}/General.razor (100%) rename WebWindowComplex/{ => Compo}/General.razor.cs (98%) diff --git a/WebWindowComplex/AreaFrame.razor b/WebWindowComplex/Compo/AreaFrame.razor similarity index 100% rename from WebWindowComplex/AreaFrame.razor rename to WebWindowComplex/Compo/AreaFrame.razor diff --git a/WebWindowComplex/AreaFrame.razor.cs b/WebWindowComplex/Compo/AreaFrame.razor.cs similarity index 97% rename from WebWindowComplex/AreaFrame.razor.cs rename to WebWindowComplex/Compo/AreaFrame.razor.cs index 285533f..67790d5 100644 --- a/WebWindowComplex/AreaFrame.razor.cs +++ b/WebWindowComplex/Compo/AreaFrame.razor.cs @@ -1,7 +1,7 @@ using Microsoft.AspNetCore.Components; using WebWindowComplex.Models; -namespace WebWindowComplex +namespace WebWindowComplex.Compo { public partial class AreaFrame { diff --git a/WebWindowComplex/AreaSplit.razor b/WebWindowComplex/Compo/AreaSplit.razor similarity index 100% rename from WebWindowComplex/AreaSplit.razor rename to WebWindowComplex/Compo/AreaSplit.razor diff --git a/WebWindowComplex/AreaSplit.razor.cs b/WebWindowComplex/Compo/AreaSplit.razor.cs similarity index 96% rename from WebWindowComplex/AreaSplit.razor.cs rename to WebWindowComplex/Compo/AreaSplit.razor.cs index 31efbe9..b8a2873 100644 --- a/WebWindowComplex/AreaSplit.razor.cs +++ b/WebWindowComplex/Compo/AreaSplit.razor.cs @@ -1,7 +1,7 @@ using Microsoft.AspNetCore.Components; using WebWindowComplex.Models; -namespace WebWindowComplex +namespace WebWindowComplex.Compo { public partial class AreaSplit { diff --git a/WebWindowComplex/General.razor b/WebWindowComplex/Compo/General.razor similarity index 100% rename from WebWindowComplex/General.razor rename to WebWindowComplex/Compo/General.razor diff --git a/WebWindowComplex/General.razor.cs b/WebWindowComplex/Compo/General.razor.cs similarity index 98% rename from WebWindowComplex/General.razor.cs rename to WebWindowComplex/Compo/General.razor.cs index 907f980..11ae6f3 100644 --- a/WebWindowComplex/General.razor.cs +++ b/WebWindowComplex/Compo/General.razor.cs @@ -2,7 +2,7 @@ using Microsoft.AspNetCore.Components; using WebWindowComplex.DTO; using WebWindowComplex.Models; -namespace WebWindowComplex +namespace WebWindowComplex.Compo { public partial class General { diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 452cdf6..c590384 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -24,10 +24,6 @@ - - - - @@ -56,6 +52,8 @@ + + diff --git a/WebWindowComplex/_Imports.razor b/WebWindowComplex/_Imports.razor index 123a7e8..ea6d3fc 100644 --- a/WebWindowComplex/_Imports.razor +++ b/WebWindowComplex/_Imports.razor @@ -1,3 +1,4 @@ @using Microsoft.AspNetCore.Components.Web @using WebWindowComplex +@using WebWindowComplex.Compo @using WebWindowComplex.Models \ No newline at end of file diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 1b82b4e..6506193 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -83,6 +83,8 @@ + + From 89bcf9e3969112ed7f3596ce2f84bfb05d19d1e0 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 10 Oct 2025 17:35:31 +0200 Subject: [PATCH 08/23] Gestione componente CardFill --- WebWindowComplex/Compo/CardFill.razor | 76 +++++++++++++++++++ WebWindowComplex/Compo/CardFill.razor.cs | 68 +++++++++++++++++ WebWindowComplex/TableComp.razor | 35 +-------- WebWindowComplex/WebWindowComplex.csproj | 3 + .../WebWindowConfigurator.csproj | 7 ++ 5 files changed, 157 insertions(+), 32 deletions(-) create mode 100644 WebWindowComplex/Compo/CardFill.razor create mode 100644 WebWindowComplex/Compo/CardFill.razor.cs diff --git a/WebWindowComplex/Compo/CardFill.razor b/WebWindowComplex/Compo/CardFill.razor new file mode 100644 index 0000000..b17024b --- /dev/null +++ b/WebWindowComplex/Compo/CardFill.razor @@ -0,0 +1,76 @@ + +
+
+
+
+

Fill @(CurrIndex + 1)

+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+
+
+
Selected all fill
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+@foreach (var currSplitted in SplittedList) +{ + @if (currSplitted.AreaList[0].Equals(CurrItem)) + { + @*
+
+
+
+ @if (SplittedList.Count > 1) + { +

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

+ } + else + { +

Area split

+ } +
+
+
+ +
+
+ @foreach (var Index in SashList) + { +
+
+ +
+
+ } +
+
+
*@ + + @* *@ + } +} + diff --git a/WebWindowComplex/Compo/CardFill.razor.cs b/WebWindowComplex/Compo/CardFill.razor.cs new file mode 100644 index 0000000..6a36478 --- /dev/null +++ b/WebWindowComplex/Compo/CardFill.razor.cs @@ -0,0 +1,68 @@ +using Microsoft.AspNetCore.Components; +using WebWindowComplex.Models; +using static WebWindowComplex.Json.WindowConst; + +namespace WebWindowComplex.Compo +{ + public partial class CardFill + { + #region Public Properties + + [Parameter] + public int CurrIndex { get; set; } = 0; + + [Parameter] + public Fill CurrItem { get; set; } = null!; + + [Parameter] + public EventCallback EC_ChangeAllType { get; set; } + + [Parameter] + public EventCallback EC_ChangeType { get; set; } + + [Parameter] + public List FillList { get; set; } = null!; + + [Parameter] + public List SashList { get; set; } = null!; + + [Parameter] + public List SplittedList { get; set; } = null!; + + #endregion Public Properties + + #region Protected Methods + + protected async Task ChangeAllFill(FillTypes reqFillType) + { + await EC_ChangeAllType.InvokeAsync(reqFillType); + } + + protected async Task ChangeOneFill(FillTypes reqFillType) + { + await EC_ChangeType.InvokeAsync(reqFillType); + } + + #endregion Protected Methods + + #region Private Methods + + /// + /// Calcola bottone selezionato per il Fill + /// + /// + private string buttonFillCss(FillTypes reqFillTypes) + { + return (FillList.ElementAt(CurrIndex).SelFillType == reqFillTypes) ? "btn btn-secondary btn-sm" : "btn btn-outline-secondary btn-sm"; + +#if false + if (FillList.ElementAt(CurrIndex).SelFillType == reqFillTypes) + return "btn btn-secondary btn-sm"; + else + return "btn btn-outline-secondary btn-sm"; +#endif + } + + #endregion Private Methods + } +} \ No newline at end of file diff --git a/WebWindowComplex/TableComp.razor b/WebWindowComplex/TableComp.razor index f47ea48..f92f930 100644 --- a/WebWindowComplex/TableComp.razor +++ b/WebWindowComplex/TableComp.razor @@ -696,7 +696,8 @@ else { Fill item = FillList[currFill]; -
+ + @*
@@ -740,44 +741,14 @@ { @if (currSplitted.AreaList[0].Equals(item)) { - @*
-
-
-
- @if (SplittedList.Count > 1) - { -

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

- } - else - { -

Area split

- } -
-
-
- -
-
- @foreach (var Index in SashList) - { -
-
- -
-
- } -
-
-
*@ - @* *@ } }
-
+ *@ } } else if (currStep == CompileStep.General) diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index c590384..01136b3 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -53,6 +53,9 @@ + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 6506193..0b24817 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -80,6 +80,13 @@ + + + + + + + From 566dc8cf0405eb8690a82e29c0fb44d3e93353e3 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 10 Oct 2025 17:35:51 +0200 Subject: [PATCH 09/23] Eliminato area precedente CardFill --- WebWindowComplex/TableComp.razor | 52 -------------------------------- 1 file changed, 52 deletions(-) diff --git a/WebWindowComplex/TableComp.razor b/WebWindowComplex/TableComp.razor index f92f930..b9435fe 100644 --- a/WebWindowComplex/TableComp.razor +++ b/WebWindowComplex/TableComp.razor @@ -697,58 +697,6 @@ { Fill item = FillList[currFill]; - @*
-
-
-
-
-
-
-
-
-

Fill @(currFill + 1)

-
-
-
- -
-
-
-
- -
-
-
-
-
-
-
Selected all fill
-
-
-
- -
-
-
-
- -
-
-
-
-
- @foreach (var currSplitted in SplittedList) - { - @if (currSplitted.AreaList[0].Equals(item)) - { - - } - } -
-
-
-
-
*@ } } else if (currStep == CompileStep.General) From bd0e3536fb25ff95fc17195948b4e7ab614db113 Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Mon, 13 Oct 2025 10:41:03 +0200 Subject: [PATCH 10/23] Gestione componente AreaSplit in CardFill --- WebWindowComplex/Compo/AreaSplit.razor | 30 +++++++------- WebWindowComplex/Compo/AreaSplit.razor.cs | 21 ++++++++-- WebWindowComplex/Compo/CardFill.razor | 40 +++++++++++-------- WebWindowComplex/Compo/CardFill.razor.cs | 24 +++++++---- WebWindowComplex/Compo/General.razor | 2 +- WebWindowComplex/TableComp.razor | 10 ++--- WebWindowComplex/TableComp.razor.cs | 5 ++- WebWindowComplex/WebWindowComplex.csproj | 13 +++++- .../WebWindowConfigurator.csproj | 16 +++++++- 9 files changed, 109 insertions(+), 52 deletions(-) diff --git a/WebWindowComplex/Compo/AreaSplit.razor b/WebWindowComplex/Compo/AreaSplit.razor index 2d36571..cf8a058 100644 --- a/WebWindowComplex/Compo/AreaSplit.razor +++ b/WebWindowComplex/Compo/AreaSplit.razor @@ -1,30 +1,30 @@ -
+
-
-
+
+
@if (CurrSplittedList.Count > 1) { -

Area split @(CurrSplittedList.IndexOf(CurrSplitted) + 1)

+
Area split @(CurrSplittedList.IndexOf(CurrSplitted) + 1)
} else { -

Area split

+
Area split
}
-
+
- @for (int j = 0; j < CurrSashList.Count; j++) - { - int Index = j; -
-
- -
-
- } +
+ @for (int j = 0; j < CurrSashList.Count; j++) + { + int Index = j; +
+ +
+ } +
diff --git a/WebWindowComplex/Compo/AreaSplit.razor.cs b/WebWindowComplex/Compo/AreaSplit.razor.cs index b8a2873..1c03182 100644 --- a/WebWindowComplex/Compo/AreaSplit.razor.cs +++ b/WebWindowComplex/Compo/AreaSplit.razor.cs @@ -1,4 +1,5 @@ -using Microsoft.AspNetCore.Components; +using Egw.Window.Data; +using Microsoft.AspNetCore.Components; using WebWindowComplex.Models; namespace WebWindowComplex.Compo @@ -17,7 +18,7 @@ namespace WebWindowComplex.Compo public List CurrSplittedList { get; set; } = null; [Parameter] - public EventCallback EC_CopySash { get; set; } + public EventCallback EC_CopySash { get; set; } #endregion Public Properties @@ -27,11 +28,23 @@ namespace WebWindowComplex.Compo /// Sollevo evento richiesta copia sash /// /// - private async Task RaiseCopySash(int indexCurrSash) + private async Task RaiseCopySash(Splitted item, int indexCurrSash) { - await EC_CopySash.InvokeAsync(indexCurrSash); + var Args = new Data + { + splitted = item, + index = indexCurrSash, + }; + await EC_CopySash.InvokeAsync(Args); } #endregion Private Methods + + } + + public class Data + { + public Splitted splitted { get; set; } + public int index { get; set; } } } \ No newline at end of file diff --git a/WebWindowComplex/Compo/CardFill.razor b/WebWindowComplex/Compo/CardFill.razor index b17024b..346943b 100644 --- a/WebWindowComplex/Compo/CardFill.razor +++ b/WebWindowComplex/Compo/CardFill.razor @@ -1,34 +1,41 @@  -
+
-
-
-

Fill @(CurrIndex + 1)

+
+
+
Fill @(CurrIndex + 1)
-
+
+ +
+
+
+
+
+
+
Select only current fill
+
+
-
+
-
-
-
-
-
-
Selected all fill
+
+
+
Selected all fill
-
+
-
+
@@ -38,7 +45,7 @@
@foreach (var currSplitted in SplittedList) { - @if (currSplitted.AreaList[0].Equals(CurrItem)) + @if (currSplitted.AreaList.First().Equals(CurrItem)) { @*
@@ -69,8 +76,7 @@
*@ - - @* *@ + } } diff --git a/WebWindowComplex/Compo/CardFill.razor.cs b/WebWindowComplex/Compo/CardFill.razor.cs index 6a36478..cc5cbe3 100644 --- a/WebWindowComplex/Compo/CardFill.razor.cs +++ b/WebWindowComplex/Compo/CardFill.razor.cs @@ -20,6 +20,12 @@ namespace WebWindowComplex.Compo [Parameter] public EventCallback EC_ChangeType { get; set; } + [Parameter] + public EventCallback EC_CopySash { get; set; } + + [Parameter] + public EventCallback EC_ReqClose { get; set; } + [Parameter] public List FillList { get; set; } = null!; @@ -29,6 +35,7 @@ namespace WebWindowComplex.Compo [Parameter] public List SplittedList { get; set; } = null!; + #endregion Public Properties #region Protected Methods @@ -43,6 +50,11 @@ namespace WebWindowComplex.Compo await EC_ChangeType.InvokeAsync(reqFillType); } + protected async Task CopySash(Data Args) + { + await EC_CopySash.InvokeAsync(Args); + } + #endregion Protected Methods #region Private Methods @@ -54,15 +66,13 @@ namespace WebWindowComplex.Compo private string buttonFillCss(FillTypes reqFillTypes) { return (FillList.ElementAt(CurrIndex).SelFillType == reqFillTypes) ? "btn btn-secondary btn-sm" : "btn btn-outline-secondary btn-sm"; - -#if false - if (FillList.ElementAt(CurrIndex).SelFillType == reqFillTypes) - return "btn btn-secondary btn-sm"; - else - return "btn btn-outline-secondary btn-sm"; -#endif } #endregion Private Methods + + private void ReqClose() + { + _ = EC_ReqClose.InvokeAsync(true); + } } } \ No newline at end of file diff --git a/WebWindowComplex/Compo/General.razor b/WebWindowComplex/Compo/General.razor index d041093..1dadeb1 100644 --- a/WebWindowComplex/Compo/General.razor +++ b/WebWindowComplex/Compo/General.razor @@ -1,5 +1,5 @@  -
+
diff --git a/WebWindowComplex/TableComp.razor b/WebWindowComplex/TableComp.razor index b9435fe..3777e8a 100644 --- a/WebWindowComplex/TableComp.razor +++ b/WebWindowComplex/TableComp.razor @@ -40,7 +40,7 @@
-
+
-
+
@if (currStep != CompileStep.Template) { }
-
+
-
+
@@ -696,7 +696,7 @@ else { Fill item = FillList[currFill]; - + } } else if (currStep == CompileStep.General) diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index 736fbd4..7d982e0 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Components; using Newtonsoft.Json; using System.Reflection.Metadata; +using WebWindowComplex.Compo; using WebWindowComplex.DTO; using WebWindowComplex.Json; using WebWindowComplex.Models; @@ -974,8 +975,10 @@ namespace WebWindowComplex /// Area Splitted corrente /// Indice della Sash che si vuole copiare /// - private async Task CopySash(Splitted currSplitted, int numSash) + private async Task CopySash(Data Args) { + Splitted currSplitted = Args.splitted; + int numSash = Args.index; //Rimuovo contenuto di Splitted e rimuovo area da conteggio gruppi currSplitted.AreaList.RemoveAll(i => i != null); //Area.DelCounterGroup(); diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 01136b3..e6c1883 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1017 + 2.7.10.1310 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -49,6 +49,17 @@ + + + + + + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 0b24817..d3afbe3 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1017 + 2.7.10.1310 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -80,6 +80,20 @@ + + + + + + + + + + + + + + From d7cfc9de292e19652dcf11f00371c45b7924293e Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Mon, 13 Oct 2025 12:20:15 +0200 Subject: [PATCH 11/23] - Aggiunto componente CardTree - Aggiunti commenti - Enum di TableComp portati in un file esterno (LayoutConst) --- WebWindowComplex/Compo/AreaSplit.razor | 8 +- WebWindowComplex/Compo/AreaSplit.razor.cs | 21 +- WebWindowComplex/Compo/CardFill.razor.cs | 58 ++++- WebWindowComplex/Compo/CardTree.razor | 45 ++++ WebWindowComplex/Compo/CardTree.razor.cs | 139 +++++++++++ WebWindowComplex/LayoutConst.cs | 30 +++ WebWindowComplex/TableComp.razor | 54 +---- WebWindowComplex/TableComp.razor.cs | 216 +++++++++--------- WebWindowComplex/WebWindowComplex.csproj | 11 +- .../WebWindowConfigurator.csproj | 9 +- 10 files changed, 413 insertions(+), 178 deletions(-) create mode 100644 WebWindowComplex/Compo/CardTree.razor create mode 100644 WebWindowComplex/Compo/CardTree.razor.cs create mode 100644 WebWindowComplex/LayoutConst.cs diff --git a/WebWindowComplex/Compo/AreaSplit.razor b/WebWindowComplex/Compo/AreaSplit.razor index cf8a058..4a3400a 100644 --- a/WebWindowComplex/Compo/AreaSplit.razor +++ b/WebWindowComplex/Compo/AreaSplit.razor @@ -19,10 +19,10 @@
@for (int j = 0; j < CurrSashList.Count; j++) { - int Index = j; -
- -
+ int Index = j; +
+ +
}
diff --git a/WebWindowComplex/Compo/AreaSplit.razor.cs b/WebWindowComplex/Compo/AreaSplit.razor.cs index 1c03182..c7c87b4 100644 --- a/WebWindowComplex/Compo/AreaSplit.razor.cs +++ b/WebWindowComplex/Compo/AreaSplit.razor.cs @@ -8,17 +8,29 @@ namespace WebWindowComplex.Compo { #region Public Properties + /// + /// Lista delle sash + /// [Parameter] public List CurrSashList { get; set; } = null; + /// + /// Oggetto splitted corrente + /// [Parameter] public Splitted CurrSplitted { get; set; } = null; + /// + /// Lista degli Splitted + /// [Parameter] public List CurrSplittedList { get; set; } = null; + /// + /// Evento per copiare Sash + /// [Parameter] - public EventCallback EC_CopySash { get; set; } + public EventCallback EC_CopySash { get; set; } #endregion Public Properties @@ -30,7 +42,7 @@ namespace WebWindowComplex.Compo /// private async Task RaiseCopySash(Splitted item, int indexCurrSash) { - var Args = new Data + var Args = new DataAreaSplit { splitted = item, index = indexCurrSash, @@ -42,7 +54,10 @@ namespace WebWindowComplex.Compo } - public class Data + /// + /// Classe per raggruppare oggetti che servono per copiare Sash + /// + public class DataAreaSplit { public Splitted splitted { get; set; } public int index { get; set; } diff --git a/WebWindowComplex/Compo/CardFill.razor.cs b/WebWindowComplex/Compo/CardFill.razor.cs index cc5cbe3..36e4f4f 100644 --- a/WebWindowComplex/Compo/CardFill.razor.cs +++ b/WebWindowComplex/Compo/CardFill.razor.cs @@ -8,30 +8,57 @@ namespace WebWindowComplex.Compo { #region Public Properties + /// + /// Indice del fill corrente rispetto alla lista fill + /// [Parameter] public int CurrIndex { get; set; } = 0; + /// + /// Fill corrente rispetto alla lista fill + /// [Parameter] public Fill CurrItem { get; set; } = null!; + /// + /// Evento per cambiare tutti i fill + /// [Parameter] public EventCallback EC_ChangeAllType { get; set; } + /// + /// Evento per cambiare solo il fill corrente + /// [Parameter] public EventCallback EC_ChangeType { get; set; } + /// + /// Evento per copiare sash + /// [Parameter] - public EventCallback EC_CopySash { get; set; } + public EventCallback EC_CopySash { get; set; } + /// + /// Evento per tornare nella pagine Tree + /// [Parameter] public EventCallback EC_ReqClose { get; set; } + /// + /// Lista dei Fill + /// [Parameter] public List FillList { get; set; } = null!; + /// + /// Lista delle sash + /// [Parameter] public List SashList { get; set; } = null!; + /// + /// Lista degli Splitted + /// [Parameter] public List SplittedList { get; set; } = null!; @@ -40,17 +67,32 @@ namespace WebWindowComplex.Compo #region Protected Methods + /// + /// Sollevo evento per cambiare tutti i Fill + /// + /// tipo di fill richiesto + /// protected async Task ChangeAllFill(FillTypes reqFillType) { await EC_ChangeAllType.InvokeAsync(reqFillType); } + /// + /// Sollevo evento per cambiare solo il Fill corrente + /// + /// tipo di fill richiesto + /// protected async Task ChangeOneFill(FillTypes reqFillType) { await EC_ChangeType.InvokeAsync(reqFillType); } - protected async Task CopySash(Data Args) + /// + /// Sollevo evento per copiare sash + /// + /// + /// + protected async Task CopySash(DataAreaSplit Args) { await EC_CopySash.InvokeAsync(Args); } @@ -59,6 +101,14 @@ namespace WebWindowComplex.Compo #region Private Methods + /// + /// Sollevo evento per tornare alla pagina Tree + /// + private void ReqClose() + { + _ = EC_ReqClose.InvokeAsync(true); + } + /// /// Calcola bottone selezionato per il Fill /// @@ -70,9 +120,5 @@ namespace WebWindowComplex.Compo #endregion Private Methods - private void ReqClose() - { - _ = EC_ReqClose.InvokeAsync(true); - } } } \ No newline at end of file diff --git a/WebWindowComplex/Compo/CardTree.razor b/WebWindowComplex/Compo/CardTree.razor new file mode 100644 index 0000000..214df6d --- /dev/null +++ b/WebWindowComplex/Compo/CardTree.razor @@ -0,0 +1,45 @@ +@using static WebWindowComplex.LayoutConst + + + + @for (int i = 0; i < ItemTableList.Count; i++) + { + + @for (int j = 0; j < maxCol; j++) + { + CompileStep cs = CompileStep.Frame; + int ind = -1; + @if (j + 1 == ItemTableList[i].Col) + { + @if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.FRAME) + { + cs = CompileStep.Frame; + } + 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)
\ No newline at end of file diff --git a/WebWindowComplex/Compo/CardTree.razor.cs b/WebWindowComplex/Compo/CardTree.razor.cs new file mode 100644 index 0000000..923541a --- /dev/null +++ b/WebWindowComplex/Compo/CardTree.razor.cs @@ -0,0 +1,139 @@ +using Microsoft.AspNetCore.Components; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using static WebWindowComplex.LayoutConst; + +namespace WebWindowComplex.Compo +{ + public partial class CardTree + { + /// + /// Lista oggetti ItemTable + /// + [Parameter] + public List ItemTableList { get; set; } = null!; + + /// + /// Numero massimo di colonne + /// + [Parameter] + public int maxCol { get; set; } = 0; + + /// + /// Evento richiesta prossimo step + /// + [Parameter] + public EventCallback EC_NextStep { get; set; } + + /// + /// Sollevo evento richiesta prossimo step + /// + /// + private async Task RaiseNextStep(CompileStep cs, int indexStep) + { + var Args = new DataNextStep + { + currCompileStep = cs, + index = indexStep, + }; + await EC_NextStep.InvokeAsync(Args); + } + + /// + /// Metodo per riempire tabella con contenuto vuoto o con i simboli per rappresentare la struttura + /// + /// riga della cella + /// colonna della cella + /// + private string FillTable(int row, int col) + { + 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 <= 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 " "; + } + } + } + + /// + /// Classe per inserire dati per NextStep + /// + public class DataNextStep + { + public CompileStep currCompileStep { get; set; } + public int index { get; set; } + } +} diff --git a/WebWindowComplex/LayoutConst.cs b/WebWindowComplex/LayoutConst.cs new file mode 100644 index 0000000..0c16781 --- /dev/null +++ b/WebWindowComplex/LayoutConst.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WebWindowComplex +{ + public partial class LayoutConst + { + public enum CompileStep + { + Template = 0, + Tree = 1, + Frame, + Split, + Sash, + Fill, + General + } + + public enum PositionJoints + { + BL = 0, // Bottom Left + BR = 1, // Bottom Right + TR, // Top Right + TL // Top Left + } + } +} diff --git a/WebWindowComplex/TableComp.razor b/WebWindowComplex/TableComp.razor index 3777e8a..31f2207 100644 --- a/WebWindowComplex/TableComp.razor +++ b/WebWindowComplex/TableComp.razor @@ -1,4 +1,5 @@ -
+@using static WebWindowComplex.LayoutConst +
@if (isLoading) { @@ -59,10 +60,10 @@ @if (FrameWindow != null) { } @@ -117,52 +118,7 @@ } @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) - { - cs = CompileStep.Frame; - } - 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) { diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index 7d982e0..ef36db4 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -6,7 +6,9 @@ using WebWindowComplex.Compo; using WebWindowComplex.DTO; using WebWindowComplex.Json; using WebWindowComplex.Models; +using static WebWindowComplex.LayoutConst; using static WebWindowComplex.Json.WindowConst; +//using static WebWindowComplex.Compo.CardTree; namespace WebWindowComplex { @@ -88,29 +90,6 @@ namespace WebWindowComplex #endregion Protected Fields - #region Protected Enums - - protected enum CompileStep - { - Template = 0, - Tree = 1, - Frame, - Split, - Sash, - Fill, - General - } - - protected enum PositionJoints - { - BL = 0, // Bottom Left - BR = 1, // Bottom Right - TR, // Top Right - TL // Top Left - } - - #endregion Protected Enums - #region Protected Properties protected List FillList @@ -975,7 +954,7 @@ namespace WebWindowComplex /// Area Splitted corrente /// Indice della Sash che si vuole copiare /// - private async Task CopySash(Data Args) + private async Task CopySash(DataAreaSplit Args) { Splitted currSplitted = Args.splitted; int numSash = Args.index; @@ -990,90 +969,92 @@ 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(int row, int col) - { - 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 " "; - } - } + ///// + ///// 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 @@ -1102,10 +1083,21 @@ namespace WebWindowComplex } /// - /// Metodo per cambiare step e aggiornare preview svg + /// Metodo per cambiare step + /// + /// argomenti passati dal componente + private void NextStepArgs(DataNextStep Args) + { + CompileStep newStep = Args.currCompileStep; + int Index = Args.index; + NextStep(newStep, Index); + } + + /// + /// Metodo per cambiare step /// /// step successivo - private void NextStepAndPreview(CompileStep newStep, int Index = -1) + private void NextStep(CompileStep newStep, int Index = 1) { editLock = true; currStep = newStep; @@ -1133,10 +1125,6 @@ namespace WebWindowComplex break; } } - -#if false - await DoPreviewSvg(); -#endif } /// diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index e6c1883..856e81f 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1310 + 2.7.10.1312 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -61,6 +61,15 @@ + + + + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index d3afbe3..3368837 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1310 + 2.7.10.1312 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -101,6 +101,13 @@ + + + + + + + From 698cc69b4c617f79a25de806df51a228a6b48caf Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Mon, 13 Oct 2025 13:36:03 +0200 Subject: [PATCH 12/23] Aggiunto componente CardFrame --- WebWindowComplex/Compo/AreaFrame.razor | 15 +-- WebWindowComplex/Compo/AreaFrame.razor.cs | 4 +- WebWindowComplex/Compo/CardFill.razor | 29 ---- WebWindowComplex/Compo/CardFrame.razor | 115 ++++++++++++++++ WebWindowComplex/Compo/CardFrame.razor.cs | 99 ++++++++++++++ WebWindowComplex/TableComp.razor | 125 +----------------- WebWindowComplex/TableComp.razor.cs | 31 ++++- WebWindowComplex/WebWindowComplex.csproj | 15 ++- .../WebWindowConfigurator.csproj | 7 +- 9 files changed, 276 insertions(+), 164 deletions(-) create mode 100644 WebWindowComplex/Compo/CardFrame.razor create mode 100644 WebWindowComplex/Compo/CardFrame.razor.cs diff --git a/WebWindowComplex/Compo/AreaFrame.razor b/WebWindowComplex/Compo/AreaFrame.razor index 1b068c2..1b1de08 100644 --- a/WebWindowComplex/Compo/AreaFrame.razor +++ b/WebWindowComplex/Compo/AreaFrame.razor @@ -1,19 +1,18 @@ -
-
-
-
-

Area frame

+
+
+
+
+
Area frame
-
+
@if (CurrSashList.Count == 0 && CurrSplitList.Count == 0) { -
}
-
+
@if (!(CurrFrameWindow.AreaList[0] is Split)) {
diff --git a/WebWindowComplex/Compo/AreaFrame.razor.cs b/WebWindowComplex/Compo/AreaFrame.razor.cs index 67790d5..b74d237 100644 --- a/WebWindowComplex/Compo/AreaFrame.razor.cs +++ b/WebWindowComplex/Compo/AreaFrame.razor.cs @@ -20,7 +20,7 @@ namespace WebWindowComplex.Compo public EventCallback EC_AddSash { get; set; } [Parameter] - public EventCallback EC_AddWindow { get; set; } + public EventCallback EC_AddSplit { get; set; } #endregion Public Properties @@ -41,7 +41,7 @@ namespace WebWindowComplex.Compo /// private async Task RaiseAddSplit() { - await EC_AddWindow.InvokeAsync(true); + await EC_AddSplit.InvokeAsync(true); } #endregion Private Methods diff --git a/WebWindowComplex/Compo/CardFill.razor b/WebWindowComplex/Compo/CardFill.razor index 346943b..f09bdec 100644 --- a/WebWindowComplex/Compo/CardFill.razor +++ b/WebWindowComplex/Compo/CardFill.razor @@ -47,35 +47,6 @@ { @if (currSplitted.AreaList.First().Equals(CurrItem)) { - @*
-
-
-
- @if (SplittedList.Count > 1) - { -

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

- } - else - { -

Area split

- } -
-
-
- -
-
- @foreach (var Index in SashList) - { -
-
- -
-
- } -
-
-
*@ } } diff --git a/WebWindowComplex/Compo/CardFrame.razor b/WebWindowComplex/Compo/CardFrame.razor new file mode 100644 index 0000000..6a1c1ca --- /dev/null +++ b/WebWindowComplex/Compo/CardFrame.razor @@ -0,0 +1,115 @@ +@using static WebWindowComplex.LayoutConst + +
+
+
+
+
Frame
+
+
+ +
+
+
+
+
+
+
+ + +
+
+
+
+
+
+
Dimension
+ @foreach (FrameDimension dimension in FrameWindow.DimensionList) + { +
+ @dimension.sName + + mm +
+ } +
+
+
Threshold
+
+ + +
+
+
+
+
+
+
+
+
Joints
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ @foreach (Joint joint in FrameWindow.JointList) + { +
+ + +
+ } +
+
+
+ @if (SashList.Count == 0) + { +
+
Bottom rail
+
+
+
+ Quantity + +
+
+ } +
+
+
+
+ +@if (!(FrameWindow.AreaList[0] is Split) || (SashList.Count == 0 && SplitList.Count == 0)) +{ + +} + \ No newline at end of file diff --git a/WebWindowComplex/Compo/CardFrame.razor.cs b/WebWindowComplex/Compo/CardFrame.razor.cs new file mode 100644 index 0000000..7380261 --- /dev/null +++ b/WebWindowComplex/Compo/CardFrame.razor.cs @@ -0,0 +1,99 @@ +using Microsoft.AspNetCore.Components; +using WebWindowComplex.Models; + +namespace WebWindowComplex.Compo +{ + public partial class CardFrame + { + /// + /// Frame corrente + /// + [Parameter] + public Frame FrameWindow { 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 cambiare tutti i Joints + /// + [Parameter] + public EventCallback EC_ChangeAllJoints { get; set; } + + /// + /// Evento per aggiungere sash + /// + [Parameter] + public EventCallback EC_AddSash { get; set; } + + /// + /// Evento per aggiungere split + /// + [Parameter] + public EventCallback EC_AddSplit { get; set; } + + /// + /// Evento per tornare nella pagine Tree + /// + [Parameter] + public EventCallback EC_ReqClose { get; set; } + + /// + /// Sollevo evento richiesta copia sash + /// + /// + 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 richiesta aggiunta sash + /// + /// + private async Task AddSash() + { + await EC_AddSash.InvokeAsync(true); + } + + /// + /// Sollevo evento richiesta aggiunta window + /// + /// + private async Task AddSplit() + { + await EC_AddSplit.InvokeAsync(true); + } + + /// + /// Sollevo evento per tornare alla pagina Tree + /// + private void ReqClose() + { + _ = EC_ReqClose.InvokeAsync(true); + } + } + + /// + /// Classe per raggruppare oggetti che servono per copiare Sash + /// + public class DataChangeJoints + { + public Json.WindowConst.Joints currJointType { get; set; } + public Area currArea { get; set; } + } +} \ No newline at end of file diff --git a/WebWindowComplex/TableComp.razor b/WebWindowComplex/TableComp.razor index 31f2207..08714e1 100644 --- a/WebWindowComplex/TableComp.razor +++ b/WebWindowComplex/TableComp.razor @@ -126,124 +126,7 @@ { m_PreviousWindow = m_CurrWindow; } -
-
-
-
-
-
-
-
-
-

Frame

-
-
-
-
-
- - -
-
-
-
-
-
-
Dimension
- @foreach (FrameDimension dimension in FrameWindow.DimensionList) - { -
- @dimension.sName - - mm -
- } -
-
-
Threshold
-
- - -
-
-
-
-
-
-
-
-
Joints
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- @foreach (Joint joint in FrameWindow.JointList) - { -
- - -
- } -
-
-
- @if (m_SashList.Count == 0) - { -
-
Bottom rail
-
-
-
- Quantity - -
-
- } -
- -
-
-
- @if (!(FrameWindow.AreaList[0] is Split) || (SashList.Count == 0 && SplitList.Count == 0)) - { - - - } -
-
-
-
-
+ } else if (currStep == CompileStep.Split) { @@ -466,17 +349,17 @@
- + @* *@
- + @* *@
- + @* *@
diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index ef36db4..f5adec2 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -8,7 +8,6 @@ using WebWindowComplex.Json; using WebWindowComplex.Models; using static WebWindowComplex.LayoutConst; using static WebWindowComplex.Json.WindowConst; -//using static WebWindowComplex.Compo.CardTree; namespace WebWindowComplex { @@ -839,8 +838,36 @@ namespace WebWindowComplex /// 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) + //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) { + WindowConst.Joints type = Args.currJointType; + Area area = Args.currArea; if (area is Frame) { foreach (Joint joint in FrameWindow.JointList) diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 856e81f..ef00d29 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1312 + 2.7.10.1313 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -66,6 +66,19 @@ + + + + + + + + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 3368837..d83b7fc 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1312 + 2.7.10.1313 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -110,6 +110,11 @@ + + + + + From 36eca36ceecfeae884885bff459baf2b259944b8 Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Mon, 13 Oct 2025 14:47:49 +0200 Subject: [PATCH 13/23] Corretto aggiornamento hardware se si cambia maniglia --- WebWindowComplex/Json/JsonUtility.cs | 2 +- WebWindowComplex/WebWindowComplex.csproj | 3 ++- WebWindowConfigurator/WebWindowConfigurator.csproj | 6 +++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/WebWindowComplex/Json/JsonUtility.cs b/WebWindowComplex/Json/JsonUtility.cs index c60fe9b..f5fc86a 100644 --- a/WebWindowComplex/Json/JsonUtility.cs +++ b/WebWindowComplex/Json/JsonUtility.cs @@ -400,7 +400,7 @@ namespace WebWindowComplex.Json newSash.JointList.Add(Joint.Deserialize((Area)ParentArea)); newSash.SetSelFamilyHardwareFromIndex(Hardware); newSash.RefreshHardwareList(); - newSash.SetSelHardwareFromId(Hardware); + newSash.SetSelHardwareFromId(newSash.HardwareList.First().Id); foreach (var Area in AreaList) { var AreaDeserealized = Area.Deserialize(newSash, ParentWindow); diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index ef00d29..923af7f 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1313 + 2.7.10.1314 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -91,5 +91,6 @@ + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index d83b7fc..e1c317c 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1313 + 2.7.10.1314 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -116,6 +116,10 @@ + + + + From a3112a99297351991822a57d6525174892b46623 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 13 Oct 2025 16:12:19 +0200 Subject: [PATCH 14/23] Update catena update elementi frame --- WebWindowComplex/Compo/CardFrame.razor | 6 ++-- WebWindowComplex/Compo/CardFrame.razor.cs | 23 +++++++++++++++ WebWindowComplex/Compo/EditDimensions.razor | 7 +++++ .../Compo/EditDimensions.razor.cs | 28 +++++++++++++++++++ WebWindowComplex/Models/Frame.cs | 6 ++-- WebWindowComplex/TableComp.razor | 2 +- WebWindowComplex/TableComp.razor.cs | 7 +++++ WebWindowComplex/WebWindowComplex.csproj | 19 ++++++++++++- .../WebWindowConfigurator.csproj | 19 ++++++++++++- 9 files changed, 108 insertions(+), 9 deletions(-) create mode 100644 WebWindowComplex/Compo/EditDimensions.razor create mode 100644 WebWindowComplex/Compo/EditDimensions.razor.cs diff --git a/WebWindowComplex/Compo/CardFrame.razor b/WebWindowComplex/Compo/CardFrame.razor index 6a1c1ca..3078e20 100644 --- a/WebWindowComplex/Compo/CardFrame.razor +++ b/WebWindowComplex/Compo/CardFrame.razor @@ -32,14 +32,16 @@
+
Dimension
@foreach (FrameDimension dimension in FrameWindow.DimensionList) { -
+ @*
@dimension.sName mm -
+
*@ + }
diff --git a/WebWindowComplex/Compo/CardFrame.razor.cs b/WebWindowComplex/Compo/CardFrame.razor.cs index 7380261..1166177 100644 --- a/WebWindowComplex/Compo/CardFrame.razor.cs +++ b/WebWindowComplex/Compo/CardFrame.razor.cs @@ -47,6 +47,13 @@ namespace WebWindowComplex.Compo [Parameter] public EventCallback EC_ReqClose { get; set; } + + /// + /// Evento per cambiare tutti i Joints + /// + [Parameter] + public EventCallback> EC_UpdateFrameDim{ get; set; } + /// /// Sollevo evento richiesta copia sash /// @@ -86,6 +93,22 @@ namespace WebWindowComplex.Compo { _ = EC_ReqClose.InvokeAsync(true); } + + /// + /// Aggiornamento dimensione editata + /// + /// + private void UpdateDim(FrameDimension updRec) + { + // cerco il record + var currRec = FrameWindow.DimensionList.FirstOrDefault(x => x.ParentFrame == updRec.ParentFrame && x.nIndex == updRec.nIndex); + // lo aggiorno + if (updRec != null) + { + currRec = updRec; + _ = EC_UpdateFrameDim.InvokeAsync(FrameWindow.DimensionList); + } + } } /// diff --git a/WebWindowComplex/Compo/EditDimensions.razor b/WebWindowComplex/Compo/EditDimensions.razor new file mode 100644 index 0000000..d2bc0b1 --- /dev/null +++ b/WebWindowComplex/Compo/EditDimensions.razor @@ -0,0 +1,7 @@ + +
+ @Dimenson.sName + + mm +
+ diff --git a/WebWindowComplex/Compo/EditDimensions.razor.cs b/WebWindowComplex/Compo/EditDimensions.razor.cs new file mode 100644 index 0000000..f678e0e --- /dev/null +++ b/WebWindowComplex/Compo/EditDimensions.razor.cs @@ -0,0 +1,28 @@ +using Microsoft.AspNetCore.Components; +using WebWindowComplex.Models; + +namespace WebWindowComplex.Compo +{ + public partial class EditDimensions + { + [Parameter] + public FrameDimension Dimenson { get; set; } = null!; + + [Parameter] + public EventCallback EC_Update { get; set; } + + + private double CurrVal + { + get => Dimenson.dValue; + set + { + if (Dimenson.dValue != value) + { + Dimenson.dValue = value; + _ = EC_Update.InvokeAsync(Dimenson); + } + } + } + } +} \ No newline at end of file diff --git a/WebWindowComplex/Models/Frame.cs b/WebWindowComplex/Models/Frame.cs index 0e8e266..b3e0354 100644 --- a/WebWindowComplex/Models/Frame.cs +++ b/WebWindowComplex/Models/Frame.cs @@ -59,10 +59,8 @@ namespace WebWindowComplex.Models public List DimensionList { - get - { - return m_DimensionList; - } + get => m_DimensionList; + set => m_DimensionList = value; } public List JointList diff --git a/WebWindowComplex/TableComp.razor b/WebWindowComplex/TableComp.razor index 08714e1..1a14219 100644 --- a/WebWindowComplex/TableComp.razor +++ b/WebWindowComplex/TableComp.razor @@ -126,7 +126,7 @@ { m_PreviousWindow = m_CurrWindow; } - + } else if (currStep == CompileStep.Split) { diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index f5adec2..5afc1c1 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -1246,5 +1246,12 @@ namespace WebWindowComplex } #endregion Private Methods + + // Aggiornamento record frame dimensions + private async Task UpdateFrameDim(List newList) + { + FrameWindow.DimensionList = newList; + await DoPreviewSvg(); + } } } \ No newline at end of file diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 923af7f..c338398 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1314 + 2.7.10.1316 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -76,6 +76,23 @@ + + + + + + + + + + + + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index e1c317c..80e8ec9 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1314 + 2.7.10.1316 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -107,6 +107,23 @@ + + + + + + + + + + + + + + + + + From 9fd167e34e744cd50f580d1759d6e618b15b0ac0 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 13 Oct 2025 16:30:30 +0200 Subject: [PATCH 15/23] Update catena eventi controlli binded --- WebWindowComplex/Compo/CardFrame.razor | 7 +- WebWindowComplex/Compo/CardFrame.razor.cs | 120 +++++++++++------- WebWindowComplex/Compo/EditDimensions.razor | 2 +- .../Compo/EditDimensions.razor.cs | 17 ++- WebWindowComplex/Compo/EditJoint.razor | 9 ++ WebWindowComplex/Compo/EditJoint.razor.cs | 35 +++++ WebWindowComplex/TableComp.razor | 2 +- WebWindowComplex/TableComp.razor.cs | 36 +++--- WebWindowComplex/WebWindowComplex.csproj | 6 + .../WebWindowConfigurator.csproj | 6 + 10 files changed, 168 insertions(+), 72 deletions(-) create mode 100644 WebWindowComplex/Compo/EditJoint.razor create mode 100644 WebWindowComplex/Compo/EditJoint.razor.cs diff --git a/WebWindowComplex/Compo/CardFrame.razor b/WebWindowComplex/Compo/CardFrame.razor index 3078e20..8ab33d3 100644 --- a/WebWindowComplex/Compo/CardFrame.razor +++ b/WebWindowComplex/Compo/CardFrame.razor @@ -41,7 +41,7 @@ mm
*@ - + }
@@ -81,14 +81,15 @@
@foreach (Joint joint in FrameWindow.JointList) { -
+ @*
-
+
*@ + }
diff --git a/WebWindowComplex/Compo/CardFrame.razor.cs b/WebWindowComplex/Compo/CardFrame.razor.cs index 1166177..2b82d25 100644 --- a/WebWindowComplex/Compo/CardFrame.razor.cs +++ b/WebWindowComplex/Compo/CardFrame.razor.cs @@ -5,6 +5,38 @@ namespace WebWindowComplex.Compo { public partial class CardFrame { + #region Public Properties + + /// + /// Evento per aggiungere sash + /// + [Parameter] + public EventCallback EC_AddSash { get; set; } + + /// + /// Evento per aggiungere split + /// + [Parameter] + public EventCallback EC_AddSplit { get; set; } + + /// + /// Evento per cambiare tutti i Joints + /// + [Parameter] + public EventCallback EC_ChangeAllJoints { get; set; } + + /// + /// Evento per tornare nella pagine Tree + /// + [Parameter] + public EventCallback EC_ReqClose { get; set; } + + /// + /// Evento per cambiare tutti i Joints + /// + [Parameter] + public EventCallback EC_UpdateFrame { get; set; } + /// /// Frame corrente /// @@ -23,50 +55,9 @@ namespace WebWindowComplex.Compo [Parameter] public List SplitList { get; set; } = null!; - /// - /// Evento per cambiare tutti i Joints - /// - [Parameter] - public EventCallback EC_ChangeAllJoints { get; set; } + #endregion Public Properties - /// - /// Evento per aggiungere sash - /// - [Parameter] - public EventCallback EC_AddSash { get; set; } - - /// - /// Evento per aggiungere split - /// - [Parameter] - public EventCallback EC_AddSplit { get; set; } - - /// - /// Evento per tornare nella pagine Tree - /// - [Parameter] - public EventCallback EC_ReqClose { get; set; } - - - /// - /// Evento per cambiare tutti i Joints - /// - [Parameter] - public EventCallback> EC_UpdateFrameDim{ get; set; } - - /// - /// Sollevo evento richiesta copia sash - /// - /// - private async Task ChangeAllJoints(Json.WindowConst.Joints JointType, Area a) - { - var Args = new DataChangeJoints - { - currJointType = JointType, - currArea = a, - }; - await EC_ChangeAllJoints.InvokeAsync(Args); - } + #region Private Methods /// /// Sollevo evento richiesta aggiunta sash @@ -86,6 +77,20 @@ namespace WebWindowComplex.Compo await EC_AddSplit.InvokeAsync(true); } + /// + /// Sollevo evento richiesta copia sash + /// + /// + 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 tornare alla pagina Tree /// @@ -98,7 +103,7 @@ namespace WebWindowComplex.Compo /// Aggiornamento dimensione editata /// /// - private void UpdateDim(FrameDimension updRec) + private async Task UpdateDim(FrameDimension updRec) { // cerco il record var currRec = FrameWindow.DimensionList.FirstOrDefault(x => x.ParentFrame == updRec.ParentFrame && x.nIndex == updRec.nIndex); @@ -106,9 +111,28 @@ namespace WebWindowComplex.Compo if (updRec != null) { currRec = updRec; - _ = EC_UpdateFrameDim.InvokeAsync(FrameWindow.DimensionList); + await EC_UpdateFrame.InvokeAsync(FrameWindow); } } + + /// + /// Report aggiornamento joint + /// + /// + /// + private async Task UpdateJoint(Joint updRec) + { + // cerco il record + var currRec = FrameWindow.JointList.FirstOrDefault(x => x.ParentArea == updRec.ParentArea && x.nIndex == updRec.nIndex); + // lo aggiorno + if (updRec != null) + { + currRec = updRec; + await EC_UpdateFrame.InvokeAsync(FrameWindow); + } + } + + #endregion Private Methods } /// @@ -116,7 +140,11 @@ namespace WebWindowComplex.Compo /// public class DataChangeJoints { - public Json.WindowConst.Joints currJointType { get; set; } + #region Public Properties + public Area currArea { get; set; } + public Json.WindowConst.Joints currJointType { get; set; } + + #endregion Public Properties } } \ No newline at end of file diff --git a/WebWindowComplex/Compo/EditDimensions.razor b/WebWindowComplex/Compo/EditDimensions.razor index d2bc0b1..9ac6cfe 100644 --- a/WebWindowComplex/Compo/EditDimensions.razor +++ b/WebWindowComplex/Compo/EditDimensions.razor @@ -1,6 +1,6 @@ 
- @Dimenson.sName + @CurrRec.sName mm
diff --git a/WebWindowComplex/Compo/EditDimensions.razor.cs b/WebWindowComplex/Compo/EditDimensions.razor.cs index f678e0e..d94acb8 100644 --- a/WebWindowComplex/Compo/EditDimensions.razor.cs +++ b/WebWindowComplex/Compo/EditDimensions.razor.cs @@ -5,24 +5,31 @@ namespace WebWindowComplex.Compo { public partial class EditDimensions { + #region Public Properties + [Parameter] - public FrameDimension Dimenson { get; set; } = null!; + public FrameDimension CurrRec { get; set; } = null!; [Parameter] public EventCallback EC_Update { get; set; } + #endregion Public Properties + + #region Private Properties private double CurrVal { - get => Dimenson.dValue; + get => CurrRec.dValue; set { - if (Dimenson.dValue != value) + if (CurrRec.dValue != value) { - Dimenson.dValue = value; - _ = EC_Update.InvokeAsync(Dimenson); + CurrRec.dValue = value; + _ = EC_Update.InvokeAsync(CurrRec); } } } + + #endregion Private Properties } } \ No newline at end of file diff --git a/WebWindowComplex/Compo/EditJoint.razor b/WebWindowComplex/Compo/EditJoint.razor new file mode 100644 index 0000000..1ffcd67 --- /dev/null +++ b/WebWindowComplex/Compo/EditJoint.razor @@ -0,0 +1,9 @@ +@using static WebWindowComplex.LayoutConst +
+ + +
\ No newline at end of file diff --git a/WebWindowComplex/Compo/EditJoint.razor.cs b/WebWindowComplex/Compo/EditJoint.razor.cs new file mode 100644 index 0000000..2835920 --- /dev/null +++ b/WebWindowComplex/Compo/EditJoint.razor.cs @@ -0,0 +1,35 @@ +using Microsoft.AspNetCore.Components; +using WebWindowComplex.Models; + +namespace WebWindowComplex.Compo +{ + public partial class EditJoint + { + #region Public Properties + + [Parameter] + public Joint CurrRec { get; set; } = null!; + + [Parameter] + public EventCallback EC_Update { get; set; } + + #endregion Public Properties + + #region Private Properties + + private int CurrVal + { + get => CurrRec.SelJointTypeIndex; + set + { + if (CurrRec.SelJointTypeIndex != value) + { + CurrRec.SelJointTypeIndex = value; + _ = EC_Update.InvokeAsync(CurrRec); + } + } + } + + #endregion Private Properties + } +} \ No newline at end of file diff --git a/WebWindowComplex/TableComp.razor b/WebWindowComplex/TableComp.razor index 1a14219..1b52248 100644 --- a/WebWindowComplex/TableComp.razor +++ b/WebWindowComplex/TableComp.razor @@ -126,7 +126,7 @@ { m_PreviousWindow = m_CurrWindow; } - + } else if (currStep == CompileStep.Split) { diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index 5afc1c1..1b87074 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -1109,17 +1109,6 @@ namespace WebWindowComplex return (currStep == CompileStep.Template) ? "col-12" : "col-6"; } - /// - /// Metodo per cambiare step - /// - /// argomenti passati dal componente - private void NextStepArgs(DataNextStep Args) - { - CompileStep newStep = Args.currCompileStep; - int Index = Args.index; - NextStep(newStep, Index); - } - /// /// Metodo per cambiare step /// @@ -1154,6 +1143,17 @@ namespace WebWindowComplex } } + /// + /// Metodo per cambiare step + /// + /// argomenti passati dal componente + private void NextStepArgs(DataNextStep Args) + { + CompileStep newStep = Args.currCompileStep; + int Index = Args.index; + NextStep(newStep, Index); + } + /// /// Metodo per eliminare Split o Sash /// @@ -1245,13 +1245,17 @@ namespace WebWindowComplex return (testStep == currStep) ? "nav-link active fw-bold" : "nav-link text-secondary"; } - #endregion Private Methods - - // Aggiornamento record frame dimensions - private async Task UpdateFrameDim(List newList) + /// + /// Aggiornamento Frame + /// + /// + /// + private async Task UpdateFrame(Frame newFrame) { - FrameWindow.DimensionList = newList; + FrameWindow = newFrame; await DoPreviewSvg(); } + + #endregion Private Methods } } \ No newline at end of file diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index c338398..7394983 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -104,6 +104,12 @@ + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 80e8ec9..c42c5d7 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -135,6 +135,12 @@ + + + + + + From 0fb44da4c7667d344adf65a24e926c225c75225c Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 13 Oct 2025 16:32:04 +0200 Subject: [PATCH 16/23] typo nullable area --- WebWindowComplex/Compo/CardFrame.razor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebWindowComplex/Compo/CardFrame.razor.cs b/WebWindowComplex/Compo/CardFrame.razor.cs index 2b82d25..1f33a46 100644 --- a/WebWindowComplex/Compo/CardFrame.razor.cs +++ b/WebWindowComplex/Compo/CardFrame.razor.cs @@ -142,7 +142,7 @@ namespace WebWindowComplex.Compo { #region Public Properties - public Area currArea { get; set; } + public Area currArea { get; set; } = null!; public Json.WindowConst.Joints currJointType { get; set; } #endregion Public Properties From 0d8effa120962a21d8822b45aaca47a262a34b62 Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Tue, 14 Oct 2025 12:15:25 +0200 Subject: [PATCH 17/23] - Aggiunto componenti CardSashGroup e CardSplit - Aggiornato visualizzazione componenti --- WebWindowComplex/Compo/AreaFrame.razor | 4 +- WebWindowComplex/Compo/AreaSash.razor | 65 +++ WebWindowComplex/Compo/AreaSash.razor.cs | 106 ++++ WebWindowComplex/Compo/AreaSplit.razor | 9 +- WebWindowComplex/Compo/CardFrame.razor | 42 +- WebWindowComplex/Compo/CardSashGroup.razor | 129 +++++ WebWindowComplex/Compo/CardSashGroup.razor.cs | 131 +++++ WebWindowComplex/Compo/CardSplit.razor | 132 +++++ WebWindowComplex/Compo/CardSplit.razor.cs | 139 +++++ WebWindowComplex/Compo/General.razor | 2 +- WebWindowComplex/Json/JsonUtility.cs | 3 +- WebWindowComplex/Models/Frame.cs | 33 +- WebWindowComplex/Models/SplitDimension.cs | 12 + WebWindowComplex/TableComp.razor | 517 +++--------------- WebWindowComplex/TableComp.razor.cs | 245 ++------- WebWindowComplex/WebWindowComplex.csproj | 89 +-- .../WebWindowConfigurator.csproj | 113 +--- 17 files changed, 884 insertions(+), 887 deletions(-) create mode 100644 WebWindowComplex/Compo/AreaSash.razor create mode 100644 WebWindowComplex/Compo/AreaSash.razor.cs create mode 100644 WebWindowComplex/Compo/CardSashGroup.razor create mode 100644 WebWindowComplex/Compo/CardSashGroup.razor.cs create mode 100644 WebWindowComplex/Compo/CardSplit.razor create mode 100644 WebWindowComplex/Compo/CardSplit.razor.cs 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 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 90e6bc799a58fb04c80cbb1d4fcb6ff4c1feaf0d Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Tue, 14 Oct 2025 15:02:39 +0200 Subject: [PATCH 18/23] - Aggiunta lista Profili - Aggiornato setup Hardware --- Test.UI/Components/Pages/EditJWD.razor.cs | 14 +- Test.UI/Data/AntaDoppia.jwd | 2 +- Test.UI/Data/AntaSingola.jwd | 2 +- Test.UI/Data/FinDueAnteBottomFisso.jwd | 2 +- Test.UI/Hardware/Setup.json | 873 +++++++++++------- WebWindowComplex/Compo/CardSashGroup.razor | 2 +- WebWindowComplex/Compo/General.razor | 9 +- WebWindowComplex/Compo/General.razor.cs | 15 + WebWindowComplex/DTO/BaseListPayload.cs | 11 +- WebWindowComplex/DTO/SelectPayload.cs | 8 +- WebWindowComplex/Json/JsonUtility.cs | 9 +- WebWindowComplex/Models/Sash.cs | 16 +- WebWindowComplex/Models/Window.cs | 1 + WebWindowComplex/TableComp.razor | 2 +- WebWindowComplex/TableComp.razor.cs | 39 +- WebWindowComplex/WebWindowComplex.csproj | 22 +- .../WebWindowConfigurator.csproj | 34 +- 17 files changed, 716 insertions(+), 345 deletions(-) diff --git a/Test.UI/Components/Pages/EditJWD.razor.cs b/Test.UI/Components/Pages/EditJWD.razor.cs index 18e7367..9029445 100644 --- a/Test.UI/Components/Pages/EditJWD.razor.cs +++ b/Test.UI/Components/Pages/EditJWD.razor.cs @@ -64,8 +64,8 @@ namespace Test.UI.Components.Pages protected List AvailFamilyHardwareList { get; set; } = new List() { - new string("Arc"), - new string("Profilo78") + new string("ArTech"), + new string("ArTechPlana") }; protected List AvailGlassList { get; set; } = new List() @@ -85,6 +85,13 @@ namespace Test.UI.Components.Pages new string("Abete") }; + protected List AvailProfileList { get; set; } = new List() + { + new string("Profilo60"), + new string("Profilo78"), + new string("Profilo90") + }; + protected List AvailTemplateList { get; set; } = new List(); [Inject] protected IConfiguration Config { get; set; } = null!; @@ -117,7 +124,7 @@ namespace Test.UI.Components.Pages // rileggo altri dati await ReloadData(); // preparo conf oggetti x controllo - SetupList = SetupList = new BaseListPayload() + SetupList = new BaseListPayload() { ColorMaterial = AvailColorMaterialList, FamilyHardware = AvailFamilyHardwareList, @@ -126,6 +133,7 @@ namespace Test.UI.Components.Pages //Material = new List(), Hardware = AvailHardwareList, Material = AvailMaterialList, + Profile = AvailProfileList, TemplateDTO = null }; CurrData = new LivePayload() diff --git a/Test.UI/Data/AntaDoppia.jwd b/Test.UI/Data/AntaDoppia.jwd index 141654e..61b7b7f 100644 --- a/Test.UI/Data/AntaDoppia.jwd +++ b/Test.UI/Data/AntaDoppia.jwd @@ -75,7 +75,7 @@ "JointType": "FULL_V" } ], - "Hardware": "000559", + "Hardware": "000656", "IdGroup": 2, "AreaList": [ { diff --git a/Test.UI/Data/AntaSingola.jwd b/Test.UI/Data/AntaSingola.jwd index 363ec74..30b8f1a 100644 --- a/Test.UI/Data/AntaSingola.jwd +++ b/Test.UI/Data/AntaSingola.jwd @@ -69,7 +69,7 @@ "JointType": "FULL_H" } ], - "Hardware": "000558", + "Hardware": "000665", "IdGroup": 2, "AreaList": [ { diff --git a/Test.UI/Data/FinDueAnteBottomFisso.jwd b/Test.UI/Data/FinDueAnteBottomFisso.jwd index 6b19f59..9311e7b 100644 --- a/Test.UI/Data/FinDueAnteBottomFisso.jwd +++ b/Test.UI/Data/FinDueAnteBottomFisso.jwd @@ -106,7 +106,7 @@ "JointType": "FULL_H" } ], - "Hardware": "000559", + "Hardware": "000656", "IdGroup": 6, "AreaList": [ { diff --git a/Test.UI/Hardware/Setup.json b/Test.UI/Hardware/Setup.json index d587146..25b20a0 100644 --- a/Test.UI/Hardware/Setup.json +++ b/Test.UI/Hardware/Setup.json @@ -1,370 +1,613 @@ [ { - "id": "000548", - "familyName": "Rect", - "description": "Rect_DoubleSash", - "openingType": "TiltTurn", - "shape": "Rectangular", - "sashQty": 2, - "sashPosition": 1 - }, - { - "id": "000546", - "familyName": "Trap", - "description": "Trap_Sash", - "openingType": "TiltTurn", - "shape": "Trapezoidal", - "sashQty": 1, - "sashPosition": 1 - }, - { - "id": "000547", - "familyName": "Rect", - "description": "Rect_Sash_Compl", - "openingType": "ComplanarSlide", - "shape": "Rectangular", - "sashQty": 2, - "sashPosition": 1 - }, - { - "id": "000561", - "familyName": "Profilo78", - "description": "Profilo78_Rect_TripleSash_HiddenHinges", + "id": "000625", + "familyName": "ArTech", + "description": "ArTech_Aria12", "openingType": "TiltTurn", "shape": "Rectangular", "sashQty": 3, "sashPosition": 1 }, { - "id": "000563", - "familyName": "Profilo78", - "description": "Profilo78_TurnOnly_Rect_DoubleSash", + "id": "000666", + "familyName": "ArTechPlana", + "description": "ArTechPlana_Aria4", "openingType": "TurnOnly", "shape": "Rectangular", "sashQty": 2, "sashPosition": 1 }, { - "id": "000564", - "familyName": "Profilo78", - "description": "Profilo78_TurnOnly_Rect_TripleSash", - "openingType": "TurnOnly", - "shape": "Rectangular", - "sashQty": 3, - "sashPosition": 2 - }, - { - "id": "000603", - "familyName": "SegArc", - "description": "SegArc_2S_TurnOnly", - "openingType": "TurnOnly", - "shape": "Arc", - "sashQty": 2, - "sashPosition": 1 - }, - { - "id": "000602", - "familyName": "Arc", - "description": "Arc_2S_TurnOnly", - "openingType": "TurnOnly", - "shape": "FullArc", - "sashQty": 2, - "sashPosition": 1 - }, - { - "id": "000601", - "familyName": "SegArc", - "description": "SegArc_1S_TurnOnly", - "openingType": "TurnOnly", - "shape": "Arc", - "sashQty": 1, - "sashPosition": 1 - }, - { - "id": "000610", - "familyName": "SemiArc", - "description": "SemiArc_1S", - "openingType": "TiltTurn", - "shape": "SemiFullArc", - "sashQty": 1, - "sashPosition": 1 - }, - { - "id": "000611", - "familyName": "SemiSegArc", - "description": "SemiSegArc_S1", + "id": "000642", + "familyName": "ArTech", + "description": "ArTech_Aria4", "openingType": "TiltTurn", "shape": "SemiArc", "sashQty": 1, "sashPosition": 1 }, { - "id": "000596", - "familyName": "Arc", - "description": "Arc_1S", - "openingType": "TiltTurn", - "shape": "FullArc", + "id": "000665", + "familyName": "ArTechPlana", + "description": "ArTechPlana_Aria4", + "openingType": "TurnOnly", + "shape": "Rectangular", "sashQty": 1, "sashPosition": 1 }, { - "id": "000599", - "familyName": "SegArc", - "description": "SegArc_2S", + "id": "000693", + "familyName": "ArTech", + "description": "ArTech_Aria4", + "openingType": "TurnOnly", + "shape": "FullArc", + "sashQty": 2, + "sashPosition": 1 + }, + { + "id": "000644", + "familyName": "ArTech", + "description": "ArTech_Aria4", "openingType": "TiltTurn", "shape": "Arc", "sashQty": 2, "sashPosition": 1 }, { - "id": "000597", - "familyName": "SegArc", - "description": "SegArc_1S", + "id": "000637", + "familyName": "ArTechPlana", + "description": "ArTechPlana_Aria4", + "openingType": "TiltTurn", + "shape": "Rectangular", + "sashQty": 3, + "sashPosition": 1 + }, + { + "id": "000656", + "familyName": "ArTech", + "description": "ArTech_Aria12", + "openingType": "TurnOnly", + "shape": "Rectangular", + "sashQty": 2, + "sashPosition": 1 + }, + { + "id": "000686", + "familyName": "ArTech", + "description": "ArTech_Aria4", + "openingType": "TurnOnly", + "shape": "Arc", + "sashQty": 1, + "sashPosition": 1 + }, + { + "id": "000678", + "familyName": "ArTech", + "description": "ArTech_Aria12", + "openingType": "TurnOnly", + "shape": "Arc", + "sashQty": 1, + "sashPosition": 1 + }, + { + "id": "000635", + "familyName": "ArTechPlana", + "description": "ArTechPlana_Aria4", + "openingType": "TiltTurn", + "shape": "Rectangular", + "sashQty": 1, + "sashPosition": 1 + }, + { + "id": "000685", + "familyName": "ArTech", + "description": "ArTech_Aria4", + "openingType": "TurnOnly", + "shape": "Arc", + "sashQty": 2, + "sashPosition": 1 + }, + { + "id": "000631", + "familyName": "ArTech", + "description": "ArTech_Aria4", + "openingType": "TiltTurn", + "shape": "Rectangular", + "sashQty": 2, + "sashPosition": 1 + }, + { + "id": "000649", + "familyName": "ArTech", + "description": "ArTech_Aria12", + "openingType": "TiltTurn", + "shape": "FullArc", + "sashQty": 1, + "sashPosition": 1 + }, + { + "id": "000662", + "familyName": "ArTech", + "description": "ArTech_Aria4_Centrale", + "openingType": "TurnOnly", + "shape": "Rectangular", + "sashQty": 3, + "sashPosition": 2 + }, + { + "id": "000652", + "familyName": "ArTech", + "description": "ArTech_Aria12", + "openingType": "TiltTurn", + "shape": "Trapezoidal", + "sashQty": 2, + "sashPosition": 1 + }, + { + "id": "000630", + "familyName": "ArTech", + "description": "ArTech_Aria4_CerniereScomparsa", + "openingType": "TiltTurn", + "shape": "Rectangular", + "sashQty": 3, + "sashPosition": 1 + }, + { + "id": "000623", + "familyName": "ArTech", + "description": "ArTech_Aria12", + "openingType": "TiltTurn", + "shape": "Rectangular", + "sashQty": 1, + "sashPosition": 1 + }, + { + "id": "000674", + "familyName": "ArTechPlana", + "description": "ArTechPlana_Aria12", + "openingType": "TurnOnly", + "shape": "Rectangular", + "sashQty": 2, + "sashPosition": 1 + }, + { + "id": "000670", + "familyName": "ArTech", + "description": "ArTech_Aria12", + "openingType": "TurnOnly", + "shape": "Rectangular", + "sashQty": 4, + "sashPosition": 2 + }, + { + "id": "000640", + "familyName": "ArTech", + "description": "ArTech_Aria12", + "openingType": "TiltTurn", + "shape": "SemiArc", + "sashQty": 2, + "sashPosition": 1 + }, + { + "id": "000673", + "familyName": "ArTechPlana", + "description": "ArTechPlana_Aria12_Centrale", + "openingType": "TurnOnly", + "shape": "Rectangular", + "sashQty": 3, + "sashPosition": 2 + }, + { + "id": "000647", + "familyName": "ArTech", + "description": "ArTech_Aria4", + "openingType": "TiltTurn", + "shape": "FullArc", + "sashQty": 2, + "sashPosition": 1 + }, + { + "id": "000690", + "familyName": "ArTech", + "description": "ArTech_Aria4", + "openingType": "TurnOnly", + "shape": "Arc", + "sashQty": 2, + "sashPosition": 1 + }, + { + "id": "000632", + "familyName": "ArTechPlana", + "description": "ArTechPlana_Aria12", + "openingType": "TiltTurn", + "shape": "Rectangular", + "sashQty": 1, + "sashPosition": 1 + }, + { + "id": "000669", + "familyName": "ArTechPlana", + "description": "ArTechPlana_Aria4", + "openingType": "TurnOnly", + "shape": "Rectangular", + "sashQty": 4, + "sashPosition": 2 + }, + { + "id": "000624", + "familyName": "ArTech", + "description": "ArTech_Aria12", + "openingType": "TiltTurn", + "shape": "Rectangular", + "sashQty": 2, + "sashPosition": 1 + }, + { + "id": "000667", + "familyName": "ArTechPlana", + "description": "ArTechPlana_Aria4_Centrale", + "openingType": "TurnOnly", + "shape": "Rectangular", + "sashQty": 3, + "sashPosition": 2 + }, + { + "id": "000629", + "familyName": "ArTech", + "description": "ArTech_Aria4", + "openingType": "TiltTurn", + "shape": "Rectangular", + "sashQty": 3, + "sashPosition": 1 + }, + { + "id": "000657", + "familyName": "ArTech", + "description": "ArTech_Aria12_Centrale", + "openingType": "TurnOnly", + "shape": "Rectangular", + "sashQty": 3, + "sashPosition": 2 + }, + { + "id": "000691", + "familyName": "ArTech", + "description": "ArTech_Aria4", + "openingType": "TurnOnly", + "shape": "SemiArc", + "sashQty": 2, + "sashPosition": 1 + }, + { + "id": "000683", + "familyName": "ArTech", + "description": "ArTech_Aria12", + "openingType": "TurnOnly", + "shape": "SemiFullArc", + "sashQty": 1, + "sashPosition": 1 + }, + { + "id": "000633", + "familyName": "ArTechPlana", + "description": "ArTechPlana_Aria12", + "openingType": "TiltTurn", + "shape": "Rectangular", + "sashQty": 2, + "sashPosition": 1 + }, + { + "id": "000675", + "familyName": "ArTechPlana", + "description": "ArTechPlana_Aria12", + "openingType": "TurnOnly", + "shape": "Rectangular", + "sashQty": 1, + "sashPosition": 1 + }, + { + "id": "000692", + "familyName": "ArTech", + "description": "ArTech_Aria4", + "openingType": "TurnOnly", + "shape": "SemiFullArc", + "sashQty": 2, + "sashPosition": 1 + }, + { + "id": "000676", + "familyName": "ArTech", + "description": "ArTech_Aria12", + "openingType": "TurnOnly", + "shape": "Arc", + "sashQty": 1, + "sashPosition": 1 + }, + { + "id": "000684", + "familyName": "ArTech", + "description": "ArTech_Aria12", + "openingType": "TurnOnly", + "shape": "SemiFullArc", + "sashQty": 2, + "sashPosition": 1 + }, + { + "id": "000660", + "familyName": "ArTech", + "description": "ArTech_Aria4", + "openingType": "TurnOnly", + "shape": "Rectangular", + "sashQty": 4, + "sashPosition": 2 + }, + { + "id": "000627", + "familyName": "ArTech", + "description": "ArTech_Aria4", + "openingType": "TiltTurn", + "shape": "Rectangular", + "sashQty": 1, + "sashPosition": 1 + }, + { + "id": "000688", + "familyName": "ArTech", + "description": "ArTech_Aria4", + "openingType": "TurnOnly", + "shape": "SemiFullArc", + "sashQty": 1, + "sashPosition": 1 + }, + { + "id": "000689", + "familyName": "ArTech", + "description": "ArTech_Aria4", + "openingType": "TurnOnly", + "shape": "FullArc", + "sashQty": 1, + "sashPosition": 1 + }, + { + "id": "000658", + "familyName": "ArTech", + "description": "ArTech_Aria12_Laterale", + "openingType": "TurnOnly", + "shape": "Rectangular", + "sashQty": 3, + "sashPosition": 1 + }, + { + "id": "000653", + "familyName": "ArTech", + "description": "ArTech_Aria4", + "openingType": "TiltTurn", + "shape": "Trapezoidal", + "sashQty": 2, + "sashPosition": 1 + }, + { + "id": "000668", + "familyName": "ArTechPlana", + "description": "ArTechPlana_Aria4_Laterale", + "openingType": "TurnOnly", + "shape": "Rectangular", + "sashQty": 3, + "sashPosition": 1 + }, + { + "id": "000626", + "familyName": "ArTech", + "description": "ArTech_Aria12_CernieraScomparsa", + "openingType": "TiltTurn", + "shape": "Rectangular", + "sashQty": 3, + "sashPosition": 1 + }, + { + "id": "000679", + "familyName": "ArTech", + "description": "ArTech_Aria12", + "openingType": "TurnOnly", + "shape": "SemiArc", + "sashQty": 1, + "sashPosition": 1 + }, + { + "id": "000643", + "familyName": "ArTech", + "description": "ArTech_Aria4", + "openingType": "TiltTurn", + "shape": "SemiArc", + "sashQty": 2, + "sashPosition": 1 + }, + { + "id": "000650", + "familyName": "ArTech", + "description": "ArTech_Aria12", + "openingType": "TiltTurn", + "shape": "FullArc", + "sashQty": 2, + "sashPosition": 1 + }, + { + "id": "000661", + "familyName": "ArTech", + "description": "ArTech_Aria4_Laterale", + "openingType": "TurnOnly", + "shape": "Rectangular", + "sashQty": 3, + "sashPosition": 1 + }, + { + "id": "000639", + "familyName": "ArTech", + "description": "ArTech_Aria12", + "openingType": "TiltTurn", + "shape": "Arc", + "sashQty": 2, + "sashPosition": 1 + }, + { + "id": "000663", + "familyName": "ArTech", + "description": "ArTech_Aria4", + "openingType": "TurnOnly", + "shape": "Rectangular", + "sashQty": 2, + "sashPosition": 1 + }, + { + "id": "000664", + "familyName": "ArTech", + "description": "ArTech_Aria4", + "openingType": "TurnOnly", + "shape": "Rectangular", + "sashQty": 1, + "sashPosition": 1 + }, + { + "id": "000682", + "familyName": "ArTech", + "description": "ArTech_Aria12", + "openingType": "TurnOnly", + "shape": "FullArc", + "sashQty": 1, + "sashPosition": 1 + }, + { + "id": "000681", + "familyName": "ArTech", + "description": "ArTech_Aria12", + "openingType": "TurnOnly", + "shape": "FullArc", + "sashQty": 2, + "sashPosition": 1 + }, + { + "id": "000645", + "familyName": "ArTech", + "description": "ArTech_Aria4", "openingType": "TiltTurn", "shape": "Arc", "sashQty": 1, "sashPosition": 1 }, { - "id": "000598", - "familyName": "Arc", - "description": "Arc_2S", - "openingType": "TiltTurn", - "shape": "FullArc", + "id": "000672", + "familyName": "ArTechPlana", + "description": "ArTechPlana_Aria12_Laterale", + "openingType": "TurnOnly", + "shape": "Rectangular", + "sashQty": 3, + "sashPosition": 1 + }, + { + "id": "000671", + "familyName": "ArTechPlana", + "description": "ArTechPlana_Aria12", + "openingType": "TurnOnly", + "shape": "Rectangular", + "sashQty": 4, + "sashPosition": 2 + }, + { + "id": "000687", + "familyName": "ArTech", + "description": "ArTech_Aria4", + "openingType": "TurnOnly", + "shape": "SemiArc", + "sashQty": 1, + "sashPosition": 1 + }, + { + "id": "000677", + "familyName": "ArTech", + "description": "ArTech_Aria12", + "openingType": "TurnOnly", + "shape": "Arc", "sashQty": 2, "sashPosition": 1 }, { - "id": "000600", - "familyName": "Arc", - "description": "Arc_1S_TurnOnly", + "id": "000636", + "familyName": "ArTechPlana", + "description": "ArTechPlana_Aria4", + "openingType": "TiltTurn", + "shape": "Rectangular", + "sashQty": 2, + "sashPosition": 1 + }, + { + "id": "000638", + "familyName": "ArTech", + "description": "ArTech_Aria12", + "openingType": "TiltTurn", + "shape": "Arc", + "sashQty": 1, + "sashPosition": 1 + }, + { + "id": "000634", + "familyName": "ArTechPlana", + "description": "ArTechPlana_Aria12", + "openingType": "TiltTurn", + "shape": "Rectangular", + "sashQty": 3, + "sashPosition": 1 + }, + { + "id": "000655", + "familyName": "ArTech", + "description": "ArTech_Aria12", "openingType": "TurnOnly", + "shape": "Rectangular", + "sashQty": 1, + "sashPosition": 1 + }, + { + "id": "000680", + "familyName": "ArTech", + "description": "ArTech_Aria12", + "openingType": "TurnOnly", + "shape": "SemiArc", + "sashQty": 2, + "sashPosition": 1 + }, + { + "id": "000651", + "familyName": "ArTech", + "description": "ArTech_Aria12", + "openingType": "TiltTurn", + "shape": "Trapezoidal", + "sashQty": 1, + "sashPosition": 1 + }, + { + "id": "000648", + "familyName": "ArTech", + "description": "ArTech_Aria4", + "openingType": "TiltTurn", "shape": "FullArc", "sashQty": 1, "sashPosition": 1 }, { - "id": "000606", - "familyName": "Trap", - "description": "Trap_S1_TurnOnly", - "openingType": "TurnOnly", - "shape": "Trapezoidal", + "id": "000641", + "familyName": "ArTech", + "description": "ArTech_Aria12", + "openingType": "TiltTurn", + "shape": "SemiArc", "sashQty": 1, "sashPosition": 1 }, { - "id": "000605", - "familyName": "Trap", - "description": "Trap_S2", + "id": "000654", + "familyName": "ArTech", + "description": "ArTech_Aria4", "openingType": "TiltTurn", "shape": "Trapezoidal", - "sashQty": 2, - "sashPosition": 1 - }, - { - "id": "000607", - "familyName": "Trap", - "description": "Trap_S2_TurnOnly", - "openingType": "TurnOnly", - "shape": "Trapezoidal", - "sashQty": 2, - "sashPosition": 1 - }, - { - "id": "000604", - "familyName": "Trap", - "description": "Trap_S1", - "openingType": "TiltTurn", - "shape": "Trapezoidal", - "sashQty": 1, - "sashPosition": 1 - }, - { - "id": "000595", - "familyName": "Slide", - "description": "Slide_quadruple", - "openingType": "LiftSlide", - "shape": "Rectangular", - "sashQty": 4, - "sashPosition": 2 - }, - { - "id": "000592", - "familyName": "Slide", - "description": "Slide_2S", - "openingType": "LiftSlide", - "shape": "Rectangular", - "sashQty": 2, - "sashPosition": 1 - }, - { - "id": "000594", - "familyName": "Slide", - "description": "Slide_4S", - "openingType": "LiftSlide", - "shape": "Rectangular", - "sashQty": 4, - "sashPosition": 2 - }, - { - "id": "000593", - "familyName": "Slide", - "description": "Slide_double", - "openingType": "LiftSlide", - "shape": "Rectangular", - "sashQty": 2, - "sashPosition": 1 - }, - { - "id": "000575", - "familyName": "Profilo78", - "description": "Profilo78_TurnOnly_Rect_QuadrupleSash", - "openingType": "TurnOnly", - "shape": "Rectangular", - "sashQty": 4, - "sashPosition": 2 - }, - { - "id": "000558", - "familyName": "Profilo78", - "description": "Profilo78_Rect_Sash", - "openingType": "TiltTurn", - "shape": "Rectangular", - "sashQty": 1, - "sashPosition": 1 - }, - { - "id": "000559", - "familyName": "Profilo78", - "description": "Profilo78_Rect_DoubleSash", - "openingType": "TiltTurn", - "shape": "Rectangular", - "sashQty": 2, - "sashPosition": 1 - }, - { - "id": "000566", - "familyName": "Profilo78", - "description": "Profilo78_TurnOnly_Rect_TripleSash_CenterHandle", - "openingType": "TurnOnly", - "shape": "Rectangular", - "sashQty": 3, - "sashPosition": 2 - }, - { - "id": "000565", - "familyName": "Profilo78", - "description": "Profilo78_TurnOnly_Rect_TripleSash_SideHandle", - "openingType": "TurnOnly", - "shape": "Rectangular", - "sashQty": 3, - "sashPosition": 1 - }, - { - "id": "000562", - "familyName": "Profilo78", - "description": "Profilo78_Rect_Sash", - "openingType": "TurnOnly", - "shape": "Rectangular", - "sashQty": 1, - "sashPosition": 1 - }, - { - "id": "000560", - "familyName": "Profilo78", - "description": "Profilo78_Rect_TripleSash", - "openingType": "TiltTurn", - "shape": "Rectangular", - "sashQty": 3, - "sashPosition": 1 - }, - { - "id": "000550", - "familyName": "Rect", - "description": "Rect_DoubleSash_4", - "openingType": "TiltTurn", - "shape": "Rectangular", - "sashQty": 2, - "sashPosition": 1 - }, - { - "id": "000552", - "familyName": "Rect", - "description": "Rect_DoubleSashStrana", - "openingType": "TiltTurn", - "shape": "Rectangular", - "sashQty": 3, - "sashPosition": 1 - }, - { - "id": "000549", - "familyName": "Rect", - "description": "Rect_DoubleSash", - "openingType": "TiltTurn", - "shape": "Rectangular", - "sashQty": 2, - "sashPosition": 1 - }, - { - "id": "000555", - "familyName": "Round", - "description": "Round_Sash", - "openingType": "Pivot", - "shape": "Circular", - "sashQty": 1, - "sashPosition": 1 - }, - { - "id": "000556", - "familyName": "Rect", - "description": "Rect_Sash_Bilico", - "openingType": "Pivot", - "shape": "Rectangular", - "sashQty": 1, - "sashPosition": 1 - }, - { - "id": "000554", - "familyName": "Rect", - "description": "Rect_QuadrupolSash_Bandiera", - "openingType": "TurnOnly", - "shape": "Rectangular", - "sashQty": 4, - "sashPosition": 2 - }, - { - "id": "000551", - "familyName": "Rect", - "description": "Rect_Sash_Bandiera", - "openingType": "TurnOnly", - "shape": "Rectangular", - "sashQty": 1, - "sashPosition": 1 - }, - { - "id": "000544", - "familyName": "Rect", - "description": "Rect_Sash", - "openingType": "TiltTurn", - "shape": "Rectangular", - "sashQty": 1, - "sashPosition": 1 - }, - { - "id": "000553", - "familyName": "Rect", - "description": "Rect_TripleSash", - "openingType": "TiltTurn", - "shape": "Rectangular", - "sashQty": 3, - "sashPosition": 1 - }, - { - "id": "000545", - "familyName": "Rect", - "description": "Rect_Sash_4", - "openingType": "TiltTurn", - "shape": "Rectangular", "sashQty": 1, "sashPosition": 1 } diff --git a/WebWindowComplex/Compo/CardSashGroup.razor b/WebWindowComplex/Compo/CardSashGroup.razor index 510970a..6ac3587 100644 --- a/WebWindowComplex/Compo/CardSashGroup.razor +++ b/WebWindowComplex/Compo/CardSashGroup.razor @@ -104,7 +104,7 @@ { @foreach (var hlItem in CurrItem.HardwareList) { - + } } diff --git a/WebWindowComplex/Compo/General.razor b/WebWindowComplex/Compo/General.razor index 9431e2c..8088a81 100644 --- a/WebWindowComplex/Compo/General.razor +++ b/WebWindowComplex/Compo/General.razor @@ -24,10 +24,11 @@
- + @foreach (string profile in ListPayload.Profile) + { + + }
diff --git a/WebWindowComplex/Compo/General.razor.cs b/WebWindowComplex/Compo/General.razor.cs index 11ae6f3..9ed2b11 100644 --- a/WebWindowComplex/Compo/General.razor.cs +++ b/WebWindowComplex/Compo/General.razor.cs @@ -23,6 +23,9 @@ namespace WebWindowComplex.Compo [Parameter] public EventCallback EC_SelWindMat { get; set; } + [Parameter] + public EventCallback EC_SelProfile { get; set; } + [Parameter] public EventCallback EC_ReqClose { get; set; } @@ -72,6 +75,16 @@ namespace WebWindowComplex.Compo } } + protected string CurrProfile + { + get => currProfile; + set + { + currProfile = value; + _ = EC_SelProfile.InvokeAsync(value); + } + } + #endregion Protected Properties #region Protected Methods @@ -91,6 +104,7 @@ namespace WebWindowComplex.Compo currColor = CurrWindow.sColorMaterial; currGlass = CurrWindow.sGlass; currMaterial = CurrWindow.sMaterial; + currProfile = CurrWindow.sProfilePath; } #endregion Protected Methods @@ -100,6 +114,7 @@ namespace WebWindowComplex.Compo private string currColor = ""; private string currGlass = ""; private string currMaterial = ""; + private string currProfile = ""; #endregion Private Fields diff --git a/WebWindowComplex/DTO/BaseListPayload.cs b/WebWindowComplex/DTO/BaseListPayload.cs index f9ece32..7690641 100644 --- a/WebWindowComplex/DTO/BaseListPayload.cs +++ b/WebWindowComplex/DTO/BaseListPayload.cs @@ -44,6 +44,11 @@ namespace WebWindowComplex.DTO /// public List Glass { get; set; } = null!; + /// + /// Elenco profili ammessi + /// + public List Profile { get; set; } = null!; + /// /// Verifica di validità dell'intero Payload /// @@ -55,7 +60,8 @@ namespace WebWindowComplex.DTO bool glassOK = Glass != null && Glass.Count > 0; bool matOK = Material != null && Material.Count > 0; bool colorOK = ColorMaterial != null && ColorMaterial.Count > 0; - return famHwOK && glassOK && hwOK && colorOK && matOK; + bool profileOK = Profile != null && Profile.Count > 0; + return famHwOK && glassOK && hwOK && colorOK && matOK && profileOK; } /// /// Verifica che Payload sia almeno parzialmente popolato @@ -68,7 +74,8 @@ namespace WebWindowComplex.DTO bool glassOK = Glass != null && Glass.Count > 0; bool matOK = Material != null && Material.Count > 0; bool colorOK = ColorMaterial != null && ColorMaterial.Count > 0; - return famHwOK || glassOK || hwOK || colorOK || matOK; + bool profileOK = Profile != null && Profile.Count > 0; + return famHwOK || glassOK || hwOK || colorOK || matOK || profileOK; } } } diff --git a/WebWindowComplex/DTO/SelectPayload.cs b/WebWindowComplex/DTO/SelectPayload.cs index 27d1460..4ed2efe 100644 --- a/WebWindowComplex/DTO/SelectPayload.cs +++ b/WebWindowComplex/DTO/SelectPayload.cs @@ -34,6 +34,11 @@ namespace WebWindowComplex.DTO /// public string Glass { get; set; } = string.Empty; + /// + /// Tipologia profilo selezionato + /// + public string Profile { get; set; } = string.Empty; + /// /// Template selezionato /// @@ -49,8 +54,9 @@ namespace WebWindowComplex.DTO bool colorOK = !string.IsNullOrEmpty(ColorMaterial); bool glassOk = !string.IsNullOrEmpty(Glass); bool matOK = !string.IsNullOrEmpty(Material); + bool profileOK = !string.IsNullOrEmpty(Profile); bool templateOK = Template != null; - return famHwOK && colorOK && matOK && glassOk && templateOK; + return famHwOK && colorOK && matOK && glassOk && templateOK && profileOK; } } } diff --git a/WebWindowComplex/Json/JsonUtility.cs b/WebWindowComplex/Json/JsonUtility.cs index 439d5e2..94b377f 100644 --- a/WebWindowComplex/Json/JsonUtility.cs +++ b/WebWindowComplex/Json/JsonUtility.cs @@ -398,10 +398,15 @@ namespace WebWindowComplex.Json } foreach (var Joint in m_JointList) newSash.JointList.Add(Joint.Deserialize((Area)ParentArea)); + newSash.SetSelHardwareFromId(Hardware); newSash.SetSelFamilyHardwareFromIndex(Hardware); newSash.RefreshHardwareList(); - if (newSash.HardwareList.Count() > 0) - newSash.SetSelHardwareFromId(newSash.HardwareList.First().Id); + //if(Hardware != null && !Hardware.Equals("")) + // newSash.SetSelHardwareFromId(Hardware); + //else + newSash.SetSelHardwareFromId(newSash.SelHardware.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/Sash.cs b/WebWindowComplex/Models/Sash.cs index 83af86a..c2dea74 100644 --- a/WebWindowComplex/Models/Sash.cs +++ b/WebWindowComplex/Models/Sash.cs @@ -712,26 +712,28 @@ namespace WebWindowComplex.Models { if (string.IsNullOrEmpty(m_SelFamilyHardware)) { - SelFamilyHardware = (m_HardwareCompleteList + var item = m_HardwareCompleteList .Where(x => x.Id == codHardware) - .First()).FamilyName; + .Select(x => x.FamilyName) + .ToList(); + SelFamilyHardware = item.First(); } return SelFamilyHardware; } internal void SetSelHardware(Hardware value) { - m_SelHardware = value; + SelHardware = value; } internal void SetSelHardwareFromId(string sId) { if (m_HardwareList.Count == 0) - m_SelHardware = m_HardwareCompleteList.FirstOrDefault(x => x.Id.Equals(sId)) ?? new Hardware("", "", "", Enums.OpeningTypes.Null, "", 0, 0); + SelHardware = m_HardwareCompleteList.FirstOrDefault(x => x.Id.Equals(sId)) ?? new Hardware("", "", "", Enums.OpeningTypes.Null, "", 0, 0); else - m_SelHardware = m_HardwareList.FirstOrDefault(x => x.Id.Equals(sId)) ?? new Hardware("", "", "", Enums.OpeningTypes.Null, "", 0, 0); - if (m_SelHardware == null) - m_SelHardware = m_HardwareList[0]; + SelHardware = m_HardwareList.FirstOrDefault(x => x.Id.Equals(sId)) ?? new Hardware("", "", "", Enums.OpeningTypes.Null, "", 0, 0); + if (SelHardware == null) + SelHardware = m_HardwareList[0]; //SelFamilyHardware = m_SelHardware.FamilyName; } diff --git a/WebWindowComplex/Models/Window.cs b/WebWindowComplex/Models/Window.cs index 3a41a7d..4b37f20 100644 --- a/WebWindowComplex/Models/Window.cs +++ b/WebWindowComplex/Models/Window.cs @@ -85,6 +85,7 @@ namespace WebWindowComplex.Models set { m_sProfilePath = value; + OnUpdatePreview(sSerialized()); } } diff --git a/WebWindowComplex/TableComp.razor b/WebWindowComplex/TableComp.razor index f0b1ed4..f2f25d8 100644 --- a/WebWindowComplex/TableComp.razor +++ b/WebWindowComplex/TableComp.razor @@ -163,7 +163,7 @@ } else if (currStep == CompileStep.General) { - + }
diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index d03a760..2e82687 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -130,6 +130,7 @@ namespace WebWindowComplex protected string SelColorMaterial { get; set; } = ""; protected string SelFamilyHardware { get; set; } = ""; protected string SelGlass { get; set; } = ""; + protected string SelProfile { get; set; } = ""; protected string SelMaterial { get; set; } = ""!; @@ -417,8 +418,6 @@ namespace WebWindowComplex return listWarnings.ContainsKey(fKey) ? "border border-danger" : ""; } - - /// /// Richiesta chiusura SENZA salvataggio (= restore prev) /// @@ -551,7 +550,6 @@ namespace WebWindowComplex { listErrLink.Add("Window", $"Deserializing Error:{Environment.NewLine}{ex}"); } - updateSvg = true; } checkWarnings(); @@ -652,6 +650,7 @@ namespace WebWindowComplex SelColorMaterial = CurrSelection.ColorMaterial ?? ""; SelMaterial = CurrSelection.Material ?? ""; SelGlass = CurrSelection.Glass ?? ""; + SelProfile = CurrSelection.Profile ?? ""; } } @@ -850,6 +849,10 @@ namespace WebWindowComplex { listErrPre.Add("ColorMaterial", "Missing ColorMaterial List!"); } + if (ListPayload.Profile == null || ListPayload.Profile.Count == 0) + { + listErrPre.Add("Profile", "Missing Profile List!"); + } } /// @@ -875,6 +878,10 @@ namespace WebWindowComplex { listWarnings.Add("Material", $"Missing Material: {m_CurrWindow.sMaterial}"); } + if (!ListPayload.Profile.Contains(m_CurrWindow.sProfilePath)) + { + listWarnings.Add("Profile", $"Missing Profile: {m_CurrWindow.sProfilePath}"); + } } } } @@ -893,7 +900,7 @@ namespace WebWindowComplex // Rimuovo riempimento da anta selezionata sashSplitted.AreaList.RemoveAt(0); // Creo la copia dell'anta scelta - Area a = sashItem.AreaList[IndexCopy].AreaList[0].Copy(sashSplitted); + Area a = sashItem.AreaList[IndexCopy].AreaList.First().Copy(sashSplitted); // Aggiungo copia all'anta selezionata sashItem.AreaList[IndexModify].AreaList.Add(a); await DoPreviewSvg(); @@ -1015,6 +1022,10 @@ namespace WebWindowComplex AdvStep(CompileStep.Tree); } + /// + /// Selezione del colore + /// + /// private void SelectColor(string newVal) { if (m_CurrWindow != null) @@ -1023,6 +1034,10 @@ namespace WebWindowComplex } } + /// + /// Selezione del vetro + /// + /// private void SelectGlass(string newVal) { if (m_CurrWindow != null) @@ -1031,6 +1046,10 @@ namespace WebWindowComplex } } + /// + /// Selezione del materiale + /// + /// private void SelectMat(string newVal) { if (m_CurrWindow != null) @@ -1039,6 +1058,18 @@ namespace WebWindowComplex } } + /// + /// Selezione del profilo + /// + /// + private void SelectProfile(string newVal) + { + if (m_CurrWindow != null) + { + m_CurrWindow.sProfilePath = newVal; + } + } + /// /// Metodo per scambiare due aree di uno split /// diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index d33bcfb..d03b3f8 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1412 + 2.7.10.1414 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -30,3 +30,23 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 842adef..a6c8d1e 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1412 + 2.7.10.1414 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -37,3 +37,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 0b01ee68d9d57e7bf8b4693ee5e2f5be6eb41b84 Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Wed, 15 Oct 2025 11:06:52 +0200 Subject: [PATCH 19/23] Correzioni --- Test.UI/Components/Pages/EditJWD.razor.cs | 2 +- Test.UI/Data/AntaDoppia.jwd | 4 +-- Test.UI/Data/AntaSingola.jwd | 2 +- Test.UI/Data/FinDueAnteBottomFisso.jwd | 2 +- WebWindowComplex/Compo/CardSashGroup.razor | 1 - WebWindowComplex/Compo/CardSplit.razor | 2 +- WebWindowComplex/Json/JsonUtility.cs | 8 +----- WebWindowComplex/Models/Fill.cs | 2 +- WebWindowComplex/Models/FrameDimension.cs | 4 +-- WebWindowComplex/Models/Sash.cs | 22 ++++++++-------- WebWindowComplex/Models/Split.cs | 4 +++ WebWindowComplex/TableComp.razor | 5 +--- WebWindowComplex/TableComp.razor.cs | 16 ++++++------ WebWindowComplex/WebWindowComplex.csproj | 25 ++++++++++++++++++- .../WebWindowConfigurator.csproj | 19 +++++++++++++- 15 files changed, 76 insertions(+), 42 deletions(-) diff --git a/Test.UI/Components/Pages/EditJWD.razor.cs b/Test.UI/Components/Pages/EditJWD.razor.cs index 9029445..d594db2 100644 --- a/Test.UI/Components/Pages/EditJWD.razor.cs +++ b/Test.UI/Components/Pages/EditJWD.razor.cs @@ -119,7 +119,7 @@ namespace Test.UI.Components.Pages protected override async Task OnInitializedAsync() { ConfInit(); - InitialJwd = File.ReadAllText("Data\\AntaDoppia.jwd"); + InitialJwd = File.ReadAllText("Data\\AntaSingola.jwd"); currJwd = InitialJwd; // rileggo altri dati await ReloadData(); diff --git a/Test.UI/Data/AntaDoppia.jwd b/Test.UI/Data/AntaDoppia.jwd index 61b7b7f..daa1816 100644 --- a/Test.UI/Data/AntaDoppia.jwd +++ b/Test.UI/Data/AntaDoppia.jwd @@ -1,7 +1,7 @@ { "ProfilePath": "Profilo78", "Material": "Pino", - "ColorMaterial": "Nero", + "ColorMaterial": "Black", "Glass": "Vetro BE 2S 4T/16/4T", "AreaList": [ { @@ -75,7 +75,7 @@ "JointType": "FULL_V" } ], - "Hardware": "000656", + "Hardware": "000631", "IdGroup": 2, "AreaList": [ { diff --git a/Test.UI/Data/AntaSingola.jwd b/Test.UI/Data/AntaSingola.jwd index 30b8f1a..60f3330 100644 --- a/Test.UI/Data/AntaSingola.jwd +++ b/Test.UI/Data/AntaSingola.jwd @@ -69,7 +69,7 @@ "JointType": "FULL_H" } ], - "Hardware": "000665", + "Hardware": "000635", "IdGroup": 2, "AreaList": [ { diff --git a/Test.UI/Data/FinDueAnteBottomFisso.jwd b/Test.UI/Data/FinDueAnteBottomFisso.jwd index 9311e7b..f36e5e4 100644 --- a/Test.UI/Data/FinDueAnteBottomFisso.jwd +++ b/Test.UI/Data/FinDueAnteBottomFisso.jwd @@ -106,7 +106,7 @@ "JointType": "FULL_H" } ], - "Hardware": "000656", + "Hardware": "000631", "IdGroup": 6, "AreaList": [ { diff --git a/WebWindowComplex/Compo/CardSashGroup.razor b/WebWindowComplex/Compo/CardSashGroup.razor index 6ac3587..7445425 100644 --- a/WebWindowComplex/Compo/CardSashGroup.razor +++ b/WebWindowComplex/Compo/CardSashGroup.razor @@ -69,7 +69,6 @@ { } -
diff --git a/WebWindowComplex/Compo/CardSplit.razor b/WebWindowComplex/Compo/CardSplit.razor index 3c266d7..f2fa5e4 100644 --- a/WebWindowComplex/Compo/CardSplit.razor +++ b/WebWindowComplex/Compo/CardSplit.razor @@ -11,7 +11,7 @@
-
+
Split
diff --git a/WebWindowComplex/Json/JsonUtility.cs b/WebWindowComplex/Json/JsonUtility.cs index 94b377f..c60fe9b 100644 --- a/WebWindowComplex/Json/JsonUtility.cs +++ b/WebWindowComplex/Json/JsonUtility.cs @@ -398,15 +398,9 @@ namespace WebWindowComplex.Json } foreach (var Joint in m_JointList) newSash.JointList.Add(Joint.Deserialize((Area)ParentArea)); - newSash.SetSelHardwareFromId(Hardware); newSash.SetSelFamilyHardwareFromIndex(Hardware); newSash.RefreshHardwareList(); - //if(Hardware != null && !Hardware.Equals("")) - // newSash.SetSelHardwareFromId(Hardware); - //else - newSash.SetSelHardwareFromId(newSash.SelHardware.Id); - //if (newSash.HardwareList.Count() > 0) - // newSash.SetSelHardwareFromId(newSash.HardwareList.First().Id); + newSash.SetSelHardwareFromId(Hardware); foreach (var Area in AreaList) { var AreaDeserealized = Area.Deserialize(newSash, ParentWindow); diff --git a/WebWindowComplex/Models/Fill.cs b/WebWindowComplex/Models/Fill.cs index 2651fa4..5fe8ee1 100644 --- a/WebWindowComplex/Models/Fill.cs +++ b/WebWindowComplex/Models/Fill.cs @@ -106,7 +106,7 @@ namespace WebWindowComplex.Models private List m_FillTypeList = new List { - new IdNameStruct((int)FillTypes.GLASS, "SvgPreview"), + new IdNameStruct((int)FillTypes.GLASS, "Glass"), new IdNameStruct((int)FillTypes.WOOD, "Wood") }; diff --git a/WebWindowComplex/Models/FrameDimension.cs b/WebWindowComplex/Models/FrameDimension.cs index 6028b5d..66fa6a8 100644 --- a/WebWindowComplex/Models/FrameDimension.cs +++ b/WebWindowComplex/Models/FrameDimension.cs @@ -97,9 +97,9 @@ namespace WebWindowComplex.Models private string m_sName; - // valore massimo e minimo della dimensione del frame + // valore massimo della dimensione del frame private int MaxDim = 4000; - + // valore minimo della dimensione del frame private int MinDim = 600; #endregion Private Fields diff --git a/WebWindowComplex/Models/Sash.cs b/WebWindowComplex/Models/Sash.cs index c2dea74..67c8924 100644 --- a/WebWindowComplex/Models/Sash.cs +++ b/WebWindowComplex/Models/Sash.cs @@ -133,7 +133,7 @@ namespace WebWindowComplex.Models dLastDimension += m_SashList[SashList.Count - 1].dDimension; SashList[SashList.Count - 1].SetDimension(dLastDimension); if (value == 1) - SashList[0].SetHasHandle(true); + SashList.First().SetHasHandle(true); } else { @@ -142,11 +142,11 @@ namespace WebWindowComplex.Models } if (m_SashList.Count == 0) { - Area child = AreaList[0]; + Area child = AreaList.First(); // Se nella singola anta ho uno split if (!(child is Fill)) { - child = child.AreaList[0].AreaList[0]; + child = child.AreaList.First().AreaList.First(); } child.SetParentArea(this.ParentArea); this.ParentArea.AreaList.Remove(this); @@ -157,10 +157,10 @@ namespace WebWindowComplex.Models { // Metto come padre dell'area nello splitted l'anta stessa List ContentArea = new List(); - ContentArea.Add(AreaList[0].AreaList[0]); - ContentArea[0].SetParentArea(this); + ContentArea.Add(AreaList.First().AreaList.First()); + ContentArea.First().SetParentArea(this); AreaList.Clear(); - AreaList.Add(ContentArea[0]); + AreaList.Add(ContentArea.First()); } else { @@ -174,7 +174,7 @@ namespace WebWindowComplex.Models foreach (Area area in AreaList) { if (area is Splitted) - ContentArea.Add(area.AreaList[0]); + ContentArea.Add(area.AreaList.First()); else ContentArea.Add(area); } @@ -637,7 +637,7 @@ namespace WebWindowComplex.Models { if (m_HardwareList.Count > 0) { - m_SelHardware = m_HardwareList[0]; + m_SelHardware = m_HardwareList.First(); } } @@ -732,8 +732,8 @@ namespace WebWindowComplex.Models SelHardware = m_HardwareCompleteList.FirstOrDefault(x => x.Id.Equals(sId)) ?? new Hardware("", "", "", Enums.OpeningTypes.Null, "", 0, 0); else SelHardware = m_HardwareList.FirstOrDefault(x => x.Id.Equals(sId)) ?? new Hardware("", "", "", Enums.OpeningTypes.Null, "", 0, 0); - if (SelHardware == null) - SelHardware = m_HardwareList[0]; + if (SelHardware.Id == "") + SelHardware = m_HardwareList.First(); //SelFamilyHardware = m_SelHardware.FamilyName; } @@ -788,7 +788,7 @@ namespace WebWindowComplex.Models } else { - answ = GetOpeningType(m_SashList[0].OpeningType); + answ = GetOpeningType(m_SashList.First().OpeningType); } return answ; } diff --git a/WebWindowComplex/Models/Split.cs b/WebWindowComplex/Models/Split.cs index df18735..8481927 100644 --- a/WebWindowComplex/Models/Split.cs +++ b/WebWindowComplex/Models/Split.cs @@ -319,7 +319,11 @@ namespace WebWindowComplex.Models newSplit.SetIdGroup(nCounterGroup); newSplit.SetSplitStartVert(bSplitStartVert); newSplit.SetSplitQtyVert(nSplitQtyVert); + for (int i = 0; i < SplitVertList.Count; i++) + newSplit.SplitVertList.ElementAt(i).SetDimension(SplitVertList.ElementAt(i).dDimension); newSplit.SetSplitQtyHoriz(nSplitQtyHoriz); + for (int i = 0; i < SplitHorizList.Count; i++) + newSplit.SplitHorizList.ElementAt(i).SetDimension(SplitHorizList.ElementAt(i).dDimension); newSplit.SetSplitShape(SelSplitShape, true); newSplit.SetAreaType(AreaType); foreach (var item in AreaList) diff --git a/WebWindowComplex/TableComp.razor b/WebWindowComplex/TableComp.razor index f2f25d8..1095e49 100644 --- a/WebWindowComplex/TableComp.razor +++ b/WebWindowComplex/TableComp.razor @@ -26,7 +26,6 @@
Errore configurazione:
-
    @foreach (var item in listErrLink) { @@ -135,8 +134,7 @@ } else { - Split item = SplitList[currSplit]; - + } } else if (currStep == CompileStep.Sash) @@ -179,7 +177,6 @@
    Mancata corrispondenza valori:
    -
      @foreach (var item in listWarnings) { diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index 2e82687..f4c3382 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -279,8 +279,8 @@ namespace WebWindowComplex } case AreaTypes.FILL: { - if ((node.ParentArea.AreaList.Count > 1 && node.ParentArea.AreaList[0].Equals(node)) || - (node.ParentArea.ParentArea != null && node.ParentArea.ParentArea.AreaList.Count > 1 && node.ParentArea.ParentArea.AreaList[0].AreaList[0].Equals(node))) + if ((node.ParentArea.AreaList.Count > 1 && node.ParentArea.AreaList.First().Equals(node)) || + (node.ParentArea.ParentArea != null && node.ParentArea.ParentArea.AreaList.Count > 1 && node.ParentArea.ParentArea.AreaList.First().AreaList.First().Equals(node))) maxCol++; string nFill; for (int i = 0; i < FillList.Count; i++) @@ -302,7 +302,7 @@ namespace WebWindowComplex // Se il nodo ha fratelli o cugini if (node.ParentArea.AreaList.Count > 1 || (node.ParentArea.ParentArea != null && node.ParentArea.ParentArea.AreaList.Count > 1)) { - if (node.ParentArea.AreaList[0].Equals(node) || node.ParentArea.ParentArea.AreaList[0].Equals(node)) + if (node.ParentArea.AreaList.First().Equals(node) || node.ParentArea.ParentArea.AreaList.First().Equals(node)) maxCol++; for (int i = 0; i < SplitList.Count; i++) { @@ -394,7 +394,7 @@ namespace WebWindowComplex } case AreaTypes.SPLITTED: { - if (node.ParentArea is Split && !IntoSash && node.AreaList[0] is Fill) + if (node.ParentArea is Split && !IntoSash && node.AreaList.First() is Fill) { m_SplittedList.Add((Splitted)node); } @@ -608,9 +608,9 @@ namespace WebWindowComplex if (m_PreviousWindow != null) { for (int i = 0; i < 2; i++) - m_CurrWindow.AreaList[0].DimensionList[i] = m_PreviousWindow.AreaList[0].DimensionList[i]; + m_CurrWindow.AreaList.First().DimensionList[i] = m_PreviousWindow.AreaList.First().DimensionList[i]; for (int i = 0; i < 4; i++) - m_CurrWindow.AreaList[0].JointList[i] = m_PreviousWindow.AreaList[0].JointList[i]; + m_CurrWindow.AreaList.First().JointList[i] = m_PreviousWindow.AreaList.First().JointList[i]; } if (m_CurrWindow != null) { @@ -633,8 +633,8 @@ namespace WebWindowComplex m_SplitList = new List(); m_SplittedList = new List(); m_ItemTableList = new List(); - CreateWindowsList((m_CurrWindow!).AreaList[0], false); - CreateElementTable(m_CurrWindow.AreaList[0], 1, 1, 1, 1); + CreateWindowsList((m_CurrWindow!).AreaList.First(), false); + CreateElementTable(m_CurrWindow.AreaList.First(), 1, 1, 1, 1); } /// diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index d03b3f8..0eec1e1 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1414 + 2.7.10.1511 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -49,4 +49,27 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index a6c8d1e..4a186d5 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1414 + 2.7.10.1511 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -56,6 +56,23 @@ + + + + + + + + + + + + + + + + + From 5dcb723a998e24920f2abb7ddc1ebcd1ad006879 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 15 Oct 2025 11:09:23 +0200 Subject: [PATCH 20/23] update vers --- WebWindowComplex/WebWindowComplex.csproj | 1 + WebWindowConfigurator/WebWindowConfigurator.csproj | 1 + 2 files changed, 2 insertions(+) diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 0eec1e1..a27842a 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -71,5 +71,6 @@ + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 4a186d5..24e4982 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -84,5 +84,6 @@ + From 1b57d2826a01b1c7d3b1e1fa7fc4c6ccc09bb0d4 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 15 Oct 2025 11:57:54 +0200 Subject: [PATCH 21/23] Aggiunto bozza serializzatore x mass modification --- WebWindowComplex/SerialMan.cs | 39 +++++++++++++++++++ WebWindowComplex/WebWindowComplex.csproj | 1 + .../WebWindowConfigurator.csproj | 1 + 3 files changed, 41 insertions(+) create mode 100644 WebWindowComplex/SerialMan.cs diff --git a/WebWindowComplex/SerialMan.cs b/WebWindowComplex/SerialMan.cs new file mode 100644 index 0000000..e540302 --- /dev/null +++ b/WebWindowComplex/SerialMan.cs @@ -0,0 +1,39 @@ +using Egw.Window.Data; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WebWindowComplex +{ + public class SerialMan + { + + /// + /// Riceve un JWD in ingresso e effettua una sostituzione dei parametri rieschiesti (SE non nulli) + /// + /// + /// + /// + /// + /// Valore serializzato con le modifiche richieste + public string MassUpdate(string currSer, string? newFamilyHardware, Hardware? newHardware, string? newColorMaterial) + { + string outVal = currSer; + // serializzazione JWD --> window + + // verifica 1:1 delle richieste + if (!string.IsNullOrEmpty(newFamilyHardware)) + { + } + if (newHardware != null) + { + } + if (!string.IsNullOrEmpty(newColorMaterial)) + { + } + return outVal; + } + } +} diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index a27842a..ffa667d 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -72,5 +72,6 @@ + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 24e4982..cb82d40 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -85,5 +85,6 @@ + From cfc019c8e7616596729f13deaffd677d731bb602 Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Wed, 15 Oct 2025 16:13:55 +0200 Subject: [PATCH 22/23] aggiornata funzione SerialMan --- Test.UI/Components/Pages/EditJWD.razor | 62 +++++++++++++++++++ Test.UI/Components/Pages/EditJWD.razor.cs | 12 ++++ WebWindowComplex/SerialMan.cs | 50 +++++++++++++-- WebWindowComplex/WebWindowComplex.csproj | 23 ++++++- .../WebWindowConfigurator.csproj | 21 ++++++- 5 files changed, 162 insertions(+), 6 deletions(-) diff --git a/Test.UI/Components/Pages/EditJWD.razor b/Test.UI/Components/Pages/EditJWD.razor index 3fdf510..20de6e0 100644 --- a/Test.UI/Components/Pages/EditJWD.razor +++ b/Test.UI/Components/Pages/EditJWD.razor @@ -3,6 +3,68 @@ EditJWD +
      +
      +
      + FamilyHw + +
      +
      + +
      +
      + Color + +
      +
      +
      +
      + Material + +
      +
      +
      +
      + Glass + +
      +
      +
      +
      + Profile + +
      +
      +
      + +
      +
      + /// Riceve un JWD in ingresso e effettua una sostituzione dei parametri rieschiesti (SE non nulli) ///
      @@ -18,22 +21,61 @@ namespace WebWindowComplex /// /// /// Valore serializzato con le modifiche richieste - public string MassUpdate(string currSer, string? newFamilyHardware, Hardware? newHardware, string? newColorMaterial) + public static string MassUpdate(string currSer, string? newFamilyHardware, Hardware? newHardware, string? newColorMaterial, string? newMaterial, string? newGlass, string? newProfile) { string outVal = currSer; // serializzazione JWD --> window - + JsonWindow WindowFromJson = JsonConvert.DeserializeObject(currSer, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", ""); + Window currWindow = WindowFromJson.Deserialize(); // verifica 1:1 delle richieste if (!string.IsNullOrEmpty(newFamilyHardware)) { + SearchSash(currWindow.AreaList.First(), newFamilyHardware, null); } if (newHardware != null) { + SearchSash(currWindow.AreaList.First(), null, newHardware); } if (!string.IsNullOrEmpty(newColorMaterial)) { + currWindow.sColorMaterial = newColorMaterial; + } + if (!string.IsNullOrEmpty(newMaterial)) + { + currWindow.sMaterial = newMaterial; + } + if (!string.IsNullOrEmpty(newGlass)) + { + currWindow.sGlass = newGlass; + } + if (!string.IsNullOrEmpty(newProfile)) + { + currWindow.sProfilePath = newProfile; + } + var CurrJwd = JsonConvert.SerializeObject(currWindow.Serialize(), Formatting.Indented); + return CurrJwd; + + + } + + internal static void SearchSash(Area currentArea, string? newFamilyHw, Hardware? newHardware) + { + if (currentArea.AreaType.Equals(AreaTypes.SASH)) + { + Sash s = (Sash)currentArea; + if (!string.IsNullOrEmpty(newFamilyHw)) + { + s.SelFamilyHardware = newFamilyHw; + } + if (newHardware != null) + { + s.SelHardware = newHardware; + } + } + foreach (Area child in currentArea.AreaList) + { + SearchSash(child, newFamilyHw, newHardware); } - return outVal; } } } diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index ffa667d..ec2251a 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1511 + 2.7.10.1514 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -55,6 +55,27 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index cb82d40..9c14bf6 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1511 + 2.7.10.1514 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -68,6 +68,25 @@ + + + + + + + + + + + + + + + + + + + From ad5977eb0fd781cecb8875a46d5a1faf922a5485 Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Mon, 20 Oct 2025 14:44:47 +0200 Subject: [PATCH 23/23] Aggiornati Nuget --- Test.UI/Components/Pages/EditJWD.razor | 4 ++-- Test.UI/Test.UI.csproj | 4 ++-- WebWindowComplex/WebWindowComplex.csproj | 18 +++++++++++++++--- .../WebWindowConfigurator.csproj | 7 ++++--- WebWindowTest/WebWindowTest.csproj | 4 ++-- 5 files changed, 25 insertions(+), 12 deletions(-) diff --git a/Test.UI/Components/Pages/EditJWD.razor b/Test.UI/Components/Pages/EditJWD.razor index 20de6e0..3b1d466 100644 --- a/Test.UI/Components/Pages/EditJWD.razor +++ b/Test.UI/Components/Pages/EditJWD.razor @@ -3,7 +3,7 @@ EditJWD -
      +@*
      FamilyHw @@ -64,7 +64,7 @@
      - + *@ - - + + diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index ec2251a..00a4df8 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1514 + 2.7.10.2014 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -19,8 +19,8 @@ - - + + @@ -83,6 +83,18 @@ + + + + + + + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 9c14bf6..8f07910 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1514 + 2.7.10.2014 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -27,8 +27,8 @@ - - + + @@ -105,5 +105,6 @@ + diff --git a/WebWindowTest/WebWindowTest.csproj b/WebWindowTest/WebWindowTest.csproj index 42d8abe..04868e5 100644 --- a/WebWindowTest/WebWindowTest.csproj +++ b/WebWindowTest/WebWindowTest.csproj @@ -13,8 +13,8 @@ - - + +