From d740267d065a277a5c60290c5b3acdffcbc33266 Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Wed, 20 Aug 2025 17:55:42 +0200 Subject: [PATCH] - aggiunti commenti - aggiunti controlli su alcuni campi --- Test.UI/Components/Pages/Home.razor | 5 + .../WebAedificaMaker.razor | 2 +- .../WebAedificaMaker.razor.cs | 8 +- .../WebWindowConfigurator.csproj | 36 +- WebWindowConfigurator/WebWindowMaker.razor | 307 +++++++++++----- WebWindowConfigurator/WebWindowMaker.razor.cs | 72 +++- WebWindowJWD/WebWindowJWDInput.razor | 339 ++++++++++++------ 7 files changed, 558 insertions(+), 211 deletions(-) diff --git a/Test.UI/Components/Pages/Home.razor b/Test.UI/Components/Pages/Home.razor index 1b7c608..4592bae 100644 --- a/Test.UI/Components/Pages/Home.razor +++ b/Test.UI/Components/Pages/Home.razor @@ -17,3 +17,8 @@ else } +@if (m_CurrArgs.GetValueOrDefault("Jwd") != null) +{ +

@m_CurrArgs["Jwd"]

+} + diff --git a/WebAedificaConfigurator/WebAedificaMaker.razor b/WebAedificaConfigurator/WebAedificaMaker.razor index f9f5550..1b3f7b2 100644 --- a/WebAedificaConfigurator/WebAedificaMaker.razor +++ b/WebAedificaConfigurator/WebAedificaMaker.razor @@ -14,7 +14,7 @@
- +
diff --git a/WebAedificaConfigurator/WebAedificaMaker.razor.cs b/WebAedificaConfigurator/WebAedificaMaker.razor.cs index dcfd8a5..385cbf2 100644 --- a/WebAedificaConfigurator/WebAedificaMaker.razor.cs +++ b/WebAedificaConfigurator/WebAedificaMaker.razor.cs @@ -26,6 +26,10 @@ namespace WebAedificaConfigurator set => m_sSvg = value; } + /// + /// Salvattagio dizionario contenente il file + /// + /// protected async Task DoSave() { Dictionary Args = new Dictionary(); @@ -47,9 +51,5 @@ namespace WebAedificaConfigurator } } - private string mainCss - { - get => "col-6"; - } } } diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 3444af9..f6af7c3 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 2.7.8.1817 + 2.7.8.2016 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -81,6 +81,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WebWindowConfigurator/WebWindowMaker.razor b/WebWindowConfigurator/WebWindowMaker.razor index 3dba55a..5aca63a 100644 --- a/WebWindowConfigurator/WebWindowMaker.razor +++ b/WebWindowConfigurator/WebWindowMaker.razor @@ -1,5 +1,4 @@ - -
+
@@ -16,24 +15,27 @@ Template } - - @if ( m_SplitList.Count > 0) + @if (FrameWindow != null) { - } - @if(m_SashList.Count > 0) - { + @if(m_SplitList.Count > 0) + { + + } + @if (m_SashList.Count > 0) + { + + } } -
@@ -44,7 +46,7 @@
-
+
@if (currStep == CompileStep.Template) { @@ -63,7 +65,7 @@ colorClass = "table-success"; else colorClass = ""; - + @@ -76,10 +78,10 @@ {
-
+
- @@ -93,12 +95,12 @@
Dimension
- @foreach (FrameDimension dimension in m_Frame.DimensionList) + @foreach (FrameDimension dimension in FrameWindow.DimensionList) {
- @dimension.nIndex - @dimension.sName - + @dimension.sName + + mm
}
@@ -106,11 +108,11 @@
Joints frame
- @foreach (Joint joint in m_Frame.JointList) + @foreach (Joint joint in FrameWindow.JointList) {
- - @@ -126,7 +128,7 @@
Bottom rail
Quantity - +
@@ -139,18 +141,131 @@ {
-
- @foreach (var item in SplitList) +
+
+ @for (int i = 0; i +
+
+
Split @(i + 1)
+
+ Number + +
+
+ + +
+ @foreach (var dim in currSplit.SplitPositionList) + { + string desc = ""; + @if (currSplit.SelSplitShape == Json.WindowConst.SplitShapes.VERTICAL) + { + @if (currSplit.SplitPositionList.IndexOf(dim) == 0) + { + desc = "Larghezza a sx di split"; + } + else + { + desc = "Larghezza a dx di split"; + } + } + else + { + @if (currSplit.SplitPositionList.IndexOf(dim) == 0) + { + desc = "Altezza sotto split"; + } + else + { + desc = "Altezza sopra split"; + } + } +
+ @desc + + % +
+ } +
+
+
+ if(i+1 < SplitList.Count) + { + Split NextSplit = SplitList[i+1]; +
+
+
+
Split @(i + 2)
+
+ Number + +
+
+ + +
+ @foreach (var dim in NextSplit.SplitPositionList) + { + string desc = ""; + @if (NextSplit.SelSplitShape == Json.WindowConst.SplitShapes.VERTICAL) + { + @if (NextSplit.SplitPositionList.IndexOf(dim) == 0) + { + desc = "Larghezza a sx di split"; + } + else + { + desc = "Larghezza a dx di split"; + } + } + else + { + @if (NextSplit.SplitPositionList.IndexOf(dim) == 0) + { + desc = "Altezza sotto split"; + } + else + { + desc = "Altezza sopra split"; + } + } +
+ @desc + + % +
+ } +
+
+
+ } + } +
+ @* @foreach (var item in SplitList) {
+
Split @(SplitList.IndexOf(item) + 1)
- Number + Number
- - @@ -169,13 +284,13 @@ desc = "Altezza split "; }
- @desc @(item.SplitPositionList.IndexOf(dim) + 1) + @desc @(item.SplitPositionList.IndexOf(dim) + 1)
}
- } + } *@
@@ -184,28 +299,48 @@ {
-
+
@foreach (var item in SashList) { -
-
- Number - -
-
-
-
-
Orientation
+
+
- - +
+ Number + +
- @foreach (SashDimension sash in item.SashList) +
+
+
+
+
Orientation
+
+ + +
+
+
+
+
+
+
+
Bottom rail
+
+ Quantity + +
+
+
+
+
+ + @* @foreach (SashDimension sash in item.SashList) {
@@ -250,10 +385,11 @@
- } - @*
+ } *@ +
@for(int i = 0; i < item.SashList.Count; i += 2) { + SashDimension sash = item.SashList[i];
@@ -266,8 +402,8 @@
Sash opening @(i + 1)
}
- - @@ -283,15 +419,16 @@
- Dimension - + Dimension + + %
- +
- +
@@ -299,6 +436,7 @@
@if( i + 1 < item.SashList.Count) { + SashDimension sashNext = item.SashList[i + 1];
@@ -311,8 +449,8 @@
Sash opening @(i + 2)
}
- - @@ -328,15 +466,16 @@
- Dimension - + Dimension + + %
- +
- +
@@ -344,29 +483,24 @@
} } -
*@ -
-
-
Sash joints
- @foreach (Joint joint in item.JointList) - { -
- - -
- } -
-
-
-
Bottom rail
-
- Quantity - +
+
+
+
+
Sash joints
+ @foreach (Joint joint in item.JointList) + { +
+ + +
+ } +
@@ -379,7 +513,7 @@ {
-
+
@foreach (var Fill in FillList) {
@@ -417,3 +551,4 @@
}
+ diff --git a/WebWindowConfigurator/WebWindowMaker.razor.cs b/WebWindowConfigurator/WebWindowMaker.razor.cs index 1053eeb..1c9f3bc 100644 --- a/WebWindowConfigurator/WebWindowMaker.razor.cs +++ b/WebWindowConfigurator/WebWindowMaker.razor.cs @@ -1,4 +1,5 @@ using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components.Web; using Newtonsoft.Json; using System.Reflection.Metadata; using WebWindowConfigurator.DTO; @@ -29,6 +30,7 @@ namespace WebWindowConfigurator get => m_SelTemplate; set { + // Se non ho ancora selezionato template oppure se cambio template di selezione if (value != null && (m_SelTemplate == null || (m_SelTemplate != null && value.nIndex != m_SelTemplate.nIndex)) && !string.IsNullOrEmpty(value.JWD)) { m_SelTemplate = value; @@ -43,15 +45,17 @@ namespace WebWindowConfigurator m_FillList = new List(); m_SashList = new List(); m_SplitList = new List(); - SearchInAreaList(m_CurrWindow.AreaList[0]); + // popolo le liste Fill, Sash e Split + CreateWindowsList(m_CurrWindow.AreaList[0]); m_SelSVG = m_SelTemplate.SVG; } + // serve per quando aumentano/diminuiscono quantità Sash e Split (bisogna ricalcolare le liste) if (m_CurrWindow != null) { m_FillList = new List(); m_SashList = new List(); m_SplitList = new List(); - SearchInAreaList(m_CurrWindow.AreaList[0]); + CreateWindowsList(m_CurrWindow.AreaList[0]); } } } @@ -96,7 +100,7 @@ namespace WebWindowConfigurator #region Protected Properties - protected Frame Frame + protected Frame FrameWindow { get => m_Frame; set => m_Frame = value; @@ -137,11 +141,37 @@ namespace WebWindowConfigurator #region Protected Methods + /// + /// Metodo per la scelta della maniglia univoca + /// + /// + /// + protected async Task changeHandle(SashDimension sashDim) + { + foreach (SashDimension item in SashList[0].SashList) + { + if (item.Equals(sashDim)) + { + item.bHasHandle = true; + } + else + { + item.bHasHandle = false; + } + } + await Task.Delay(1); + } + + // Ancora da fare... protected async Task DoClose() { await EC_OnClose.InvokeAsync(true); } + /// + /// Anteprima SVG + /// + /// protected async Task DoPreviewSvg() { if (m_CurrWindow != null) @@ -154,12 +184,17 @@ namespace WebWindowConfigurator } } + // Ancora da fare.. protected async Task DoSave() { //manca salvataggio JWD await EC_OnClose.InvokeAsync(true); } + /// + /// Selezione del template + /// + /// template selezionato protected async void DoSelect(TemplateSelectDTO newSel) { SelTemplateDTO = newSel; @@ -167,13 +202,21 @@ namespace WebWindowConfigurator await EC_OnSelectedTemplate.InvokeAsync(newSel); } - protected async void DoSelectAndPreview(CompileStep newStep) + /// + /// Metodo per cambiare step e aggiornare preview svg + /// + /// step successivo + protected async void NextStepAndPreview(CompileStep newStep) { currStep = newStep; await DoPreviewSvg(); } - protected void SearchInAreaList(Area node) + /// + /// Metodo per identificare oggetti nella Window e popolare le liste Fill, Sash e Split + /// + /// + protected void CreateWindowsList(Area node) { if (node != null) { @@ -181,7 +224,7 @@ namespace WebWindowConfigurator { case AreaTypes.FRAME: { - m_Frame = (Frame)node; + FrameWindow = (Frame)node; break; } case AreaTypes.SASH: @@ -202,14 +245,13 @@ namespace WebWindowConfigurator } foreach (var item in node.AreaList) { - SearchInAreaList(item); + CreateWindowsList(item); } } } #endregion Protected Methods - #region Private Fields private CompileStep currStep = CompileStep.Template; @@ -222,6 +264,14 @@ namespace WebWindowConfigurator private List m_FillList = new List(); + private enum positionJoints + { + BL=0, + BR=1, + TR, + TL + } + #endregion Private Fields #region Private Properties @@ -234,6 +284,10 @@ namespace WebWindowConfigurator #region Private Methods + /// + /// Metodo per andare allo step successivo + /// + /// step successivo private void AdvStep(CompileStep newStep) { currStep = newStep; @@ -258,7 +312,7 @@ namespace WebWindowConfigurator } /// - /// Calcola larghezza + /// Calcola larghezza colonna da mostrare /// /// private string mainCss() diff --git a/WebWindowJWD/WebWindowJWDInput.razor b/WebWindowJWD/WebWindowJWDInput.razor index 8c069dd..cf1729d 100644 --- a/WebWindowJWD/WebWindowJWDInput.razor +++ b/WebWindowJWD/WebWindowJWDInput.razor @@ -38,10 +38,10 @@ {
-
+
- @@ -58,8 +58,8 @@ @foreach (FrameDimension dimension in m_Frame.DimensionList) {
- @dimension.nIndex - @dimension.sName + @dimension.nIndex + @dimension.sName
} @@ -71,8 +71,8 @@ @foreach (Joint joint in m_Frame.JointList) {
- - @@ -101,35 +101,89 @@ {
-
- @foreach (var item in SplitList) - { -
-
-
- Number - -
-
- - -
- @foreach (var dim in item.SplitPositionList) - { -
- Altezza area inferiore - +
+
+ @for (int i = 0; i < SplitList.Count; i += 2) + { + Split currSplit = SplitList[i]; +
+
+
+
Split @(i + 1)
+
+ Number + +
+
+ + +
+ @foreach (var dim in currSplit.SplitPositionList) + { + string desc = ""; + @if (currSplit.SelSplitShape == Json.WindowConst.SplitShapes.VERTICAL) + { + desc = "Larghezza split "; + } + else + { + desc = "Altezza split "; + } +
+ @desc @(currSplit.SplitPositionList.IndexOf(dim) + 1) + +
+ }
- } +
-
- } - @* *@ + if (i + 1 < SplitList.Count) + { + Split NextSplit = SplitList[i + 1]; +
+
+
+
Split @(i + 2)
+
+ Number + +
+
+ + +
+ @foreach (var dim in NextSplit.SplitPositionList) + { + string desc = ""; + @if (NextSplit.SelSplitShape == Json.WindowConst.SplitShapes.VERTICAL) + { + desc = "Larghezza split "; + } + else + { + desc = "Altezza split "; + } +
+ @desc @(NextSplit.SplitPositionList.IndexOf(dim) + 1) + +
+ } +
+
+
+ } + } +
@@ -138,99 +192,163 @@ {
-
+
@foreach (var item in SashList) { -
-
- Number - -
-
-
-
-
Orientation
+
+
- - +
+ Number + +
- @foreach (SashDimension sash in item.SashList) - { -
-
- @if (item.SashList.Count == 1) - { -
Opening
- } - else - { -
Sash opening @(item.SashList.IndexOf(sash) + 1)
- } -
- - -
-
- Dimension - -
-
-
- -
-
- +
+
+
+
+
Orientation
+
+ +
- } -
-
-
Sash joints
- @foreach (Joint joint in item.JointList) +
+
+
+
Bottom rail
+
+ Quantity + +
+
+
+
+
+
+ @for (int i = 0; i < item.SashList.Count; i += 2) + { + SashDimension sash = item.SashList[i]; +
+
+
+ @if (item.SashList.Count == 1) + { +
Opening
+ } + else + { +
Sash opening @(i + 1)
+ } +
+ + +
+
+ Dimension + +
+
+
+ +
+
+ +
+
+
+
+
+ @if (i + 1 < item.SashList.Count) { -
- - + SashDimension sashNext = item.SashList[i + 1]; +
+
+
+ @if (item.SashList.Count == 1) + { +
Opening
+ } + else + { +
Sash opening @(i + 2)
+ } +
+ + +
+
+ Dimension + +
+
+
+ +
+
+ +
+
+
+
} -
+ }
-
-
-
Bottom rail
-
- Quantity - +
+
+
+
+
Sash joints
+ @foreach (Joint joint in item.JointList) + { +
+ + +
+ } +
} - - @* *@
@@ -239,19 +357,20 @@ {
-
+
@foreach (var Fill in FillList) {
@if (FillList.Count == 1) { -
Fill
+
Fill
} else {
Fill @(FillList.IndexOf(Fill) + 1)
} +
@item.Index @item.Description