From 1dcb0ba15b50f475bbcc94daa489ae8e1c272a88 Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Fri, 19 Sep 2025 13:16:15 +0200 Subject: [PATCH] Copiato codice da componente WebWindowTest a WebWindowComplex --- Test.UI/Components/Pages/EditJWD.razor | 20 +- Test.UI/Components/Pages/EditJWD.razor.cs | 115 +++++-- Test.UI/Components/Pages/Gerarchia.razor | 9 +- Test.UI/Components/Pages/Gerarchia.razor.cs | 65 ++-- WebWindow.Base/WebWindow.Base.csproj | 6 +- WebWindowComplex/ItemTable.cs | 8 +- WebWindowComplex/Json/JsonUtility.cs | 63 +++- WebWindowComplex/ParametriOpzioni.cs | 196 ++++++++++++ WebWindowComplex/SplitParent.cs | 88 ------ WebWindowComplex/TableComp.razor | 280 +++++------------- WebWindowComplex/TableComp.razor.cs | 230 +++++++++----- WebWindowComplex/TableComp.razor.css | 1 + WebWindowComplex/Window.cs | 225 +++++++++----- .../WebWindowConfigurator.csproj | 17 +- 14 files changed, 819 insertions(+), 504 deletions(-) create mode 100644 WebWindowComplex/ParametriOpzioni.cs delete mode 100644 WebWindowComplex/SplitParent.cs diff --git a/Test.UI/Components/Pages/EditJWD.razor b/Test.UI/Components/Pages/EditJWD.razor index c841d50..de852b3 100644 --- a/Test.UI/Components/Pages/EditJWD.razor +++ b/Test.UI/Components/Pages/EditJWD.razor @@ -4,7 +4,19 @@ EditJWD - - \ No newline at end of file + + \ No newline at end of file diff --git a/Test.UI/Components/Pages/EditJWD.razor.cs b/Test.UI/Components/Pages/EditJWD.razor.cs index 0ae374a..9675361 100644 --- a/Test.UI/Components/Pages/EditJWD.razor.cs +++ b/Test.UI/Components/Pages/EditJWD.razor.cs @@ -3,9 +3,11 @@ using EgwCoreLib.Lux.Core.RestPayload; using EgwCoreLib.Lux.Data.Services; using Microsoft.AspNetCore.Components; using Newtonsoft.Json; +using NLog; +using System.Diagnostics; using System.Security.AccessControl; -using WebWindowConfigurator; -using WebWindowConfigurator.DTO; +using WebWindowComplex; +using WebWindowComplex.DTO; namespace Test.UI.Components.Pages { @@ -14,7 +16,7 @@ namespace Test.UI.Components.Pages #region Public Properties public string InitialJwd = ""; - + public Template SelTemplate { get; set; } = new Template(0, "---SELECT---", "", ""); #endregion Public Properties @@ -29,13 +31,45 @@ namespace Test.UI.Components.Pages #region Protected Fields - protected string currJwd = ""; + protected string currJwd = "..."; protected Dictionary m_CurrArgs = new Dictionary(); #endregion Protected Fields #region Protected Properties + protected List AvailTemplateList { get; set; } = new List(); + protected List AvailHardwareList { get; set; } = new List(); + protected List AvailFamilyHardwareList { get; set; } = new List() + { + new string("Natura"), + new string("Optima") + }; + protected List AvailColorMaterialList { get; set; } = new List() + { + new string("White"), + new string("Black"), + new string("Blu") + }; + protected List AvailMaterialList { get; set; } = new List() + { + new string("Pine"), + new string("Fir") + }; + protected List AvailGlassList { get; set; } = new List() + { + new string("4/12/4"), + new string("4/16/4"), + new string("4/12/4/12/4"), + new string("4/16/4/16/4"), + new string("4T/12/4T"), + new string("4T/16/4T") + }; + protected string SelFamilyHardware { get; set; } = ""; + protected string SelColorMaterial { get; set; } = ""; + protected string SelMaterial { get; set; } = ""; + protected string SelGlass { get; set; } = ""; + [Inject] protected IConfiguration Config { get; set; } = null!; @@ -47,11 +81,7 @@ namespace Test.UI.Components.Pages protected MarkupString JsonSer { - get - { - string outVal = m_CurrArgs["Jwd"]; - return (MarkupString)outVal.Replace(Environment.NewLine, "
").Replace(" ", " "); - } + get => (MarkupString)currJwd.Replace(Environment.NewLine, "
").Replace(" ", " "); } #endregion Protected Properties @@ -60,15 +90,17 @@ namespace Test.UI.Components.Pages protected override async Task OnInitializedAsync() { - isLoading = true; ConfInit(); - InitialJwd = "{\r\n \"ProfilePath\": \"Profilo78\",\r\n \"AreaList\": [\r\n {\r\n \"Shape\": \"RECTANGLE\",\r\n \"DimensionList\": [\r\n {\r\n \"nIndex\": 1,\r\n \"sName\": \"Width\",\r\n \"dValue\": 1200.0\r\n },\r\n {\r\n \"nIndex\": 2,\r\n \"sName\": \"Height\",\r\n \"dValue\": 1500.0\r\n }\r\n ],\r\n \"JointList\": [\r\n {\r\n \"nIndex\": 1,\r\n \"JointType\": \"FULL_V\"\r\n },\r\n {\r\n \"nIndex\": 2,\r\n \"JointType\": \"FULL_V\"\r\n },\r\n {\r\n \"nIndex\": 3,\r\n \"JointType\": \"FULL_V\"\r\n },\r\n {\r\n \"nIndex\": 4,\r\n \"JointType\": \"FULL_V\"\r\n }\r\n ],\r\n \"BottomRail\": false,\r\n \"BottomRailQty\": 0,\r\n \"AreaList\": [\r\n {\r\n \"bIsSashVertical\": true,\r\n \"SashList\": [\r\n {\r\n \"OpeningType\": \"TURNONLY_LEFT\",\r\n \"bHasHandle\": false,\r\n \"dDimension\": 50.0\r\n },\r\n {\r\n \"OpeningType\": \"TILTTURN_RIGHT\",\r\n \"bHasHandle\": true,\r\n \"dDimension\": 50.0\r\n }\r\n ],\r\n \"SashType\": \"NULL\",\r\n \"JointList\": [\r\n {\r\n \"nIndex\": 1,\r\n \"JointType\": \"FULL_V\"\r\n },\r\n {\r\n \"nIndex\": 2,\r\n \"JointType\": \"FULL_V\"\r\n },\r\n {\r\n \"nIndex\": 3,\r\n \"JointType\": \"FULL_V\"\r\n },\r\n {\r\n \"nIndex\": 4,\r\n \"JointType\": \"FULL_V\"\r\n }\r\n ],\r\n \"Hardware\": \"000000\",\r\n \"AreaList\": [\r\n {\r\n \"AreaList\": [\r\n {\r\n \"FillType\": \"GLASS\",\r\n \"AreaList\": [],\r\n \"AreaType\": \"FILL\"\r\n }\r\n ],\r\n \"AreaType\": \"SPLITTED\"\r\n },\r\n {\r\n \"AreaList\": [\r\n {\r\n \"FillType\": \"GLASS\",\r\n \"AreaList\": [],\r\n \"AreaType\": \"FILL\"\r\n }\r\n ],\r\n \"AreaType\": \"SPLITTED\"\r\n }\r\n ],\r\n \"AreaType\": \"SASH\"\r\n }\r\n ],\r\n \"AreaType\": \"FRAME\"\r\n }\r\n ]\r\n}"; + SelFamilyHardware = "Natura"; + SelColorMaterial = "Black"; + SelColorMaterial = "Pine"; + SelGlass = "4T/16/4T"; + InitialJwd = File.ReadAllText("Data\\AntaDoppia.jwd"); + currJwd = InitialJwd; DLService.CalcDonePipe.EA_NewMessage += CalcDonePipe_EA_NewMessage; await ReloadData(); } - private bool isLoading = false; - #endregion Protected Methods #region Private Fields @@ -76,7 +108,9 @@ namespace Test.UI.Components.Pages private string apiUrl = ""; private string calcTag = ""; private string CalcUid = "CurrWindow"; - private string cFile = "Data/Setup.json"; + private string cFileTemplate = "Data/Setup.json"; + private string cFileHardware = "Hardware/Setup.json"; + private TemplateSelectDTO? currSel = null; private string currSvg = ""; private string imgBasePath = ""; @@ -84,13 +118,9 @@ namespace Test.UI.Components.Pages private string subChannel = ""; - #endregion Private Fields - - #region Private Properties - private string windowUid = "CurrWindow"; - - #endregion Private Properties + + #endregion Private Fields #region Private Methods @@ -126,20 +156,41 @@ namespace Test.UI.Components.Pages private async Task ReloadData() { //return base.OnInitializedAsync(); + AvailTemplateList = new List(); + AvailHardwareList = new List(); // brutale, da rivedere... - if (File.Exists(cFile)) + if (string.IsNullOrEmpty(InitialJwd)) { - //item.ImageUrl = ICService.ImageUrl($"{apiUrl}/{imgBasePath}", false, item.SVGFileName); + if (File.Exists(cFileTemplate)) + { + string rawVal = File.ReadAllText(cFileTemplate); + var rawList = JsonConvert.DeserializeObject>(rawVal) ?? new List(); + + // calcolo URL immagini... DTO interno da rivedere? + foreach (var item in rawList) + { + item.ImageUrl = ICService.ImageUrl($"{apiUrl}/{imgBasePath}", false, item.SVGFileName); + AvailTemplateList.Add(item); + } + } } - await Task.Delay(1); - isLoading = false; + if (File.Exists(cFileHardware)) + { + string rawValHW = File.ReadAllText(cFileHardware); + var rawListHW = JsonConvert.DeserializeObject>(rawValHW) ?? new List(); + foreach (var item in rawListHW) + { + AvailHardwareList.Add(item); + } + } + await Task.Delay(100); } - private async Task SaveJWD(Dictionary CurrArgs) + private async Task SaveJWD(Dictionary CurrArgs) { m_CurrArgs = CurrArgs; // chiamo la chiamata POST alla API, che manda la richiesta via REDIS - if (m_CurrArgs != null) + if (currJwd != null) { CalcRequestDTO calcRequestDTO = new CalcRequestDTO(); calcRequestDTO.EnvType = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW; @@ -148,6 +199,18 @@ namespace Test.UI.Components.Pages } } + private void SetTemplate(TemplateSelectDTO selTemp) + { + string rawVal = ""; + currSel = selTemp; + // brutale,d a rivedere... + if (File.Exists(selTemp.JwdFileName)) + { + rawVal = File.ReadAllText(selTemp.JwdFileName); + } + SelTemplate = new Template(selTemp.Index, selTemp.Description, selTemp.SVGFileName, rawVal); + } + #endregion Private Methods } } \ No newline at end of file diff --git a/Test.UI/Components/Pages/Gerarchia.razor b/Test.UI/Components/Pages/Gerarchia.razor index ee48333..b5548ca 100644 --- a/Test.UI/Components/Pages/Gerarchia.razor +++ b/Test.UI/Components/Pages/Gerarchia.razor @@ -8,9 +8,16 @@ IN_FamilyHardwareList="@AvailFamilyHardwareList" IN_SelFamilyHardware="@SelFamilyHardware" IN_HardwareList="@AvailHardwareList" + IN_ColorMaterialList="@AvailColorMaterialList" + IN_SelColorMaterial="@SelColorMaterial" + IN_MaterialList="@AvailMaterialList" + IN_SelMaterial="@SelMaterial" + IN_GlassList="@AvailGlassList" + IN_SelGlass="@SelGlass" EC_OnUpdate="SaveJWD" EC_OnSelectedTemplate="SetTemplate" - LiveSVG="@currSvg"> + LiveSVG="@currSvg" + CurrJwd="@InitialJwd"> @*

diff --git a/Test.UI/Components/Pages/Gerarchia.razor.cs b/Test.UI/Components/Pages/Gerarchia.razor.cs index 0e9e26b..9984302 100644 --- a/Test.UI/Components/Pages/Gerarchia.razor.cs +++ b/Test.UI/Components/Pages/Gerarchia.razor.cs @@ -5,7 +5,7 @@ using Microsoft.AspNetCore.Components; using Newtonsoft.Json; using NLog; using System.Diagnostics; -using WebWindow.Base; +using System.Security.AccessControl; using WebWindowComplex; using WebWindowComplex.DTO; @@ -15,7 +15,8 @@ namespace Test.UI.Components.Pages { #region Public Properties - public Template SelTemplate { get; set; } = new Template(0, "---SELECT---", "", ""); + public string InitialJwd = ""; + public Template SelTemplate { get; set; } = new Template(0, "---SELECT---", "", ""); #endregion Public Properties @@ -29,7 +30,7 @@ namespace Test.UI.Components.Pages #endregion Public Methods #region Protected Fields - + protected string currJwd = "..."; protected Dictionary m_CurrArgs = new Dictionary(); @@ -39,9 +40,35 @@ namespace Test.UI.Components.Pages protected List AvailTemplateList { get; set; } = new List(); protected List AvailHardwareList { get; set; } = new List(); - - protected List AvailFamilyHardwareList { get; set; } = new List(); + protected List AvailFamilyHardwareList { get; set; } = new List() + { + new string("Natura"), + new string("Optima") + }; + protected List AvailColorMaterialList { get; set; } = new List() + { + new string("White"), + new string("Black"), + new string("Blu") + }; + protected List AvailMaterialList { get; set; } = new List() + { + new string("Pine"), + new string("Fir") + }; + protected List AvailGlassList { get; set; } = new List() + { + new string("4/12/4"), + new string("4/16/4"), + new string("4/12/4/12/4"), + new string("4/16/4/16/4"), + new string("4T/12/4T"), + new string("4T/16/4T") + }; protected string SelFamilyHardware { get; set; } = ""; + protected string SelColorMaterial { get; set; } = ""; + protected string SelMaterial { get; set; } = ""; + protected string SelGlass { get; set; } = ""; [Inject] protected IConfiguration Config { get; set; } = null!; @@ -64,9 +91,10 @@ namespace Test.UI.Components.Pages protected override async Task OnInitializedAsync() { ConfInit(); - AvailFamilyHardwareList.Add("Natura"); - AvailFamilyHardwareList.Add("Optima"); SelFamilyHardware = "Natura"; + SelColorMaterial = "Black"; + SelMaterial = "Pine"; + SelGlass = "4T/16/4T"; DLService.CalcDonePipe.EA_NewMessage += CalcDonePipe_EA_NewMessage; await ReloadData(); } @@ -128,18 +156,20 @@ namespace Test.UI.Components.Pages //return base.OnInitializedAsync(); AvailTemplateList = new List(); AvailHardwareList = new List(); - await Task.Delay(100); // brutale, da rivedere... - if (File.Exists(cFileTemplate)) + if (string.IsNullOrEmpty(InitialJwd)) { - string rawVal = File.ReadAllText(cFileTemplate); - var rawList = JsonConvert.DeserializeObject>(rawVal) ?? new List(); - - // calcolo URL immagini... DTO interno da rivedere? - foreach (var item in rawList) + if (File.Exists(cFileTemplate)) { - item.ImageUrl = ICService.ImageUrl($"{apiUrl}/{imgBasePath}", false, item.SVGFileName); - AvailTemplateList.Add(item); + string rawVal = File.ReadAllText(cFileTemplate); + var rawList = JsonConvert.DeserializeObject>(rawVal) ?? new List(); + + // calcolo URL immagini... DTO interno da rivedere? + foreach (var item in rawList) + { + item.ImageUrl = ICService.ImageUrl($"{apiUrl}/{imgBasePath}", false, item.SVGFileName); + AvailTemplateList.Add(item); + } } } if (File.Exists(cFileHardware)) @@ -151,13 +181,14 @@ namespace Test.UI.Components.Pages AvailHardwareList.Add(item); } } + await Task.Delay(100); } private async Task SaveJWD(Dictionary CurrArgs) { m_CurrArgs = CurrArgs; // chiamo la chiamata POST alla API, che manda la richiesta via REDIS - if (currSel != null) + if (currJwd != null) { CalcRequestDTO calcRequestDTO = new CalcRequestDTO(); calcRequestDTO.EnvType = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW; diff --git a/WebWindow.Base/WebWindow.Base.csproj b/WebWindow.Base/WebWindow.Base.csproj index 67828ae..89df9d4 100644 --- a/WebWindow.Base/WebWindow.Base.csproj +++ b/WebWindow.Base/WebWindow.Base.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.9.1616 + 2.7.9.1913 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -26,3 +26,7 @@ + + + + diff --git a/WebWindowComplex/ItemTable.cs b/WebWindowComplex/ItemTable.cs index 2a4692c..7c6e185 100644 --- a/WebWindowComplex/ItemTable.cs +++ b/WebWindowComplex/ItemTable.cs @@ -12,12 +12,12 @@ namespace WebWindowComplex private AreaTypes m_type; public AreaTypes Type { - get + get { return m_type; } - set - { + set + { m_type = value; } } @@ -95,7 +95,7 @@ namespace WebWindowComplex } } - public ItemTable(AreaTypes elementType, string s_description,int n_row, int n_col, int n_numSash, int n_numChild) + public ItemTable(AreaTypes elementType, string s_description, int n_row, int n_col, int n_numSash, int n_numChild) { Type = elementType; m_desc = s_description; diff --git a/WebWindowComplex/Json/JsonUtility.cs b/WebWindowComplex/Json/JsonUtility.cs index 429b986..bc198a5 100644 --- a/WebWindowComplex/Json/JsonUtility.cs +++ b/WebWindowComplex/Json/JsonUtility.cs @@ -24,6 +24,48 @@ namespace WebWindowComplex.Json } } + private string m_sMaterial; + [JsonProperty] + public string Material + { + get + { + return m_sMaterial; + } + set + { + m_sMaterial = value; + } + } + + private string m_sColorMaterial; + [JsonProperty] + public string ColorMaterial + { + get + { + return m_sColorMaterial; + } + set + { + m_sColorMaterial = value; + } + } + + private string m_sGlass; + [JsonProperty] + public string Glass + { + get + { + return m_sGlass; + } + set + { + m_sGlass = value; + } + } + private List m_AreaList = new List(); [JsonProperty] public List AreaList @@ -38,16 +80,25 @@ namespace WebWindowComplex.Json } } - public JsonWindow(string ProfilePath) + public JsonWindow(string ProfilePath, string Material, string ColorMaterial, string Glass) { m_sProfilePath = ProfilePath; + m_sMaterial = Material; + m_sColorMaterial = ColorMaterial; + m_sGlass = Glass; } internal Window Deserialize() { - Window Window = new Window() { sProfilePath = m_sProfilePath }; + Window Window = new Window() + { + sProfilePath = m_sProfilePath, + sMaterial = m_sMaterial, + sColorMaterial = m_sColorMaterial, + sGlass = m_sGlass + }; foreach (var Area in AreaList) - Window.AreaList.Add((Frame)Area.Deserialize(null,Window)); + Window.AreaList.Add((Frame)Area.Deserialize(null, Window)); return Window; } } @@ -402,7 +453,7 @@ namespace WebWindowComplex.Json { Split.AreaList.Add(AreaDeserealized); } - } + } return Split; } } @@ -426,7 +477,7 @@ namespace WebWindowComplex.Json Split.AreaList.Add(AreaDeserealized); } } - + return Split; } } @@ -470,7 +521,7 @@ namespace WebWindowComplex.Json { Fill.AreaList.Add(AreaDeserealized); } - } + } return Fill; } } diff --git a/WebWindowComplex/ParametriOpzioni.cs b/WebWindowComplex/ParametriOpzioni.cs new file mode 100644 index 0000000..b055d1e --- /dev/null +++ b/WebWindowComplex/ParametriOpzioni.cs @@ -0,0 +1,196 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WebWindowComplex +{ + public partial class ParametriOpzioni + { + private ParametriOpzioniParametri[] itemsField; + + /// + //[System.Xml.Serialization.XmlElementAttribute("Parametri", Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public ParametriOpzioniParametri[] Items + { + get + { + return this.itemsField; + } + set + { + this.itemsField = value; + } + } + } + + public partial class ParametriOpzioniParametri + { + private string nomeParametroField; + + private string descrizioneParametroField; + + private string valoreCorrenteField; + + private string tipoField; + + private string visibleField; + + private string ricalcolaSeModificatoField; + + private ParametriOpzioniParametriOpzioni[] opzioniField; + + /// + //[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string NomeParametro + { + get + { + return this.nomeParametroField; + } + set + { + this.nomeParametroField = value; + } + } + + /// + //[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string DescrizioneParametro + { + get + { + return this.descrizioneParametroField; + } + set + { + this.descrizioneParametroField = value; + } + } + + /// + //[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string ValoreCorrente + { + get + { + return this.valoreCorrenteField; + } + set + { + this.valoreCorrenteField = value; + } + } + + /// + //[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string Tipo + { + get + { + return this.tipoField; + } + set + { + this.tipoField = value; + } + } + + /// + //[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string Visible + { + get + { + return this.visibleField; + } + set + { + this.visibleField = value; + } + } + + /// + //[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string RicalcolaSeModificato + { + get + { + return this.ricalcolaSeModificatoField; + } + set + { + this.ricalcolaSeModificatoField = value; + } + } + + /// + //[System.Xml.Serialization.XmlElementAttribute("Opzioni", Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public ParametriOpzioniParametriOpzioni[] Opzioni + { + get + { + return this.opzioniField; + } + set + { + this.opzioniField = value; + } + } + } + + public partial class ParametriOpzioniParametriOpzioni + { + private string nomeParametroField; + + private string descrizioneOpzioneField; + + private string valoreField; + + /// + //[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string NomeParametro + { + get + { + return this.nomeParametroField; + } + set + { + this.nomeParametroField = value; + } + } + + /// + //[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string DescrizioneOpzione + { + get + { + return this.descrizioneOpzioneField; + } + set + { + this.descrizioneOpzioneField = value; + } + } + + /// + //[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string Valore + { + get + { + return this.valoreField; + } + set + { + this.valoreField = value; + } + } + } + +} + + diff --git a/WebWindowComplex/SplitParent.cs b/WebWindowComplex/SplitParent.cs deleted file mode 100644 index 4f4a602..0000000 --- a/WebWindowComplex/SplitParent.cs +++ /dev/null @@ -1,88 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace WebWindowComplex -{ - public class SplitParent - { - private Json.WindowConst.AreaTypes m_Type; - public Json.WindowConst.AreaTypes Type - { - get - { - return m_Type; - } - set - { - m_Type = value; - } - } - - private string m_Description; - public string Description - { - get - { - return m_Description; - } - set - { - m_Description = value; - } - } - - ///

- /// Proprietà per sapere se sono in un'anta - /// - private bool m_IntoSash; - public bool IntoSash - { - get - { - return m_IntoSash; - } - set - { - m_IntoSash = value; - } - } - - private Area m_Split; - public Area Split - { - get - { - return m_Split; - } - set - { - m_Split = value; - } - } - - private Area m_Splitted; - public Area Splitted - { - get - { - return m_Splitted; - } - set - { - m_Splitted = value; - } - } - - public SplitParent(Json.WindowConst.AreaTypes vType,string sDescrip, bool b_IntoSash, Area v_Split, Area v_Splitted) - { - Type = vType; - Description = sDescrip; - IntoSash = b_IntoSash; - Split = v_Split; - Splitted = v_Splitted; - } - } -} diff --git a/WebWindowComplex/TableComp.razor b/WebWindowComplex/TableComp.razor index a56c256..4dd794c 100644 --- a/WebWindowComplex/TableComp.razor +++ b/WebWindowComplex/TableComp.razor @@ -3,18 +3,21 @@
-
+
-
+
@if (currStep != CompileStep.Template) {
@@ -66,34 +69,37 @@
- @if (currStep == CompileStep.Template) + @if (string.IsNullOrEmpty(CurrJwd)) { - - - - - - - - - - @foreach (var item in IN_TemplateDTOList) - { - string colorClass = ""; - @if (SelTemplateDTO != null && item.Index == SelTemplateDTO.Index) - colorClass = "table-success"; - else - colorClass = ""; - - - - + @if (currStep == CompileStep.Template) + { +
#ImageDescription
@item.Index@item.Description
+ + + + + - } - -
#ImageDescription
+ + + @foreach (var item in IN_TemplateDTOList) + { + string colorClass = ""; + @if (SelTemplateDTO != null && item.Index == SelTemplateDTO.Index) + colorClass = "table-success"; + else + colorClass = ""; + + @item.Index + + @item.Description + + } + + + } } - else if (currStep == CompileStep.Gerarchia) + @if (currStep == CompileStep.Gerarchia) {
@@ -138,7 +144,7 @@
- + } else if (currStep == CompileStep.Frame) { @@ -189,13 +195,13 @@
Frame joints
- +
- +
- +
@foreach (Joint joint in FrameWindow.JointList) @@ -362,142 +368,16 @@ int Index = j;
- +
} - +
} - @* @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++; - } - } - } - } - } *@
@@ -603,7 +483,7 @@ int IndexModify = i * 2 + j;
- +
} @@ -621,13 +501,13 @@
Sash joints
- +
- +
- +
@foreach (Joint joint in item.JointList) @@ -796,11 +676,12 @@
Generic
- - + @for (int i = 0; i < IN_MaterialList.Count; i++) + { + + }
@@ -820,10 +701,11 @@
Fill type
- + @for (int i = 0; i < IN_GlassList.Count; i++) + { + + }
@@ -852,31 +734,15 @@
-

