From 1fed423ab068f10f99af342fb9fd2785d879d9df Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Mon, 24 Nov 2025 14:50:32 +0100 Subject: [PATCH] - Aggiornato passaggio parametri tra componenti - Aggiornata interfaccia sash - Aggiornato jwd di base nel caso di sbagliata deserializzazione - Aggiornato readme --- README.md | 74 ++-- WebWindowComplex/Compo/AreaFrame.razor | 2 +- WebWindowComplex/Compo/AreaFrame.razor.cs | 10 +- WebWindowComplex/Compo/AreaHwOption.razor | 4 +- WebWindowComplex/Compo/AreaHwOption.razor.cs | 8 +- WebWindowComplex/Compo/AreaSash.razor | 364 ++++++++++++------ WebWindowComplex/Compo/AreaSash.razor.cs | 80 ++-- WebWindowComplex/Compo/AreaSplit.razor | 6 +- WebWindowComplex/Compo/AreaSplit.razor.cs | 8 +- WebWindowComplex/Compo/CardFill.razor | 5 +- WebWindowComplex/Compo/CardFill.razor.cs | 4 +- WebWindowComplex/Compo/CardFrame.razor | 27 +- WebWindowComplex/Compo/CardFrame.razor.cs | 30 +- WebWindowComplex/Compo/CardSashGroup.razor | 155 ++++---- WebWindowComplex/Compo/CardSashGroup.razor.cs | 70 ++-- WebWindowComplex/Compo/CardSplit.razor | 4 - WebWindowComplex/Compo/CardSplit.razor.cs | 8 +- WebWindowComplex/Models/Sash.cs | 52 ++- WebWindowComplex/TableComp.razor | 102 ++--- WebWindowComplex/TableComp.razor.cs | 42 +- WebWindowComplex/WebWindowComplex.csproj | 7 +- .../WebWindowConfigurator.csproj | 3 +- 22 files changed, 617 insertions(+), 448 deletions(-) diff --git a/README.md b/README.md index 43838b6..2c3d7ea 100644 --- a/README.md +++ b/README.md @@ -7,23 +7,24 @@ Durante la configurazione ad ogni cambiamento viene aggiornata l'immagine del se ## Requisiti I requisiti per utilizzare il componente sono: - - JWD da modificare - - Lista delle famiglie hardware - - Lista hardware - - Lista dei materiali - - Lista dei colori dei materiali - - Lista dei vetri ammessi - - Lista dei profili gestiti + - JWD da modificare; + - Lista delle famiglie hardware; + - Lista hardware; + - Lista dei materiali; + - Lista dei colori dei materiali; + - Lista dei vetri ammessi; + - Lista dei profili gestiti. ## Funzionalità componente Il componente permette i seguenti comportamenti principali: - - Aggiungere un gruppo di ante al telaio, - - Aggiungere uno split al telaio o a un anta, - - Copiare il contenuto di un'anta in un'altra anta, - - Eliminare un gruppo di ante, - - Eliminare uno split + - Aggiungere un gruppo di ante al telaio; + - Aggiungere uno split al telaio o a un anta; + - Copiare il contenuto di un'anta in un'altra anta; + - Eliminare un gruppo di ante; + - Eliminare uno split; + - Cambiare le caratteristiche dei gruppi di ante, delle singole ante, degli split e del frame. ## JWD @@ -53,17 +54,17 @@ Al frame sono associate le seguenti caratteristiche: #### Forme Telaio Le forme ammesse per il telaio sono le seguenti: - - Rectangle - - Right Chamfer - - Left Chamfer - - Double Chamfer - - Arc - - Full Arc - - Fillet - - Double Arc - - Three Center Arc - - Triangle, - - Custom + - Rectangle; + - Right Chamfer; + - Left Chamfer; + - Double Chamfer; + - Arc; + - Full Arc; + - Fillet; + - Double Arc; + - Three Center Arc; + - Triangle; + - Custom. ### Divisione (Split) @@ -71,9 +72,9 @@ Uno split genera sempre almeno due sottoaree contenenti ognuna un riempimento (F Se ci sono solo due sottoaree generate da uno split, si possono scambiare tra di loro. Uno split può essere: - - Orizzontale, definisco il numero di split orizzontali e l'altezza delle nuove aree orizzontali formate; - - Verticale, definisco il numero di split verticali e la larghezza delle nuove aree verticali formate; - - A griglia, definisco il numero di split orizzontali e verticali e l'altezza delle aree orizzontali e la larghezza delle aree verticali. + - Orizzontale, viene definito il numero di split orizzontali e l'altezza delle nuove aree orizzontali formate; + - Verticale, viene definito il numero di split verticali e la larghezza delle nuove aree verticali formate; + - A griglia, viene definito il numero di split orizzontali e verticali e l'altezza delle aree orizzontali e la larghezza delle aree verticali; in questo caso si può scegliere se hanno la precedenza gli split orizzontali o verticali (cambia il modo in cui si esegue l'incrocio tra gli split). ### Gruppo di ante (Sash group) @@ -81,33 +82,22 @@ Al gruppo di ante sono associate le seguenti caratteristiche: - Numero di ante; - Orientamento; - Quantità bottom rail; - - Giunti; - Codice hardware. -#### Forme gruppo ante - -Le forme ammesse per il telaio sono le seguenti: - - Arc - - Circle - - Custom - - FullArc - - Rectangle - - SemiArc - - SemiFullArc - - Trapezoid - #### Singola anta La singola anta ha associate le seguenti caratteristiche: - Tipologia di apertura; - Dimensione; - - Presenza maniglia. + - Tipo di misura per la dimensione (assoluta, percentuale o proporzionale) + - Presenza maniglia; + - Giunti. #### Hardware Per calcolare la lista di hardware ammessi data una famiglia di hardware servono i seguenti dati: - Forma del gruppo di ante (tramite richiesta al programma di calcolo); - - Apertura dell'anta con la maniglia; + - Tipo di apertura dell'anta con la maniglia; - Numero di ante; - Posizione anta battente (nel caso di tre o più ante, bisogna sapere se l'anta con la maniglia è incernierata al telaio o a un'altra anta). @@ -135,8 +125,6 @@ Vengono richieste nei seguenti casi: Descrive il tipo di riempimento: vetro o pannello. - - ## Roadmap Mancano: diff --git a/WebWindowComplex/Compo/AreaFrame.razor b/WebWindowComplex/Compo/AreaFrame.razor index 19908a6..f9a4a9a 100644 --- a/WebWindowComplex/Compo/AreaFrame.razor +++ b/WebWindowComplex/Compo/AreaFrame.razor @@ -5,7 +5,7 @@
Area frame
- @if (CurrSashList.Count == 0 && CurrSplitList.Count == 0) + @if (SashList.Count == 0 && SplitList.Count == 0) {
diff --git a/WebWindowComplex/Compo/AreaFrame.razor.cs b/WebWindowComplex/Compo/AreaFrame.razor.cs index b74d237..b9d1b94 100644 --- a/WebWindowComplex/Compo/AreaFrame.razor.cs +++ b/WebWindowComplex/Compo/AreaFrame.razor.cs @@ -7,14 +7,14 @@ namespace WebWindowComplex.Compo { #region Public Properties - [Parameter] + [CascadingParameter(Name = "CurrFrameWindow")] public Frame CurrFrameWindow { get; set; } = null!; - [Parameter] - public List CurrSashList { get; set; } = null!; + [CascadingParameter(Name = "SashList")] + public List SashList { get; set; } = null!; - [Parameter] - public List CurrSplitList { get; set; } = null!; + [CascadingParameter(Name = "SplitList")] + public List SplitList { get; set; } = null!; [Parameter] public EventCallback EC_AddSash { get; set; } diff --git a/WebWindowComplex/Compo/AreaHwOption.razor b/WebWindowComplex/Compo/AreaHwOption.razor index a6a1b40..baed002 100644 --- a/WebWindowComplex/Compo/AreaHwOption.razor +++ b/WebWindowComplex/Compo/AreaHwOption.razor @@ -5,7 +5,7 @@
Hardware option
- +
@@ -30,7 +30,7 @@ {
- @foreach (var currOpt in CurrSash.HwOptionList) + @foreach (var currOpt in CurrSashGroup.HwOptionList) { switch (currOpt.Type) { diff --git a/WebWindowComplex/Compo/AreaHwOption.razor.cs b/WebWindowComplex/Compo/AreaHwOption.razor.cs index 386be5f..1b352fc 100644 --- a/WebWindowComplex/Compo/AreaHwOption.razor.cs +++ b/WebWindowComplex/Compo/AreaHwOption.razor.cs @@ -11,8 +11,8 @@ namespace WebWindowComplex.Compo /// /// Sash corrente rispetto alla lista Sash /// - [Parameter] - public Sash CurrSash { get; set; } = null!; + [CascadingParameter(Name = "CurrSashGroup")] + public Sash CurrSashGroup { get; set; } = null!; /// /// Evento per aggiornare gli hardware option di tipo combo @@ -48,9 +48,9 @@ namespace WebWindowComplex.Compo private async Task changeCollapsed() { hwOptCollapsed = !hwOptCollapsed; - if (CurrSash.HwOptionList.Count == 0) + if (CurrSashGroup.HwOptionList.Count == 0) { - await EC_FirstHwOptionList.InvokeAsync(CurrSash.GroupId); + await EC_FirstHwOptionList.InvokeAsync(CurrSashGroup.GroupId); } } diff --git a/WebWindowComplex/Compo/AreaSash.razor b/WebWindowComplex/Compo/AreaSash.razor index 08ac786..f116fcc 100644 --- a/WebWindowComplex/Compo/AreaSash.razor +++ b/WebWindowComplex/Compo/AreaSash.razor @@ -4,7 +4,27 @@
Sash @(CurrSashGroup.SashList.Count == 1 ? "" : (IndexSash + 1))
- + +
@@ -45,7 +65,16 @@ }
- @*
+
+
+ +
+
+ +
+
+ @* +
Joints
@@ -54,6 +83,7 @@
+ @if (!JointCollapsed) {
@@ -82,14 +112,7 @@ } }
-
-
- -
-
- -
-
+ @if (!(CurrAnta.AreaList[0] is Split)) {
@@ -124,126 +147,233 @@ } else { - - } + } *@ else {
@@ -78,17 +78,20 @@ { m_PreviousWindow = m_CurrWindow; } - - + + + + + + + + } else if (currStep == CompileStep.Split) { @@ -98,16 +101,18 @@ } else { - - + + + + + + } } else if (currStep == CompileStep.Sash) @@ -119,20 +124,21 @@ else { - - + + + + - } + } } else if (currStep == CompileStep.Fill) { @@ -142,17 +148,19 @@ } else { - - + + + + + + } } else if (currStep == CompileStep.General) diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index c655ac5..e84c1ed 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -1,13 +1,12 @@ using Egw.Window.Data; using Microsoft.AspNetCore.Components; using Newtonsoft.Json; -using System.Reflection.Metadata; using WebWindowComplex.Compo; using WebWindowComplex.DTO; using WebWindowComplex.Json; using WebWindowComplex.Models; -using static WebWindowComplex.LayoutConst; using static WebWindowComplex.Json.WindowConst; +using static WebWindowComplex.LayoutConst; namespace WebWindowComplex { @@ -736,13 +735,36 @@ namespace WebWindowComplex { listErrLink.Add("Window", $"Deserializing Error:{Environment.NewLine}{ex}"); // uso un oggetto "basico" per non fermarmi - WindowFromJson = new JsonWindow("", "", "", ""); - List AreaList = new List(); - JsonFrame baseFrame = new JsonFrame(); - baseFrame.DimensionList.Add(new JsonFrameDimension(0, "Width", 800)); - baseFrame.DimensionList.Add(new JsonFrameDimension(0, "Height", 1200)); - AreaList.Add(baseFrame); - WindowFromJson.AreaList = AreaList; + //string jwd = "{\r\n \"ProfilePath\": \"Profilo78\",\r\n \"Material\": \"Pino\",\r\n \"ColorMaterial\": \"Black\",\r\n \"Glass\": \"Vetro BE 2S 4T/16/4T\",\r\n \"AreaList\": [\r\n {\r\n \"Shape\": \"RECTANGLE\",\r\n \"DimensionList\": [\r\n {\r\n \"Index\": 1,\r\n \"Name\": \"Width\",\r\n \"Value\": 800.0\r\n },\r\n {\r\n \"Index\": 2,\r\n \"Name\": \"Height\",\r\n \"Value\": 1200.0\r\n }\r\n ],\r\n \"JointList\": [\r\n {\r\n \"Index\": 1,\r\n \"JointType\": \"FULL_H\"\r\n },\r\n {\r\n \"Index\": 2,\r\n \"JointType\": \"FULL_H\"\r\n },\r\n {\r\n \"Index\": 3,\r\n \"JointType\": \"FULL_H\"\r\n },\r\n {\r\n \"Index\": 4,\r\n \"JointType\": \"FULL_H\"\r\n }\r\n ],\r\n \"BottomRail\": false,\r\n \"BottomRailQty\": 0,\r\n \"GroupId\": 1,\r\n \"AreaList\": [\r\n {\r\n \"FillType\": \"GLASS\",\r\n \"GroupId\": 7,\r\n \"AreaList\": [],\r\n \"AreaType\": \"FILL\"\r\n }\r\n ],\r\n \"AreaType\": \"FRAME\"\r\n }\r\n ]\r\n}"; + //WindowFromJson = JsonConvert.DeserializeObject(jwd, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", ""); + //setCurrWindow(WindowFromJson); + //await DoPreviewSvg(true); + Window window = new Window(); + Frame frame = new Frame(null, window); + List DimensionList = new List + { + new FrameDimension(frame, 1, "Width", 800, false), + new FrameDimension(frame, 1, "Height", 1200, true) + }; + List JointList = new List + { + new Joint(frame, 1, Joints.FULL_H), + new Joint(frame, 2, Joints.FULL_H), + new Joint(frame, 3, Joints.FULL_H), + new Joint(frame, 4, Joints.FULL_H) + }; + JsonWindow jsonWindow = new JsonWindow("Profilo78", "Pino", "Black", "Vetro BE 2S 4T/16/4T"); + JsonFrame jsonFrame = new JsonFrame(Shapes.RECTANGLE, false, 0, 1); + jsonWindow.AreaList.Add(jsonFrame); + foreach (var Dimension in DimensionList) + jsonFrame.DimensionList.Add(Dimension.Serialize()); + foreach (var Joint in JointList) + jsonFrame.JointList.Add(Joint.Serialize()); + jsonFrame.AreaList.Add(Fill.CreateFill(frame, FillTypes.GLASS).Serialize(true)); + string jwd = JsonConvert.SerializeObject(jsonWindow); + WindowFromJson = JsonConvert.DeserializeObject(jwd, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", ""); + setCurrWindow(WindowFromJson); + await DoPreviewSvg(true); } } else @@ -759,7 +781,7 @@ namespace WebWindowComplex if (updRequested) { // se mancasse dizionario forme chiamo quello - if (LiveData.DictShape.Count == 0) + if (LiveData.DictShape.Count == 0 && listErrLink.Count == 0) { if (firstDisplay && isRendered) { diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index ef6748e..e3eb945 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.11.2017 + 2.7.11.2414 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -144,6 +144,11 @@ + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 6a1d0aa..4cded15 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.11.2017 + 2.7.11.2414 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -223,5 +223,6 @@ +