From e22bb179758f1cc5244bd52bca8dd4bf0b19c234 Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Mon, 25 Aug 2025 18:26:45 +0200 Subject: [PATCH] - aggiunto bottone di reset dati window - aggiunti bottoni per modificare i 4 Joint in contemporanea --- Test.UI/Components/Pages/Home.razor | 5 - .../WebWindowConfigurator.csproj | 13 +- WebWindowConfigurator/WebWindowMaker.razor | 52 ++++++-- WebWindowConfigurator/WebWindowMaker.razor.cs | 111 ++++++++++++++++-- 4 files changed, 153 insertions(+), 28 deletions(-) diff --git a/Test.UI/Components/Pages/Home.razor b/Test.UI/Components/Pages/Home.razor index 4592bae..1b7c608 100644 --- a/Test.UI/Components/Pages/Home.razor +++ b/Test.UI/Components/Pages/Home.razor @@ -17,8 +17,3 @@ else } -@if (m_CurrArgs.GetValueOrDefault("Jwd") != null) -{ -

@m_CurrArgs["Jwd"]

-} - diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index f6af7c3..b6cc4a9 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 2.7.8.2016 + 2.7.8.2517 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -123,6 +123,17 @@ + + + + + + + + + + + diff --git a/WebWindowConfigurator/WebWindowMaker.razor b/WebWindowConfigurator/WebWindowMaker.razor index 5aca63a..61753f0 100644 --- a/WebWindowConfigurator/WebWindowMaker.razor +++ b/WebWindowConfigurator/WebWindowMaker.razor @@ -39,9 +39,13 @@
- - - + + @* *@ + @if(currStep != CompileStep.Template) + { + + } +
@@ -50,7 +54,7 @@ @if (currStep == CompileStep.Template) { - + @@ -76,9 +80,13 @@ } @if (currStep == CompileStep.Frame) { + @if(m_CurrWindow != null) + { + m_PreviousWindow = m_CurrWindow; + }
-
-
+
+
+ mm
} @@ -107,7 +115,18 @@
-
Joints frame
+
Frame joints
+
+
+ +
+
+ +
+
+ +
+
@foreach (Joint joint in FrameWindow.JointList) {
@@ -307,7 +326,7 @@
Number - +
@@ -489,6 +508,17 @@
Sash joints
+
+
+ +
+
+ +
+
+ +
+
@foreach (Joint joint in item.JointList) {
@@ -512,8 +542,8 @@ else if (currStep == CompileStep.Fill) {
-
-
+
+
@foreach (var Fill in FillList) {
diff --git a/WebWindowConfigurator/WebWindowMaker.razor.cs b/WebWindowConfigurator/WebWindowMaker.razor.cs index 1c9f3bc..539403e 100644 --- a/WebWindowConfigurator/WebWindowMaker.razor.cs +++ b/WebWindowConfigurator/WebWindowMaker.razor.cs @@ -1,6 +1,7 @@ using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Web; using Newtonsoft.Json; +using Newtonsoft.Json.Linq; using System.Reflection.Metadata; using WebWindowConfigurator.DTO; using WebWindowConfigurator.Json; @@ -42,6 +43,16 @@ namespace WebWindowConfigurator } m_CurrWindow = WindowFromJson.Deserialize(); m_CurrWindow.OnPreview += M_CurrWindow_OnPreview; + // recupero dimensioni Frame e Joint Frame della finestra precedente + if(m_PreviousWindow != null) + { + m_CurrWindow.AreaList[0].DimensionList[0] = m_PreviousWindow.AreaList[0].DimensionList[0]; + m_CurrWindow.AreaList[0].DimensionList[1] = m_PreviousWindow.AreaList[0].DimensionList[1]; + for (int i = 0; i < 4; i++) + { + m_CurrWindow.AreaList[0].JointList[i] = m_PreviousWindow.AreaList[0].JointList[i]; + } + } m_FillList = new List(); m_SashList = new List(); m_SplitList = new List(); @@ -148,15 +159,18 @@ namespace WebWindowConfigurator /// protected async Task changeHandle(SashDimension sashDim) { - foreach (SashDimension item in SashList[0].SashList) + if(m_SashList[0].AreaList.Count < 3) { - if (item.Equals(sashDim)) + foreach (SashDimension item in SashList[0].SashList) { - item.bHasHandle = true; - } - else - { - item.bHasHandle = false; + if (item.Equals(sashDim)) + { + item.bHasHandle = true; + } + else + { + item.bHasHandle = false; + } } } await Task.Delay(1); @@ -184,6 +198,27 @@ namespace WebWindowConfigurator } } + /// + /// Metodo di reset dei dati a quelli del template + /// + protected async Task DoReset() + { + JsonWindow WindowFromJson = JsonConvert.DeserializeObject(m_SelTemplate.JWD, new PolymorphicJsonConverter()) ?? new JsonWindow(""); + if (m_CurrWindow != null) + { + m_CurrWindow.OnPreview -= M_CurrWindow_OnPreview; + m_CurrWindow = null; + } + m_CurrWindow = WindowFromJson.Deserialize(); + m_CurrWindow.OnPreview += M_CurrWindow_OnPreview; + m_FillList = new List(); + m_SashList = new List(); + m_SplitList = new List(); + // popolo le liste Fill, Sash e Split + CreateWindowsList(m_CurrWindow.AreaList[0]); + await DoPreviewSvg(); + } + // Ancora da fare.. protected async Task DoSave() { @@ -250,6 +285,58 @@ namespace WebWindowConfigurator } } + // Utilizzo di min e max in input form (WIP) + private async Task OnInput(FrameDimension item, double e) + { + if (e > 4000) + { + item.dValue = 4000; + } + else if (e < 600) + { + item.dValue = 600; + } + else + { + item.dValue = e; + } + StateHasChanged(); + 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) + /// oggetto a cui essere applicato (Frame o Sash) + /// + private async Task AllJointsFrame(int int_type, int int_place) + { + Joints type = Joints.ANGLED; + if (int_type == 2) + { + type = Joints.FULL_H; + } + else if (int_type == 3) + { + type = Joints.FULL_V; + } + if(int_place == 0) + { + foreach (Joint joint in FrameWindow.JointList) + { + joint.SetSelJointType(type); + } + } + else if(int_place == 1) + { + foreach (Joint joint in m_SashList[0].JointList) + { + joint.SetSelJointType(type); + } + } + await DoPreviewSvg(); + } + #endregion Protected Methods #region Private Fields @@ -266,10 +353,10 @@ namespace WebWindowConfigurator private enum positionJoints { - BL=0, - BR=1, - TR, - TL + BL=0, // Bottom Left + BR=1, // Bottom Right + TR, // Top Right + TL // Top Left } #endregion Private Fields @@ -278,6 +365,8 @@ namespace WebWindowConfigurator private Window? m_CurrWindow { get; set; } = null; + private Window? m_PreviousWindow { get; set; } = null; + private Template m_SelTemplate { get; set; } = null!; #endregion Private Properties
# Image