-

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

-
-
-

-

- -
-
- -
-
- -
-

+
+ + +
diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index 47dba65..ad6fdca 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -4,7 +4,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System.Reflection.Metadata; using System.Runtime.InteropServices; -using WebWindow.Base; +using WebWindowComplex; using WebWindowComplex.DTO; using WebWindowComplex.Json; using static WebWindowComplex.Json.WindowConst; @@ -28,17 +28,19 @@ namespace WebWindowComplex public EventCallback> EC_OnUpdate { get; set; } [Parameter] - public Template IN_SelTemplate + public string CurrJwd { - get => m_SelTemplate; + get => m_CurrJwd; 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)) + if (m_CurrJwd != value && value != "") { - m_SelTemplate = value; + m_CurrJwd = value; SelFamilyHardware = IN_SelFamilyHardware; - JsonWindow WindowFromJson = JsonConvert.DeserializeObject(m_SelTemplate.JWD, new PolymorphicJsonConverter()) ?? new JsonWindow(""); + SelColorMaterial = IN_SelColorMaterial ?? ""; + SelMaterial = IN_SelMaterial ?? ""; + SelGlass = IN_SelGlass ?? ""; + JsonWindow WindowFromJson = JsonConvert.DeserializeObject(m_CurrJwd, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", ""); if (m_CurrWindow != null) { m_CurrWindow.OnPreview -= M_CurrWindow_OnPreview; @@ -65,7 +67,57 @@ namespace WebWindowComplex m_FillList = new List(); m_SashList = new List(); m_SplitList = new List(); - m_SplitParentList = new List(); + //m_SplitParentList = 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); + } + } + } + + [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; + SelFamilyHardware = IN_SelFamilyHardware; + SelColorMaterial = IN_SelColorMaterial ?? ""; + SelMaterial = IN_SelMaterial ?? ""; + SelGlass = IN_SelGlass ?? ""; + JsonWindow WindowFromJson = JsonConvert.DeserializeObject(m_SelTemplate.JWD, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", ""); + if (m_CurrWindow != null) + { + m_CurrWindow.OnPreview -= M_CurrWindow_OnPreview; + m_CurrWindow = null; + } + Sash.m_HardwareCompleteList = IN_HardwareList; + Sash.s_FamilyHardwareList = IN_FamilyHardwareList; + Sash.s_SelFamilyHW = IN_SelFamilyHardware; + 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_maxCol = 0; + m_maxRow = 0; + m_FillList = new List(); + m_SashList = new List(); + m_SplitList = new List(); + //m_SplitParentList = new List(); m_SplittedList = new List(); m_ItemTableList = new List(); CreateWindowsList(m_CurrWindow.AreaList[0], false); @@ -81,10 +133,28 @@ namespace WebWindowComplex public List IN_FamilyHardwareList { get; set; } = null!; [Parameter] - public string? IN_SelFamilyHardware { get; set; } = null; + public string IN_SelFamilyHardware { get; set; } = null!; [Parameter] - public List? IN_HardwareList { get; set; } = null; + public List IN_HardwareList { get; set; } = null!; + + [Parameter] + public List IN_ColorMaterialList { get; set; } = null!; + + [Parameter] + public string? IN_SelColorMaterial { get; set; } = null; + + [Parameter] + public List IN_MaterialList { get; set; } = null!; + + [Parameter] + public string? IN_SelMaterial { get; set; } = null; + + [Parameter] + public List IN_GlassList { get; set; } = null!; + + [Parameter] + public string? IN_SelGlass { get; set; } = null; [Parameter] public string LiveSVG @@ -121,16 +191,6 @@ namespace WebWindowComplex General } - protected enum ColorWindow - { - Bianco = 0, - Grigio = 1, - Tortora, - Blu, - Verde, - Nero - } - protected enum positionJoints { BL = 0, // Bottom Left @@ -148,7 +208,7 @@ namespace WebWindowComplex get => m_Frame; set => m_Frame = value; } - + protected string m_CurrJwd { get; set; } protected string m_SelSVG { get; set; } = ""; /// @@ -180,10 +240,10 @@ namespace WebWindowComplex { get => m_SplittedList; } - protected List SplitParentList - { - get => m_SplitParentList; - } + //protected List SplitParentList + //{ + // get => m_SplitParentList; + //} protected List ItemTableList { get => m_ItemTableList; @@ -213,20 +273,36 @@ namespace WebWindowComplex } } } + protected string SelColorMaterial { get; set; } = null; + + protected string SelMaterial { get; set; } = null; + + protected string SelGlass { get; set; } = null; #endregion Protected Properties #region Protected Methods + protected override async Task OnInitializedAsync() + { + if (string.IsNullOrEmpty(CurrJwd)) + { + currStep = CompileStep.Template; + } + else + { + currStep = CompileStep.Gerarchia; + } + await DoPreviewSvg(); + } + /// /// Metodo per la scelta della maniglia univoca /// /// /// - protected async Task changeHandle(SashDimension sashDim) + protected void changeHandle(SashDimension sashDim) { - //if(m_SashList[0].AreaList.Count < 3) - //{ foreach (SashDimension item in SashList[0].SashList) { if (item.Equals(sashDim)) @@ -238,8 +314,6 @@ namespace WebWindowComplex item.bHasHandle = false; } } - //} - await Task.Delay(1); } // Ancora da fare... @@ -270,7 +344,14 @@ namespace WebWindowComplex protected async Task DoReset() { SelFamilyHardware = IN_SelFamilyHardware; - JsonWindow WindowFromJson = JsonConvert.DeserializeObject(m_SelTemplate.JWD, new PolymorphicJsonConverter()) ?? new JsonWindow(""); + SelColorMaterial = IN_SelColorMaterial ?? ""; + SelMaterial = IN_SelMaterial ?? ""; + SelGlass = IN_SelGlass ?? ""; + JsonWindow WindowFromJson; + if (string.IsNullOrEmpty(CurrJwd)) + WindowFromJson = JsonConvert.DeserializeObject(m_SelTemplate.JWD, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", ""); + else + WindowFromJson = JsonConvert.DeserializeObject(m_CurrJwd, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", ""); if (m_CurrWindow != null) { m_CurrWindow.OnPreview -= M_CurrWindow_OnPreview; @@ -282,7 +363,7 @@ namespace WebWindowComplex m_SashList = new List(); m_SplitList = new List(); m_SplittedList = new List(); - m_SplitParentList = new List(); + //m_SplitParentList = new List(); m_ItemTableList = new List(); m_maxCol = 0; m_maxRow = 0; @@ -377,7 +458,7 @@ namespace WebWindowComplex { case AreaTypes.FRAME: { - if(node.AreaList.Count >= 1) + if (node.AreaList.Count >= 1) ItemTableList.Add(new ItemTable(AreaTypes.FRAME, "FR", row, col, -1, node.AreaList.Count)); else ItemTableList.Add(new ItemTable(AreaTypes.FRAME, "FR", row, col, -1, 0)); @@ -393,12 +474,12 @@ namespace WebWindowComplex if ((node.ParentArea.ParentArea != null && node.ParentArea.ParentArea.AreaList.Count > 1) || (node.ParentArea != null && node.ParentArea.AreaList.Count > 1)) { - for(int i = 0; i < SashList.Count; i++) + for (int i = 0; i < SashList.Count; i++) { if (SashList[i].Equals(node)) { // Se il nodo ha figli, salvo il numero nell'oggetto - if(node.AreaList.Count >= 1) + if (node.AreaList.Count >= 1) ItemTableList.Add(new ItemTable(AreaTypes.SASH, "SH", maxRow, col, i, node.AreaList.Count)); else ItemTableList.Add(new ItemTable(AreaTypes.SASH, "SH", maxRow, col, i, 0)); @@ -422,7 +503,7 @@ namespace WebWindowComplex } case AreaTypes.FILL: { - if((node.ParentArea.AreaList.Count > 1 && node.ParentArea.AreaList[0].Equals(node)) || + 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))) maxCol++; ItemTableList.Add(new ItemTable(AreaTypes.FILL, "FL", maxRow, col, -1, 0)); @@ -436,7 +517,7 @@ namespace WebWindowComplex 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)) - maxCol ++; + maxCol++; if (node.AreaList.Count >= 1 || node.AreaList.Count >= 1) ItemTableList.Add(new ItemTable(AreaTypes.SPLIT, "SP", maxRow, col, -1, node.AreaList.Count)); else @@ -468,7 +549,7 @@ namespace WebWindowComplex CreateElementTable(item, row, col, maxRow, maxCol); } } - if(maxCol> m_maxCol) + if (maxCol > m_maxCol) { m_maxCol = maxCol; } @@ -477,13 +558,13 @@ namespace WebWindowComplex m_maxRow = maxRow; } } - + private string fillTable(int row, int col) { List itemSameCol = new List(); - for(int k = 0; k < row; k++) + for (int k = 0; k < row; k++) { - if(ItemTableList[k].Col == col+1) + if (ItemTableList[k].Col == col + 1) { itemSameCol.Add(ItemTableList[k]); } @@ -509,10 +590,10 @@ namespace WebWindowComplex if (itemSameCol.Count > 0) { // Sono alla riga successiva di un elemento e nella stessa colonna - if(itemSameCol.Last().Row == row) + if (itemSameCol.Last().Row == row) { // se ha un solo figlio - if(itemSameCol.Last().NumChild == 1) + if (itemSameCol.Last().NumChild == 1) { return "└"; } @@ -529,7 +610,7 @@ namespace WebWindowComplex else { // se ha un solo figlio - if(itemSameCol.Last().NumChild == 1) + if (itemSameCol.Last().NumChild == 1) { return " "; } @@ -561,9 +642,9 @@ 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) - /// oggetto a cui essere applicato (Frame o Sash) + /// area su cui eseguire la funzione (Frame o Sash) /// - private async Task AllJointsFrame(int n_type, int n_place) + private async Task AllJointsFrame(int n_type, Area area) { Joints type = Joints.ANGLED; if (n_type == 2) @@ -574,16 +655,17 @@ namespace WebWindowComplex { type = Joints.FULL_V; } - if (n_place == 0) + if (area is Frame) { foreach (Joint joint in FrameWindow.JointList) { joint.SetSelJointType(type); } } - else if (n_place == 1) + else { - foreach (Joint joint in m_SashList[0].JointList) + Sash s = (Sash)area; + foreach (Joint joint in s.JointList) { joint.SetSelJointType(type); } @@ -616,20 +698,26 @@ namespace WebWindowComplex /// Sash dove si torva anta /// Indice dell'anta che si copia /// Indice dell'anta che si modifica - private async Task CopyContent(Sash sashItem, int IndexCopy, int IndexModify) + private async Task CopyContentSash(Sash sashItem, int IndexCopy, int IndexModify) { // Anta selezionata Area sashSplitted = sashItem.AreaList[IndexModify]; // Rimuovo riempimento da anta selezionata sashSplitted.AreaList.RemoveAt(0); // Creo la copia dell'anta scelta - Area a = sashItem.AreaList[IndexCopy-1].AreaList[0].Copy(sashSplitted); + Area a = sashItem.AreaList[IndexCopy - 1].AreaList[0].Copy(sashSplitted); // Aggiungo copia all'anta selezionata sashItem.AreaList[IndexModify].AreaList.Add(a); await DoPreviewSvg(); } - private async Task CopySplitted(Splitted currSplitted, int numSash) + /// + /// Metodo per copiare una sash intera + /// + /// + /// + /// + private async Task CopySash(Splitted currSplitted, int numSash) { //Rimuovo contenuto di Splitted currSplitted.AreaList.RemoveAll(i => i != null); @@ -650,13 +738,10 @@ namespace WebWindowComplex #endregion Protected Methods #region Private Fields - - private CompileStep currStep = CompileStep.Template; + private CompileStep currStep; private int currSash = -1; - private ColorWindow currColorWin = ColorWindow.Bianco; - private Frame m_Frame; private List m_SashList = new List(); @@ -669,7 +754,7 @@ namespace WebWindowComplex private List m_ItemTableList = new List(); - private List m_SplitParentList = new List(); + //private List m_SplitParentList = new List(); private int m_maxCol = 0; private int m_maxRow = 0; @@ -700,12 +785,6 @@ namespace WebWindowComplex currSash = -1; } - - private void ChangeColorWindow(ColorWindow newColorWin) - { - currColorWin = newColorWin; - } - private void M_CurrWindow_OnPreview(object? sender, OnPreviewEventArgs e) { Dictionary Args = new Dictionary(); @@ -735,13 +814,8 @@ namespace WebWindowComplex 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 + /// Calcola larghezza colonna contenente nav da mostrare /// /// private string mainCss() @@ -749,6 +823,24 @@ namespace WebWindowComplex return (currStep == CompileStep.Template) ? "col-12" : "col-6"; } + /// + /// Calcola larghezza colonna header nav + /// + /// + private string headerCss() + { + return (currStep == CompileStep.Template) ? "col-10 d-grid gap-1 px-2 d-md-flex justify-content-md-start" : "col-8 d-grid gap-1 px-2 d-md-flex justify-content-md-start"; + } + + /// + /// Calcola larghezza colonna button nav + /// + /// + private string buttonCss() + { + return (currStep == CompileStep.Template) ? "col-2 d-grid gap-1 d-md-flex justify-content-md-end" : "col-4 d-grid gap-1 d-md-flex justify-content-md-end"; + } + #endregion Private Methods } } \ No newline at end of file diff --git a/WebWindowComplex/TableComp.razor.css b/WebWindowComplex/TableComp.razor.css index c3d90e3..0b64414 100644 --- a/WebWindowComplex/TableComp.razor.css +++ b/WebWindowComplex/TableComp.razor.css @@ -2,6 +2,7 @@ font-size: 0.9rem; padding-bottom: 0.1rem; } + .nav-item ::deep a { color: #000000; border-radius: 5px; diff --git a/WebWindowComplex/Window.cs b/WebWindowComplex/Window.cs index 62768dc..116d47e 100644 --- a/WebWindowComplex/Window.cs +++ b/WebWindowComplex/Window.cs @@ -6,8 +6,8 @@ using System.ComponentModel; using System.Drawing; using System.Runtime.Intrinsics.Arm; using System.Xml.Serialization; -using WebWindow.Base; using WebWindowComplex.Json; +using static WebWindowComplex.ParametriOpzioni; using static WebWindowComplex.Json.WindowConst; namespace WebWindowComplex @@ -30,6 +30,48 @@ namespace WebWindowComplex } } + 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 + { + return m_sColorMaterial; + } + set + { + m_sColorMaterial = value; + OnUpdatePreview(sSerialized()); + } + } + + private string m_sGlass; + public string sGlass + { + get + { + return m_sGlass; + } + set + { + m_sGlass = value; + OnUpdatePreview(sSerialized()); + } + } + private ObservableCollection m_AreaList = new ObservableCollection(); public ObservableCollection AreaList { @@ -45,7 +87,7 @@ namespace WebWindowComplex internal JsonWindow Serialize() { - JsonWindow JsonWindow = new JsonWindow(sProfilePath); + JsonWindow JsonWindow = new JsonWindow(sProfilePath, sMaterial, sColorMaterial, sGlass); foreach (var Area in AreaList) JsonWindow.AreaList.Add(Area.Serialize()); return JsonWindow; @@ -202,7 +244,7 @@ namespace WebWindowComplex Sash SashArea = Sash.CreateSash(ParentArea); // Aggiungo area AreaList.Add(SashArea); - if(SashArea.nSashQty == 1) + if (SashArea.nSashQty == 1) { // Inserisco il riempimento precedente AreaList[0].AreaList.Add(ContentArea[0]); @@ -227,7 +269,7 @@ namespace WebWindowComplex public void SwapAree() { Area tempArea; - if(this is Sash || this is Split) + if (this is Sash || this is Split) { tempArea = AreaList[0]; AreaList[0] = AreaList[1]; @@ -630,7 +672,7 @@ namespace WebWindowComplex } else if (value < m_SashList.Count) { - if(value > 0) + if (value > 0) { double dLastDimension = 0; for (var SplitIndex = m_SashList.Count - 1; SplitIndex >= value; SplitIndex += -1) @@ -646,7 +688,7 @@ namespace WebWindowComplex SashList.RemoveAt(0); } } - if(m_SashList.Count == 0) + if (m_SashList.Count == 0) { Area child = AreaList[0]; // Se nella singola anta ho uno split @@ -687,7 +729,7 @@ namespace WebWindowComplex else { // Se aggiungo ante - if(SashList.Count > AreaList.Count) + if (SashList.Count > AreaList.Count) { List ContentArea = new List(); // Salvo in ContentArea il sottoalbero delle singole aree che mantengo @@ -842,7 +884,7 @@ namespace WebWindowComplex set { m_SelOrientationSashType = (OrientationSash)IdNameStruct.IdFromInd(value, m_OrientationSashTypeList); - if(value == 0) + if (value == 0) { m_bIsSashVertical = true; } @@ -966,7 +1008,7 @@ namespace WebWindowComplex set { // Controllo che il valore inserito sia positivo - if(value >= 0) + if (value >= 0) { m_nSashBottomRailQty = value; if (m_nSashBottomRailQty > 0) @@ -1093,9 +1135,9 @@ namespace WebWindowComplex internal void SetSelHardwareFromId(string sId) { - m_SelHardware = m_HardwareList.FirstOrDefault(x => x.sId == sId)?? new Hardware("","","","","",0,0); - if (m_SelHardware != null) - m_SelHardware = m_HardwareList[0]; + m_SelHardware = m_HardwareList.FirstOrDefault(x => x.sId == sId) ?? new Hardware("", "", "", "", "", 0, 0); + if (m_SelHardware == null) + m_SelHardware = m_HardwareList[0]; } public int SelHardwareTypeIndex @@ -1126,8 +1168,8 @@ namespace WebWindowComplex } } - private ObservableCollection m_HwdOptionList = new ObservableCollection(); - public ObservableCollection HwdOptionList + private ObservableCollection m_HwdOptionList = new ObservableCollection(); + public ObservableCollection HwdOptionList { get { @@ -1215,9 +1257,9 @@ namespace WebWindowComplex private string ConvertOpeningType() { - if(m_SashList.Count > 1) + if (m_SashList.Count > 1) { - for(int i = 0; i < m_SashList.Count; i++) + for (int i = 0; i < m_SashList.Count; i++) { if (m_SashList[i].bHasHandle) { @@ -1226,11 +1268,11 @@ namespace WebWindowComplex else return "ANTA_RIBALTA"; } - + } - return "ANTA_BANDIERA"; + return ""; } - else + else if (m_SashList.Count > 0) { switch (GetOpeningType(m_SashList[0].OpeningType)) { @@ -1266,6 +1308,7 @@ namespace WebWindowComplex } } } + return ""; } public void RefreshHardwareList() @@ -1283,34 +1326,34 @@ namespace WebWindowComplex 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; - // } + 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; - // } + 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; - // } - // } - //} + default: + { + return OpeningSides.NULL; + } + } + } public override Sash Copy(Area newParentArea) { @@ -1324,12 +1367,12 @@ namespace WebWindowComplex newSash.RefreshHardwareList(); newSash.RefreshHardwareOptionList(); newSash.SetSelHardware(SelHardware); - for (int i = 0; i m_ValueList = new List(); public List ValueList { @@ -1891,30 +1951,13 @@ namespace WebWindowComplex } } - private Visibility m_OptVisibility; - public Visibility OptVisibility + public AGBOptionCombo(ParametriOpzioniParametri HdwOptionParam) : base(HdwOptionParam) { - get - { - return m_OptVisibility; - } + 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 AGBOption(ParametriOpzioniParametri HdwOptionParam) - //{ - // if (HdwOptionParam.Opzioni.Count > 0) - // { - // m_Type = HDWOPTIONTYPES.COMBO; - // foreach (var Value in HdwOptionParam.Opzioni) - // m_ValueList.Add(new AGBOptionParameter(Value.Valore, Value.DescrizioneOpzione)); - // } - // else - // m_Type = HDWOPTIONTYPES.TEXT; - // m_sName = HdwOptionParam.NomeParametro; - // m_sDescription = HdwOptionParam.DescrizioneParametro; - // m_sValue = m_ValueList.FirstOrDefault(x => x.sValue == HdwOptionParam.ValoreCorrente); - // m_OptVisibility = Visibility.Visible; // If(HdwOptionParam.Visible.ToLower = "true", Visibility.Visible, Visibility.Collapsed) - //} } public class AGBOptionParameter @@ -1944,6 +1987,28 @@ namespace WebWindowComplex } } + 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 class FrameDimension { // valore massimo e minimo della dimensione del frame @@ -2386,8 +2451,8 @@ namespace WebWindowComplex } m_dDimension = value; m_Parent.ParentWindow.OnUpdatePreview(m_Parent.ParentWindow.sSerialized()); - } - + } + } } internal void SetDimension(double dValue) diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index db522d4..ba6c9d8 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.9.1616 + 2.7.9.1913 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -44,6 +44,21 @@ + + + + + + + + + + + + + + +