From 36d7c2f97da225b1348959e67c4e1e5af17bbc0b Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Fri, 12 Sep 2025 10:09:38 +0200 Subject: [PATCH] - Eliminate classi non usate - Eliminato Componente di Test --- Test.UI/Components/Pages/TestComponent.razor | 3 +- WebWindowComplex/Json/JsonUtility.cs | 46 - WebWindowComplex/Json/WindowConst.cs | 66 -- WebWindowComplex/Window.cs | 184 +--- WebWindowConfigurator/WebTest.razor | 813 ------------------ WebWindowConfigurator/WebTest.razor.cs | 619 ------------- WebWindowConfigurator/WebTest.razor.css | 17 - .../WebWindowConfigurator.csproj | 12 +- 8 files changed, 44 insertions(+), 1716 deletions(-) delete mode 100644 WebWindowConfigurator/WebTest.razor delete mode 100644 WebWindowConfigurator/WebTest.razor.cs delete mode 100644 WebWindowConfigurator/WebTest.razor.css diff --git a/Test.UI/Components/Pages/TestComponent.razor b/Test.UI/Components/Pages/TestComponent.razor index da7b091..79ceb81 100644 --- a/Test.UI/Components/Pages/TestComponent.razor +++ b/Test.UI/Components/Pages/TestComponent.razor @@ -3,9 +3,10 @@ TestComponent - + *@ \ No newline at end of file diff --git a/WebWindowComplex/Json/JsonUtility.cs b/WebWindowComplex/Json/JsonUtility.cs index 90920e8..429b986 100644 --- a/WebWindowComplex/Json/JsonUtility.cs +++ b/WebWindowComplex/Json/JsonUtility.cs @@ -515,52 +515,6 @@ namespace WebWindowComplex.Json } } - public class JsonCurve - { - private GDB_TY m_CurveType; - [JsonProperty] - [JsonConverter(typeof(StringEnumConverter))] - public GDB_TY CurveType - { - get - { - return m_CurveType; - } - set - { - m_CurveType = value; - } - } - - private Point3d m_ptStart; - [JsonProperty] - public Point3d ptStart - { - get - { - return m_ptStart; - } - set - { - m_ptStart = value; - } - } - - private Point3d m_ptEnd; - [JsonProperty] - public Point3d ptEnd - { - get - { - return m_ptEnd; - } - set - { - m_ptEnd = value; - } - } - } - public class JsonFrameDimension { private int m_nIndex; diff --git a/WebWindowComplex/Json/WindowConst.cs b/WebWindowComplex/Json/WindowConst.cs index 144ba12..c9eb397 100644 --- a/WebWindowComplex/Json/WindowConst.cs +++ b/WebWindowComplex/Json/WindowConst.cs @@ -110,25 +110,6 @@ namespace WebWindowComplex.Json HORIZONTAL = 2 } - public enum GDB_TY - { - NONE = 0, - GROUP = 2, - GEO_VECTOR = 128, - GEO_POINT = 129, - GEO_FRAME = 130, - CRV_LINE = 256, - CRV_ARC = 257, - CRV_BEZ = 258, - CRV_COMPO = 259, - SRF_MESH = 512, - SRF_FRGN = 513, - SRF_BEZ = 514, - VOL_ZMAP = 1024, - EXT_TEXT = 2048, - EXT_DIMENSION = 2049 - } - // Specifies the display state of an element. public enum Visibility { @@ -139,52 +120,5 @@ namespace WebWindowComplex.Json // Do not display the element, and do not reserve space for it in layout. COLLAPSED } - - //LUA - public enum LuaShapes { - RECT = 1, - CHAMFER_SIDE = 2, - CHAMFER = 3, - ROUND_ARC = 4, - SEGMENTAL_ARC = 5, - POINTED_ARC = 6, - TRIANGLE = 7 - } - - public struct Point3d - { - public double x; - - public double y; - - public double z; - - public Point3d(double dX, double dY, double dZ) - { - this = default(Point3d); - x = dX; - y = dY; - z = dZ; - } - - public Point3d(ref Point3d PtP) - { - this = default(Point3d); - x = PtP.x; - y = PtP.y; - z = PtP.z; - } - - public override string ToString() - { - return x.ToString("F3", CultureInfo.InvariantCulture) + "," + y.ToString("F3", CultureInfo.InvariantCulture) + "," + z.ToString("F3", CultureInfo.InvariantCulture); - } - - public static Point3d ORIG() - { - return new Point3d(0.0, 0.0, 0.0); - } - } - } } diff --git a/WebWindowComplex/Window.cs b/WebWindowComplex/Window.cs index a05602e..3a31f8a 100644 --- a/WebWindowComplex/Window.cs +++ b/WebWindowComplex/Window.cs @@ -266,7 +266,6 @@ namespace WebWindowComplex return m_Shape; } } - public int SelShapeIndex { get @@ -384,7 +383,6 @@ namespace WebWindowComplex m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); } } - internal void SetSelShape(Shapes Value) { DimensionList.Clear(); @@ -559,19 +557,6 @@ namespace WebWindowComplex m_nBottomRailQty = nBottomRailQty; } - private ObservableCollection m_Outline; - public ObservableCollection Outline - { - get - { - return m_Outline; - } - set - { - m_Outline = value; - } - } - public Frame(Area ParentArea, Window ParentWindow) : base(ParentArea, ParentWindow) { } @@ -586,57 +571,6 @@ namespace WebWindowComplex return NewFrame; } - private LuaShapes ConvertShape(Shapes value) - { - switch (value) - { - case Shapes.RECTANGLE: - { - return LuaShapes.RECT; - } - - case Shapes.RIGHTCHAMFER: - { - return LuaShapes.CHAMFER_SIDE; - } - - case Shapes.LEFTCHAMFER: - { - return LuaShapes.CHAMFER_SIDE; - } - - case Shapes.DOUBLECHAMFER: - { - return LuaShapes.CHAMFER; - } - - case Shapes.ARC: - { - return LuaShapes.SEGMENTAL_ARC; - } - - case Shapes.ARC_FULL: - { - return LuaShapes.ROUND_ARC; - } - - case Shapes.DOUBLEARC: - { - return LuaShapes.POINTED_ARC; - } - - case Shapes.TRIANGLE: - { - return LuaShapes.TRIANGLE; - } - - default: - { - return LuaShapes.RECT; - } - } - } - public override Frame Copy(Area ParentArea) { return null; @@ -663,7 +597,7 @@ namespace WebWindowComplex public static List s_FamilyHardwareList = new List(); // Macro famiglia hardware scelta dal chiamante public static string s_SelFamilyHW = ""; - + public int nSashQty { get @@ -1584,19 +1518,6 @@ namespace WebWindowComplex } } - private Curve m_Split; - public Curve sSplit - { - get - { - return m_Split; - } - set - { - m_Split = value; - } - } - public Split(Area ParentArea, Window ParentWindow) : base(ParentArea, ParentWindow) { } @@ -1832,48 +1753,6 @@ namespace WebWindowComplex } } - public class Curve - { - private GDB_TY m_CurveType; - public GDB_TY CurveType - { - get - { - return m_CurveType; - } - set - { - m_CurveType = value; - } - } - - private Point3d m_ptStart; - public Point3d ptStart - { - get - { - return m_ptStart; - } - set - { - m_ptStart = value; - } - } - - private Point3d m_ptEnd; - public Point3d ptEnd - { - get - { - return m_ptEnd; - } - set - { - m_ptEnd = value; - } - } - } - public class Hardware { private string m_sId; @@ -2532,7 +2411,6 @@ namespace WebWindowComplex } } - public struct IdNameStruct { private int m_Id; @@ -2673,37 +2551,37 @@ namespace WebWindowComplex return 0; } - //public static int IdFromName(string Name, ObservableCollection List) - //{ - // checked - // { - // int num = List.Count - 1; - // for (int i = 0; i <= num; i++) - // { - // if (Operators.CompareString(((IdNameStruct)List[i]).Name, Name, TextCompare: false) == 0) - // { - // return ((IdNameStruct)List[i]).Id; - // } - // } - // return 0; - // } - //} + public static int IdFromName(string Name, ObservableCollection 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 IdFromName(string Name, List List) - //{ - // checked - // { - // int num = List.Count - 1; - // for (int i = 0; i <= num; i++) - // { - // if (Operators.CompareString(((IdNameStruct)List[i]).Name, Name, TextCompare: false) == 0) - // { - // return ((IdNameStruct)List[i]).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; + } + } } } diff --git a/WebWindowConfigurator/WebTest.razor b/WebWindowConfigurator/WebTest.razor deleted file mode 100644 index dcead25..0000000 --- a/WebWindowConfigurator/WebTest.razor +++ /dev/null @@ -1,813 +0,0 @@ -
-
-
-
-
-
- -
-
- - @* *@ - @if (currStep != CompileStep.Template) - { - - } - -
-
-
-
-
- @if (currStep == CompileStep.Template) - { - - - - - - - - - - @foreach (var item in IN_TemplateDTOList) - { - string colorClass = ""; - @if (SelTemplateDTO != null && item.Index == SelTemplateDTO.Index) - colorClass = "table-success"; - else - colorClass = ""; - - - - - - } - -
#ImageDescription
@item.Index@item.Description
- } - @if (currStep == CompileStep.Frame) - { - @if (m_CurrWindow != null) - { - m_PreviousWindow = m_CurrWindow; - } -
-
-
-
-
- - -
-
-
-
-
-
-
-
Dimension
- @foreach (FrameDimension dimension in FrameWindow.DimensionList) - { -
- @dimension.sName - - mm -
- } -
-
-
-
-
-
-
-
-
Frame joints
-
-
- -
-
- -
-
- -
-
- @foreach (Joint joint in FrameWindow.JointList) - { -
- - -
- } -
-
-
- @if (!(FrameWindow.AreaList[0] is Split)) - { -
-
-
-
Frame
-
- -
-
-
-
- } -
- @if (m_SashList.Count == 0) - { -
-
-
-
-
Bottom rail
-
- Quantity - -
-
-
-
-
- } -
-
- } - else if (currStep == CompileStep.Split) - { -
-
-
-
- @for(int i = 0; i < SplitList.Count; i++) - { - Split currSplit = SplitList[i]; -
-
-
- @if (currSplit.ParentArea is Splitted || currSplit.ParentArea is Sash) - { - @for(int j = 0; j < SashList.Count; j++) - { - @if (SashList[j].Equals(currSplit.ParentArea)) - { -
@("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)) - { -
@("Sash " + (j + 1) + " - anta " + (k + 1))
- } - } - } - } - - } - else - { -
@("Frame")
- } -
-
-
-
Split
-
- -
-
- Number - -
-
- - -
- @foreach (var dim in currSplit.SplitPositionList) - { - string desc = ""; - @if (currSplit.SelSplitShape == Json.WindowConst.SplitShapes.VERTICAL) - { - @if (currSplit.SplitPositionList.IndexOf(dim) == 0) - { - desc = "Larg. area sx split"; - } - else - { - desc = "Larg. area dx split"; - } - } - else - { - @if (currSplit.SplitPositionList.IndexOf(dim) == 0) - { - desc = "Altez. area sotto split"; - } - else - { - desc = "Altez. area sopra split"; - } - } -
- @desc - - % -
- } -
-
-
-
-
-
- } - - @for(int i= 0; i < SplittedList.Count; i++) - { - Splitted currSplitted = SplittedList[i]; -
-
-
-
Area split
-
- -
-
-
-
- } - @* @for (int i = 0; i < SplitParentList.Count; i++) - { - @for (int j = 0; j < 2 && (i * 2 + j <= SplitParentList.Count - 1); j++) - { - SplitParent currSplitParent = m_SplitParentList[i * 2 + j]; - @if (currSplitParent.Split != null) - { - Split currSplit = (Split)currSplitParent.Split; -
-
-
- @if (currSplitParent.Description.Contains("Sash")) - { -
@(currSplitParent.Description + " area " + numSash)
- numSash++; - } - else if (currSplitParent.Description.Contains("Split")) - { -
@(currSplitParent.Description + " area " + numSplit)
- numSplit++; - } - else - { -
@( currSplitParent.Description + " area")
- } -
-
-
-
Split
-
- -
-
- Number - -
-
- - -
- @foreach (var dim in currSplit.SplitPositionList) - { - string desc = ""; - @if (currSplit.SelSplitShape == Json.WindowConst.SplitShapes.VERTICAL) - { - @if (currSplit.SplitPositionList.IndexOf(dim) == 0) - { - desc = "Larg. area sx split"; - } - else - { - desc = "Larg. area dx split"; - } - } - else - { - @if (currSplit.SplitPositionList.IndexOf(dim) == 0) - { - desc = "Altez. area sotto split"; - } - else - { - desc = "Altez. area sopra split"; - } - } -
- @desc - - % -
- } -
-
-
-
-
-
- } - else - { - @if (currSplitParent.Description.Contains("Sash")) - { - continue; - } - else if (currSplitParent.Description.Contains("Frame")) - { -
-
-
-
@currSplitParent.Description
-
- -
-
-
-
- } - else - { - @if (currSplitParent.Description.Contains("Split area with sash")) - { - continue; - } - @if (currSplitParent.IntoSash == false) - { -
-
-
-
@("Area " + currSplitParent.Description + " " + numSplit)
-
- -
-
-
-
- numSplit++; - } - } - } - } - } *@ -
-
-
-
- } - else if (currStep == CompileStep.Sash) - { - Sash item = SashList[currSash]; -
-
-
-
-
- Number - -
-
-
-
-
-
-
-
Orientation
-
- - -
-
-
-
-
-
-
-
Bottom rail
-
- Quantity - -
-
-
-
-
-
- @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]; -
-
-
- @if (item.SashList.Count == 1) - { -
Opening
- } - else - { -
Sash opening @(i * 2 + j + 1)
- } -
- - -
-
- Dimension - - % -
-
-
- -
-
- -
-
-
-
-
- } - } -
-
-
-
-
-
Sash joints
-
-
- -
-
- -
-
- -
-
- @foreach (Joint joint in item.JointList) - { -
- - -
- } -
-
-
-
- @for (int i = 0; i < item.AreaList.Count; i++) - { - Area anta; - @if (item.AreaList[i] is Splitted) - { - anta = item.AreaList[i]; - } - else - { - anta = item; - } - @if (!(anta.AreaList[0] is Split)) - { -
-
-
-
Anta @(i + 1)
-
- -
-
-
-
- } - } -
-
- -
-
- } - else if (currStep == CompileStep.Fill) - { -
-
-
-
-
-
-
-
-
Fill Area
-
-
-
-
- -
-
- -
-
-
-
-
-
-
- @for (int i = 0; i < FillList.Count; i += 2) - { - Fill currFill = FillList[i]; -
-
-
- @if (FillList.Count == 1) - { -
Fill
- } - else - { -
Fill @(FillList.IndexOf(currFill) + 1)
- } -
- -
-
-
-
- @if (i + 1 < FillList.Count) - { - Fill nextFill = FillList[i + 1]; -
-
-
- @if (FillList.Count == 1) - { -
Fill
- } - else - { -
Fill @(FillList.IndexOf(nextFill) + 1)
- } -
- -
-
-
-
- } - } -
-
-
- } - else if (currStep == CompileStep.General) - { -
-
-
-
-
-
-
Generic
-
- - -
-
- - -
-
-
-
-
-
-
-
Fill type
-
- - -
-
- - -
-
-
-
-
-
-
-
-
-
Color
-
- - -
-
-

-

- - @* *@ -
-
- -
-
- -
-

-
-
-

-

- -
-
- -
-
- -
-

-
-
-
-
-
- @if (m_SashList.Count > 0) - { -
-
-
-
-
Hardware
-
- - -
-
- - -
-
- - -
-
-
-
-
- } -
-
- } -
-
-
-
- @if (currStep != CompileStep.Template) - { -
- @outSvg -
- } -
- diff --git a/WebWindowConfigurator/WebTest.razor.cs b/WebWindowConfigurator/WebTest.razor.cs deleted file mode 100644 index 492f5a0..0000000 --- a/WebWindowConfigurator/WebTest.razor.cs +++ /dev/null @@ -1,619 +0,0 @@ -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Web; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System.Reflection.Metadata; -using System.Runtime.InteropServices; -using WebWindowConfigurator.DTO; -using WebWindowConfigurator.Json; -using static WebWindowConfigurator.Json.WindowConst; - -namespace WebWindowConfigurator -{ - public partial class WebTest : IDisposable - { - #region Public Properties - - [Parameter] - public string CssSvg { get; set; } = "responsive-svg"; - - [Parameter] - public EventCallback EC_OnClose { get; set; } - - [Parameter] - public EventCallback EC_OnSelectedTemplate { get; set; } - - [Parameter] - public EventCallback> EC_OnUpdate { get; set; } - - [Parameter] - public Template IN_SelTemplate - { - 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; - 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; - // recupero dimensioni Frame e Joint Frame della finestra precedente - if (m_PreviousWindow != null) - { - for (int i = 0; i < 2; i++) - m_CurrWindow.AreaList[0].DimensionList[i] = m_PreviousWindow.AreaList[0].DimensionList[i]; - for (int i = 0; i < 4; i++) - m_CurrWindow.AreaList[0].JointList[i] = m_PreviousWindow.AreaList[0].JointList[i]; - } - } - if (m_CurrWindow != null) - { - m_FillList = new List(); - m_SashList = new List(); - m_SplitList = new List(); - m_SplitParentList = new List(); - m_SplittedList = new List(); - CreateWindowsList(m_CurrWindow.AreaList[0], false); - } - } - } - - [Parameter] - public List IN_TemplateDTOList { get; set; } = null!; - - [Parameter] - public string LiveSVG - { - get => m_SelSVG; - set => m_SelSVG = value; - } - - #endregion Public Properties - - #region Public Methods - - public void Dispose() - { - if (m_CurrWindow != null) - { - m_CurrWindow.OnPreview -= M_CurrWindow_OnPreview; - m_CurrWindow = null; - } - } - - #endregion Public Methods - - #region Protected Enums - - protected enum CompileStep - { - Template = 0, - Frame = 1, - Split, - Sash, - Fill, - General - } - - protected enum ColorWindow - { - Bianco = 0, - Grigio = 1, - Tortora, - Blu, - Verde, - Nero - } - - #endregion Protected Enums - - #region Protected Properties - - protected Frame FrameWindow - { - get => m_Frame; - set => m_Frame = value; - } - - protected string m_SelSVG { get; set; } = ""; - - /// - /// Componente SVG da mostrare - /// - protected MarkupString outSvg - { - get - { - // aggiunta gestione classe svg per posizionamento con costraints - var newSvg = LiveSVG.Replace(" SashList - { - get => m_SashList; - } - protected List SplitList - { - get => m_SplitList; - } - protected List FillList - { - get => m_FillList; - } - protected List SplittedList - { - get => m_SplittedList; - } - protected List SplitParentList - { - get => m_SplitParentList; - } - - protected TemplateSelectDTO? SelTemplateDTO { get; set; } = null; - - #endregion Protected Properties - - #region Protected Methods - - /// - /// Metodo per la scelta della maniglia univoca - /// - /// - /// - protected async Task changeHandle(SashDimension sashDim) - { - //if(m_SashList[0].AreaList.Count < 3) - //{ - 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) - { - var CurrJwd = JsonConvert.SerializeObject(m_CurrWindow.Serialize(), Formatting.Indented); - Dictionary Args = new Dictionary(); - Args.Add("Jwd", CurrJwd); - Args.Add("Mode", 1.ToString()); - await EC_OnUpdate.InvokeAsync(Args); - } - } - - /// - /// 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(); - m_SplittedList = new List(); - m_SplitParentList = new List(); - // popolo le liste Fill, Sash e Split - CreateWindowsList(m_CurrWindow.AreaList[0], false); - currSash = -1; - await DoPreviewSvg(); - } - - // 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; - //DoSelectAndPreview(CompileStep.Frame); - await EC_OnSelectedTemplate.InvokeAsync(newSel); - } - - /// - /// Metodo per cambiare step e aggiornare preview svg - /// - /// step successivo - protected async void NextStepAndPreview(CompileStep newStep, int Index = -1) - { - currStep = newStep; - if (newStep == CompileStep.Sash) - currSash = Index; - else - currSash = -1; - await DoPreviewSvg(); - } - - /// - /// Metodo per identificare oggetti nella Window e popolare le liste Fill, Sash e Split, SplitParent - /// - /// - //protected void CreateWindowsList(Area node) - //{ - // if (node != null) - // { - // switch (node.AreaType) - // { - // case AreaTypes.FRAME: - // { - // FrameWindow = (Frame)node; - // if (node.AreaList[0] is Split) - // SplitParentList.Add(new SplitParent(AreaTypes.FRAME, "Frame", false, node.AreaList[0], null)); - // else - // SplitParentList.Add(new SplitParent(AreaTypes.FRAME, "Frame", false, null, node)); - // break; - // } - // case AreaTypes.SASH: - // { - // m_SashList.Add((Sash)node); - // if (node.AreaList[0] is Fill) - // SplitParentList.Add(new SplitParent(AreaTypes.SPLITTED, "Sash", true, null, node)); - // else if(node.AreaList[0] is Split) - // SplitParentList.Add(new SplitParent(AreaTypes.SPLITTED, "Sash into split", true, node.AreaList[0], node)); - // break; - // } - // case AreaTypes.FILL: - // { - // m_FillList.Add((Fill)node); - // break; - // } - // case AreaTypes.SPLIT: - // { - // m_SplitList.Add((Split)node); - // break; - // } - // case AreaTypes.SPLITTED: - // { - // if (node.AreaList[0] is Split) - // { - // if (node.ParentArea is Sash) - // SplitParentList.Add(new SplitParent(AreaTypes.SPLITTED, "Sash", true, node.AreaList[0], node)); - // else - // SplitParentList.Add(new SplitParent(AreaTypes.SPLITTED, "Split", false, node.AreaList[0], node)); - // } - // else if (node.AreaList[0] is Sash) - // { - // SplitParentList.Add(new SplitParent(AreaTypes.SPLITTED, "Split area with sash", false, null, node)); - // } - // else - // { - // if (node.ParentArea is Sash) - // SplitParentList.Add(new SplitParent(AreaTypes.SPLITTED, "Sash", true, null, node)); - // else if (node.ParentArea.ParentArea is Sash) - // SplitParentList.Add(new SplitParent(AreaTypes.SPLITTED, "Split into sash", true, null, node)); - // else - // SplitParentList.Add(new SplitParent(AreaTypes.SPLITTED, "Split", false, null, node)); - // } - // break; - // } - // } - // foreach (var item in node.AreaList) - // { - // CreateWindowsList(item); - // } - // } - //} - - //protected void CreateWindowsList(Area node, bool IntoSash) - //{ - // if (node != null) - // { - // bool nodeIntoSash = false; - // if (node.ParentArea is Sash || IntoSash == true) - // nodeIntoSash = true; - // switch (node.AreaType) - // { - // case AreaTypes.FRAME: - // { - // FrameWindow = (Frame)node; - // if (node.AreaList[0] is Split) - // SplitParentList.Add(new SplitParent(AreaTypes.FRAME, "Frame", nodeIntoSash, node.AreaList[0], null)); - // else - // SplitParentList.Add(new SplitParent(AreaTypes.FRAME, "Frame", nodeIntoSash, null, node)); - // break; - // } - // case AreaTypes.SASH: - // { - // m_SashList.Add((Sash)node); - // if (node.AreaList[0] is Fill) - // SplitParentList.Add(new SplitParent(AreaTypes.SPLITTED, "Sash", nodeIntoSash, null, node)); - // else if (node.AreaList[0] is Split) - // SplitParentList.Add(new SplitParent(AreaTypes.SPLITTED, "Sash into split", nodeIntoSash, node.AreaList[0], node)); - // break; - // } - // case AreaTypes.FILL: - // { - // m_FillList.Add((Fill)node); - // break; - // } - // case AreaTypes.SPLIT: - // { - // m_SplitList.Add((Split)node); - // break; - // } - // case AreaTypes.SPLITTED: - // { - // if (node.AreaList[0] is Split) - // { - // if (node.ParentArea is Sash) - // SplitParentList.Add(new SplitParent(AreaTypes.SPLITTED, "Sash", nodeIntoSash, node.AreaList[0], node)); - // else - // SplitParentList.Add(new SplitParent(AreaTypes.SPLITTED, "Split", nodeIntoSash, node.AreaList[0], node)); - // } - // else if (node.AreaList[0] is Sash) - // { - // SplitParentList.Add(new SplitParent(AreaTypes.SPLITTED, "Split area with sash", nodeIntoSash, null, node)); - // } - // else - // { - // if (node.ParentArea is Sash) - // SplitParentList.Add(new SplitParent(AreaTypes.SPLITTED, "Sash", nodeIntoSash, null, node)); - // else if (nodeIntoSash) - // SplitParentList.Add(new SplitParent(AreaTypes.SPLITTED, "Area split into sash", nodeIntoSash, null, node)); - // else - // SplitParentList.Add(new SplitParent(AreaTypes.SPLITTED, "Split", nodeIntoSash, null, node)); - // } - // break; - // } - // } - // foreach (var item in node.AreaList) - // { - // CreateWindowsList(item, nodeIntoSash); - // } - // } - //} - - protected void CreateWindowsList(Area node, bool IntoSash) - { - if (node != null) - { - if (node.ParentArea is Sash || IntoSash == true) - IntoSash = true; - switch (node.AreaType) - { - case AreaTypes.FRAME: - { - FrameWindow = (Frame)node; - break; - } - case AreaTypes.SASH: - { - m_SashList.Add((Sash)node); - break; - } - case AreaTypes.FILL: - { - m_FillList.Add((Fill)node); - break; - } - case AreaTypes.SPLIT: - { - m_SplitList.Add((Split)node); - break; - } - case AreaTypes.SPLITTED: - { - if(node.ParentArea is Split && !IntoSash && node.AreaList[0] is Fill) - { - m_SplittedList.Add((Splitted)node); - } - break; - } - } - foreach (var item in node.AreaList) - { - CreateWindowsList(item, IntoSash); - } - } - } - - - /// - /// 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(); - } - - /// - /// 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 AllFill(int int_type) - { - FillTypes type = FillTypes.GLASS; - if (int_type == 2) - { - type = FillTypes.WOOD; - } - foreach (Fill currFill in m_FillList) - { - currFill.SetFillType(type); - } - await DoPreviewSvg(); - } - - private async Task SwapTwoAree(Area currArea) - { - currArea.SwapAree(); - await DoPreviewSvg(); - } - - - #endregion Protected Methods - - #region Private Fields - - private CompileStep currStep = CompileStep.Template; - - private int currSash = -1; - - private ColorWindow currColorWin = ColorWindow.Bianco; - - private Frame m_Frame; - - private List m_SashList = new List(); - - private List m_SplitList = new List(); - - private List m_FillList = new List(); - - private List m_SplittedList = new List(); - - private List m_SplitParentList = new List(); - - private enum positionJoints - { - BL = 0, // Bottom Left - BR = 1, // Bottom Right - TR, // Top Right - TL // Top Left - } - - #endregion Private Fields - - #region Private Properties - - private Window? m_CurrWindow { get; set; } = null; - - private Window? m_PreviousWindow { get; set; } = null; - - private Template m_SelTemplate { get; set; } = null!; - - #endregion Private Properties - - #region Private Methods - - /// - /// Metodo per andare allo step successivo - /// - /// step successivo - private void AdvStep(CompileStep newStep) - { - currStep = newStep; - currSash = -1; - } - - - private void ChangeColorWindow(ColorWindow newColorWin) - { - currColorWin = newColorWin; - } - - private void M_CurrWindow_OnPreview(object? sender, OnPreviewEventArgs e) - { - Dictionary Args = new Dictionary(); - Args.Add("Jwd", e.sJwd); - Args.Add("Mode", 1.ToString()); - EC_OnUpdate.InvokeAsync(Args); - } - - /// - /// Calcola il css del tab selezionato - /// - /// - /// - private string tabNavCss(CompileStep testStep, int Index = -1) - { - if(testStep == CompileStep.Sash) - { - if ((currSash == 0 && Index == 0)|| (currSash == 1 && Index == 1)) - { - return "nav-link active fw-bold"; - } - else - { - return "nav-link text-secondary"; - } - } - return (testStep == currStep) ? "nav-link active fw-bold" : "nav-link text-secondary"; - } - - private string buttonCss(ColorWindow testColor) - { - return testColor.Equals(currColorWin) ? "btn btn-outline-secondary active" : "btn btn-outline-secondary"; - } - - /// - /// Calcola larghezza colonna da mostrare - /// - /// - private string mainCss() - { - return (currStep == CompileStep.Template) ? "col-12" : "col-6"; - } - - #endregion Private Methods - } -} \ No newline at end of file diff --git a/WebWindowConfigurator/WebTest.razor.css b/WebWindowConfigurator/WebTest.razor.css deleted file mode 100644 index 85a53ed..0000000 --- a/WebWindowConfigurator/WebTest.razor.css +++ /dev/null @@ -1,17 +0,0 @@ -.my-component { - border: 2px dashed red; - padding: 1em; - margin: 1em 0; - background-image: url('background.png'); -} - - -/* gestione SVG responsive */ -.responsive-svg { - /* SVG scala a fit del container */ - width: 100%; - /* Altezza massima in rem (caratteri) */ - height: 40rem; - /* Removes extra space below SVG */ - display: block; -} diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 23f39be..ce1fb3b 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 2.7.9.1209 + 2.7.9.1210 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -350,6 +350,16 @@ + + + + + + + + + +