diff --git a/Test.UI.sln b/Test.UI.sln index d00bbdb..7fba70d 100644 --- a/Test.UI.sln +++ b/Test.UI.sln @@ -11,8 +11,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebWindowConfigurator", "We EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebAedificaConfigurator", "WebAedificaConfigurator\WebAedificaConfigurator.csproj", "{BD1F43E8-BE5F-469E-9552-C98CA8639A06}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebWindowJWD", "WebWindowJWD\WebWindowJWD.csproj", "{D32E55D6-8C37-477F-8065-4020EB27900E}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebWindowComplex", "WebWindowComplex\WebWindowComplex.csproj", "{4E197932-13B1-45FB-9EDD-694604644745}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebWindowTest", "WebWindowTest\WebWindowTest.csproj", "{C22770A7-C344-4CE9-8D6F-6ACE62091C31}" @@ -41,10 +39,6 @@ Global {BD1F43E8-BE5F-469E-9552-C98CA8639A06}.Debug|Any CPU.Build.0 = Debug|Any CPU {BD1F43E8-BE5F-469E-9552-C98CA8639A06}.Release|Any CPU.ActiveCfg = Release|Any CPU {BD1F43E8-BE5F-469E-9552-C98CA8639A06}.Release|Any CPU.Build.0 = Release|Any CPU - {D32E55D6-8C37-477F-8065-4020EB27900E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D32E55D6-8C37-477F-8065-4020EB27900E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D32E55D6-8C37-477F-8065-4020EB27900E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D32E55D6-8C37-477F-8065-4020EB27900E}.Release|Any CPU.Build.0 = Release|Any CPU {4E197932-13B1-45FB-9EDD-694604644745}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4E197932-13B1-45FB-9EDD-694604644745}.Debug|Any CPU.Build.0 = Debug|Any CPU {4E197932-13B1-45FB-9EDD-694604644745}.Release|Any CPU.ActiveCfg = Release|Any CPU 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/Test.UI/Components/Pages/TestComponentJWD.razor b/Test.UI/Components/Pages/TestComponentJWD.razor index 642a88d..20595ce 100644 --- a/Test.UI/Components/Pages/TestComponentJWD.razor +++ b/Test.UI/Components/Pages/TestComponentJWD.razor @@ -8,8 +8,18 @@ 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" CurrJwd="@InitialJwd"> + +

+ @m_CurrArgs.GetValueOrDefault("Jwd") +

\ No newline at end of file diff --git a/Test.UI/Components/Pages/TestComponentJWD.razor.cs b/Test.UI/Components/Pages/TestComponentJWD.razor.cs index f19445f..8585949 100644 --- a/Test.UI/Components/Pages/TestComponentJWD.razor.cs +++ b/Test.UI/Components/Pages/TestComponentJWD.razor.cs @@ -40,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!; @@ -65,9 +91,10 @@ namespace Test.UI.Components.Pages protected override async Task OnInitializedAsync() { ConfInit(); - AvailFamilyHardwareList.Add("Natura"); - AvailFamilyHardwareList.Add("Optima"); 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; diff --git a/Test.UI/Components/Pages/TestComponentTemplate.razor b/Test.UI/Components/Pages/TestComponentTemplate.razor index 89f1f0e..fc79f2a 100644 --- a/Test.UI/Components/Pages/TestComponentTemplate.razor +++ b/Test.UI/Components/Pages/TestComponentTemplate.razor @@ -8,8 +8,18 @@ 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" CurrJwd="@InitialJwd"> + +

+ @m_CurrArgs.GetValueOrDefault("Jwd") +

diff --git a/Test.UI/Components/Pages/TestComponentTemplate.razor.cs b/Test.UI/Components/Pages/TestComponentTemplate.razor.cs index 30460c9..b4db428 100644 --- a/Test.UI/Components/Pages/TestComponentTemplate.razor.cs +++ b/Test.UI/Components/Pages/TestComponentTemplate.razor.cs @@ -40,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!; @@ -65,11 +91,10 @@ namespace Test.UI.Components.Pages protected override async Task OnInitializedAsync() { ConfInit(); - AvailFamilyHardwareList.Add("Natura"); - AvailFamilyHardwareList.Add("Optima"); SelFamilyHardware = "Natura"; - //InitialJwd = File.ReadAllText("Data\\AntaDoppia.jwd"); - //currJwd = InitialJwd; + SelColorMaterial = "Black"; + SelMaterial = "Pine"; + SelGlass = "4T/16/4T"; DLService.CalcDonePipe.EA_NewMessage += CalcDonePipe_EA_NewMessage; await ReloadData(); } diff --git a/Test.UI/Components/_Imports.razor b/Test.UI/Components/_Imports.razor index f1e6548..2d121d4 100644 --- a/Test.UI/Components/_Imports.razor +++ b/Test.UI/Components/_Imports.razor @@ -11,6 +11,5 @@ @using Test.UI.Components @using WebWindowConfigurator @using WebAedificaConfigurator -@using WebWindowJWD @using WebWindowComplex @using WebWindowTest \ No newline at end of file diff --git a/Test.UI/Data/AntaDoppia.jwd b/Test.UI/Data/AntaDoppia.jwd index 1fdcc46..12d9235 100644 --- a/Test.UI/Data/AntaDoppia.jwd +++ b/Test.UI/Data/AntaDoppia.jwd @@ -1,7 +1,11 @@ { "ProfilePath": "Profilo78", + "Material": "Pine", + "ColorMaterial": "Black", + "Glass": "4T/16/4T", "AreaList": [ { + "IdGroup": 1, "Shape": "RECTANGLE", "DimensionList": [ { @@ -37,14 +41,17 @@ "BottomRailQty": 0, "AreaList": [ { + "IdGroup": 2, "bIsSashVertical": true, "SashList": [ { + "SashId": 1, "OpeningType": "TURNONLY_LEFT", "bHasHandle": false, "dDimension": 50.0 }, { + "SashId": 2, "OpeningType": "TILTTURN_RIGHT", "bHasHandle": true, "dDimension": 50.0 @@ -69,11 +76,13 @@ "JointType": "FULL_V" } ], - "Hardware": "102111", + "Hardware": "000559", "AreaList": [ { + "IdGroup": 3, "AreaList": [ { + "IdGroup": 4, "FillType": "GLASS", "AreaList": [], "AreaType": "FILL" @@ -82,8 +91,10 @@ "AreaType": "SPLITTED" }, { + "IdGroup": 5, "AreaList": [ { + "IdGroup": 6, "FillType": "GLASS", "AreaList": [], "AreaType": "FILL" diff --git a/Test.UI/Data/AntaSingola.jwd b/Test.UI/Data/AntaSingola.jwd index 46c2320..5748335 100644 --- a/Test.UI/Data/AntaSingola.jwd +++ b/Test.UI/Data/AntaSingola.jwd @@ -1,5 +1,8 @@ { "ProfilePath": "Profilo78", + "Material": "Pine", + "ColorMaterial": "Black", + "Glass": "4T/16/4T", "AreaList": [ { "Shape": "RECTANGLE", @@ -35,11 +38,13 @@ ], "BottomRail": false, "BottomRailQty": 0, + "IdGroup": 1, "AreaList": [ { "bIsSashVertical": true, "SashList": [ { + "SashId": 1, "OpeningType": "TILTTURN_LEFT", "bHasHandle": true, "dDimension": 100.0 @@ -64,10 +69,12 @@ "JointType": "FULL_H" } ], - "Hardware": "101111", + "Hardware": "000558", + "IdGroup": 2, "AreaList": [ { "FillType": "GLASS", + "IdGroup": 3, "AreaList": [], "AreaType": "FILL" } diff --git a/Test.UI/Data/FinDueAnteBottomFisso.jwd b/Test.UI/Data/FinDueAnteBottomFisso.jwd index 9ddb068..2940a11 100644 --- a/Test.UI/Data/FinDueAnteBottomFisso.jwd +++ b/Test.UI/Data/FinDueAnteBottomFisso.jwd @@ -1,7 +1,11 @@ { "ProfilePath": "Profilo78", + "Material": "Pine", + "ColorMaterial": "Black", + "Glass": "4T/16/4T", "AreaList": [ { + "IdGroup": 1, "Shape": "RECTANGLE", "DimensionList": [ { @@ -37,8 +41,11 @@ "BottomRailQty": 0, "AreaList": [ { + "IdGroup": 2, "SplitShape": "HORIZONTAL", - "SplitPositionList": [ + "SplitStartVert": false, + "SplitVertList": [], + "SplitHorizList": [ { "bIsRelative": true, "dDimension": 40.0 @@ -50,8 +57,10 @@ ], "AreaList": [ { + "IdGroup": 3, "AreaList": [ { + "IdGroup": 4, "FillType": "GLASS", "AreaList": [], "AreaType": "FILL" @@ -60,16 +69,20 @@ "AreaType": "SPLITTED" }, { + "IdGroup": 5, "AreaList": [ { + "IdGroup": 6, "bIsSashVertical": true, "SashList": [ { + "SashId": 1, "OpeningType": "TURNONLY_LEFT", "bHasHandle": false, "dDimension": 50.0 }, { + "SashId": 2, "OpeningType": "TILTTURN_RIGHT", "bHasHandle": true, "dDimension": 50.0 @@ -94,11 +107,13 @@ "JointType": "FULL_H" } ], - "Hardware": "102112", + "Hardware": "000559", "AreaList": [ { + "IdGroup": 7, "AreaList": [ { + "IdGroup": 8, "FillType": "GLASS", "AreaList": [], "AreaType": "FILL" @@ -107,8 +122,10 @@ "AreaType": "SPLITTED" }, { + "IdGroup": 9, "AreaList": [ { + "IdGroup": 10, "FillType": "GLASS", "AreaList": [], "AreaType": "FILL" diff --git a/Test.UI/Data/FinestraDueAnteSeparate.jwd b/Test.UI/Data/FinestraDueAnteSeparate.jwd index 0cfd829..b051b18 100644 --- a/Test.UI/Data/FinestraDueAnteSeparate.jwd +++ b/Test.UI/Data/FinestraDueAnteSeparate.jwd @@ -1,7 +1,11 @@ { "ProfilePath": "Profilo78", + "Material": "Pine", + "ColorMaterial": "Black", + "Glass": "4T/16/4T", "AreaList": [ { + "IdGroup": 1, "Shape": "DOUBLECHAMFER", "DimensionList": [ { @@ -42,8 +46,10 @@ "BottomRailQty": 0, "AreaList": [ { + "IdGroup": 2, "SplitShape": "VERTICAL", - "SplitPositionList": [ + "SplitStartVert": true, + "SplitVertList": [ { "bIsRelative": true, "dDimension": 50.0 @@ -53,13 +59,17 @@ "dDimension": 50.0 } ], + "SplitHorizList": [], "AreaList": [ { + "IdGroup": 3, "AreaList": [ { + "IdGroup": 4, "bIsSashVertical": true, "SashList": [ { + "SashId": 1, "OpeningType": "TILTTURN_LEFT", "bHasHandle": true, "dDimension": 100.0 @@ -89,6 +99,7 @@ "Hardware": "000000", "AreaList": [ { + "IdGroup": 5, "FillType": "GLASS", "AreaList": [], "AreaType": "FILL" @@ -100,11 +111,14 @@ "AreaType": "SPLITTED" }, { + "IdGroup": 6, "AreaList": [ { + "IdGroup": 7, "bIsSashVertical": true, "SashList": [ { + "SashId": 1, "OpeningType": "TILTTURN_RIGHT", "bHasHandle": true, "dDimension": 100.0 @@ -134,6 +148,7 @@ "Hardware": "000000", "AreaList": [ { + "IdGroup": 8, "FillType": "GLASS", "AreaList": [], "AreaType": "FILL" diff --git a/Test.UI/Data/FinestraSplitGrid.jwd b/Test.UI/Data/FinestraSplitGrid.jwd new file mode 100644 index 0000000..6f5f99e --- /dev/null +++ b/Test.UI/Data/FinestraSplitGrid.jwd @@ -0,0 +1,151 @@ +{ + "ProfilePath": "Profilo78", + "Material": "Pine", + "ColorMaterial": "Black", + "Glass": "4T/16/4T", + "AreaList": [ + { + "IdGroup": 1, + "Shape": "RECTANGLE", + "DimensionList": [ + { + "nIndex": 1, + "sName": "Width", + "dValue": 1500.0 + }, + { + "nIndex": 2, + "sName": "Height", + "dValue": 1800.0 + } + ], + "JointList": [ + { + "nIndex": 1, + "JointType": "FULL_H" + }, + { + "nIndex": 2, + "JointType": "FULL_H" + }, + { + "nIndex": 3, + "JointType": "FULL_H" + }, + { + "nIndex": 4, + "JointType": "FULL_H" + } + ], + "BottomRail": false, + "BottomRailQty": 0, + "AreaList": [ + { + "IdGroup": 2, + "SplitShape": "GRID", + "SplitStartVert": false, + "SplitVertList": [ + { + "bIsRelative": true, + "dDimension": 50.0 + }, + { + "bIsRelative": true, + "dDimension": 50.0 + } + ], + "SplitHorizList": [ + { + "bIsRelative": true, + "dDimension": 30.0 + }, + { + "bIsRelative": true, + "dDimension": 40.0 + }, + { + "bIsRelative": true, + "dDimension": 30.0 + } + ], + "AreaList": [ + { + "IdGroup": 3, + "AreaList": [ + { + "IdGroup": 4, + "FillType": "GLASS", + "AreaList": [], + "AreaType": "FILL" + } + ], + "AreaType": "SPLITTED" + }, + { + "IdGroup": 5, + "AreaList": [ + { + "IdGroup": 6, + "FillType": "GLASS", + "AreaList": [], + "AreaType": "FILL" + } + ], + "AreaType": "SPLITTED" + }, + { + "IdGroup": 7, + "AreaList": [ + { + "IdGroup": 8, + "FillType": "GLASS", + "AreaList": [], + "AreaType": "FILL" + } + ], + "AreaType": "SPLITTED" + }, + { + "IdGroup": 9, + "AreaList": [ + { + "IdGroup": 10, + "FillType": "GLASS", + "AreaList": [], + "AreaType": "FILL" + } + ], + "AreaType": "SPLITTED" + }, + { + "IdGroup": 11, + "AreaList": [ + { + "IdGroup": 12, + "FillType": "GLASS", + "AreaList": [], + "AreaType": "FILL" + } + ], + "AreaType": "SPLITTED" + }, + { + "IdGroup": 13, + "AreaList": [ + { + "IdGroup": 14, + "FillType": "GLASS", + "AreaList": [], + "AreaType": "FILL" + } + ], + "AreaType": "SPLITTED" + } + ], + "AreaType": "SPLIT" + } + ], + "AreaType": "FRAME" + } + ] +} \ No newline at end of file diff --git a/Test.UI/Data/FinestraSplitVert.jwd b/Test.UI/Data/FinestraSplitVert.jwd index b8dc284..60e1e4b 100644 --- a/Test.UI/Data/FinestraSplitVert.jwd +++ b/Test.UI/Data/FinestraSplitVert.jwd @@ -1,7 +1,11 @@ { "ProfilePath": "Profilo78", + "Material": "Pine", + "ColorMaterial": "Black", + "Glass": "4T/16/4T", "AreaList": [ { + "IdGroup": 1, "Shape": "RECTANGLE", "DimensionList": [ { @@ -37,8 +41,10 @@ "BottomRailQty": 0, "AreaList": [ { + "IdGroup": 2, "SplitShape": "VERTICAL", - "SplitPositionList": [ + "SplitStartVert": true, + "SplitVertList": [ { "bIsRelative": true, "dDimension": 50.0 @@ -48,10 +54,13 @@ "dDimension": 50.0 } ], + "SplitHorizList": [], "AreaList": [ { + "IdGroup": 3, "AreaList": [ { + "IdGroup": 4, "FillType": "GLASS", "AreaList": [], "AreaType": "FILL" @@ -60,8 +69,10 @@ "AreaType": "SPLITTED" }, { + "IdGroup": 5, "AreaList": [ { + "IdGroup": 6, "FillType": "GLASS", "AreaList": [], "AreaType": "FILL" diff --git a/Test.UI/Data/FinestraSplitVertOriz.jwd b/Test.UI/Data/FinestraSplitVertOriz.jwd deleted file mode 100644 index e8380b3..0000000 --- a/Test.UI/Data/FinestraSplitVertOriz.jwd +++ /dev/null @@ -1,141 +0,0 @@ -{ - "ProfilePath": "Profilo78", - "AreaList": [ - { - "Shape": "RECTANGLE", - "DimensionList": [ - { - "nIndex": 1, - "sName": "Width", - "dValue": 1500.0 - }, - { - "nIndex": 2, - "sName": "Height", - "dValue": 1800.0 - } - ], - "JointList": [ - { - "nIndex": 1, - "JointType": "FULL_H" - }, - { - "nIndex": 2, - "JointType": "FULL_H" - }, - { - "nIndex": 3, - "JointType": "FULL_H" - }, - { - "nIndex": 4, - "JointType": "FULL_H" - } - ], - "BottomRail": false, - "BottomRailQty": 0, - "AreaList": [ - { - "SplitShape": "VERTICAL", - "SplitPositionList": [ - { - "bIsRelative": true, - "dDimension": 50.0 - }, - { - "bIsRelative": true, - "dDimension": 50.0 - } - ], - "AreaList": [ - { - "AreaList": [ - { - "SplitShape": "HORIZONTAL", - "SplitPositionList": [ - { - "bIsRelative": true, - "dDimension": 40.0 - }, - { - "bIsRelative": true, - "dDimension": 60.0 - } - ], - "AreaList": [ - { - "AreaList": [ - { - "FillType": "GLASS", - "AreaList": [], - "AreaType": "FILL" - } - ], - "AreaType": "SPLITTED" - }, - { - "AreaList": [ - { - "FillType": "GLASS", - "AreaList": [], - "AreaType": "FILL" - } - ], - "AreaType": "SPLITTED" - } - ], - "AreaType": "SPLIT" - } - ], - "AreaType": "SPLITTED" - }, - { - "AreaList": [ - { - "SplitShape": "HORIZONTAL", - "SplitPositionList": [ - { - "bIsRelative": true, - "dDimension": 40.0 - }, - { - "bIsRelative": true, - "dDimension": 60.0 - } - ], - "AreaList": [ - { - "AreaList": [ - { - "FillType": "GLASS", - "AreaList": [], - "AreaType": "FILL" - } - ], - "AreaType": "SPLITTED" - }, - { - "AreaList": [ - { - "FillType": "GLASS", - "AreaList": [], - "AreaType": "FILL" - } - ], - "AreaType": "SPLITTED" - } - ], - "AreaType": "SPLIT" - } - ], - "AreaType": "SPLITTED" - } - ], - "AreaType": "SPLIT" - } - ], - "AreaType": "FRAME" - } - ] -} \ No newline at end of file diff --git a/Test.UI/Data/Setup.json b/Test.UI/Data/Setup.json index f11b42d..3a4469d 100644 --- a/Test.UI/Data/Setup.json +++ b/Test.UI/Data/Setup.json @@ -25,9 +25,9 @@ }, { "Index": 5, - "Description": "Finestra con split verticale e orizzontale", - "SVGFileName": "FinestraSplitVertOriz.svg", - "JwdFileName": "Data/FinestraSplitVertOriz.jwd" + "Description": "Finestra con split grid", + "SVGFileName": "FinestraSplitGrid.svg", + "JwdFileName": "Data/FinestraSplitGrid.jwd" }, { "Index": 6, diff --git a/Test.UI/Hardware/Setup.json b/Test.UI/Hardware/Setup.json index b232b3f..c937c0f 100644 --- a/Test.UI/Hardware/Setup.json +++ b/Test.UI/Hardware/Setup.json @@ -1,119 +1,48 @@ [ { - "sId": "101111", + "sId": "000558", "sFamily": "Natura", - "sName": "Natura_ANTA_RIBALTA_RECTANGLE_1SASH_2T_12_2T", + "sName": "Profilo78_Rect_Sash", "sOpeningType": "ANTA_RIBALTA", "sShape": "RECTANGLE", "nSashQty": "1", "nSashPosition": "1" }, { - "sId": "101112", + "sId": "000562", "sFamily": "Natura", - "sName": "Natura_ANTA_RIBALTA_RECTANGLE_1SASH_3T_12_3T", - "sOpeningType": "ANTA_RIBALTA", - "sShape": "RECTANGLE", - "nSashQty": "1", - "nSashPosition": "1" - }, - { - "sId": "101121", - "sFamily": "Natura", - "sName": "Natura_ANTA_BANDIERA_RECTANGLE_1SASH_2T_12_2T", + "sName": "Profilo78_Rect_Sash", "sOpeningType": "ANTA_BANDIERA", "sShape": "RECTANGLE", "nSashQty": "1", "nSashPosition": "1" }, { - "sId": "101122", + "sId": "000559", "sFamily": "Natura", - "sName": "Natura_ANTA_BANDIERA_RECTANGLE_1SASH_3T_12_3T", - "sOpeningType": "ANTA_BANDIERA", - "sShape": "RECTANGLE", - "nSashQty": "1", - "nSashPosition": "1" - }, - { - "sId": "101211", - "sFamily": "Natura", - "sName": "Natura_ANTA_RIBALTA_CHAMFER_1SASH_3T_12_3T", - "sOpeningType": "ANTA_RIBALTA", - "sShape": "CHAMFER", - "nSashQty": "1", - "nSashPosition": "1" - }, - { - "sId": "102111", - "sFamily": "Natura", - "sName": "Natura_ANTA_RIBALTA_RECTANGLE_2SASH_3T_12_3T", + "sName": "Profilo78_Rect_DoubleSash", "sOpeningType": "ANTA_RIBALTA", "sShape": "RECTANGLE", "nSashQty": "2", "nSashPosition": "1" }, { - "sId": "102112", + "sId": "000563", "sFamily": "Natura", - "sName": "Natura_ANTA_RIBALTA_RECTANGLE_2SASH_2T_18_2T", - "sOpeningType": "ANTA_RIBALTA", - "sShape": "RECTANGLE", - "nSashQty": "2", - "nSashPosition": "1" - }, - { - "sId": "102121", - "sFamily": "Natura", - "sName": "Natura_ANTA_BANDIERA_RECTANGLE_2SASH_3T_12_3T", + "sName": "Profilo78_TurnOnly_Rect_DoubleSash", "sOpeningType": "ANTA_BANDIERA", "sShape": "RECTANGLE", "nSashQty": "2", "nSashPosition": "1" }, { - "sId": "102221", + "sId": "000560", "sFamily": "Natura", - "sName": "Natura_ANTA_BANDIERA_CHAMFER_2SASH_3T_12_3T", - "sOpeningType": "ANTA_BANDIERA", - "sShape": "CHAMFER", - "nSashQty": "2", - "nSashPosition": "1" - }, - { - "sId": "201111", - "sFamily": "Optima", - "sName": "Optima_ANTA_RIBALTA_RECTANGLE_1SASH_3T_12_3T", + "sName": "Profilo78_Rect_TripleSash", "sOpeningType": "ANTA_RIBALTA", "sShape": "RECTANGLE", - "nSashQty": "1", - "nSashPosition": "1" - }, - { - "sId": "201221", - "sFamily": "Optima", - "sName": "Optima_ANTA_BANDIERA_RECTANGLE_1SASH_3T_12_3T", - "sOpeningType": "ANTA_BANDIERA", - "sShape": "CHAMFER", - "nSashQty": "1", - "nSashPosition": "1" - }, - { - "sId": "202111", - "sFamily": "Optima", - "sName": "Optima_ANTA_RIBALTA_RECTANGLE_2SASH_3T_12_3T", - "sOpeningType": "ANTA_RIBALTA", - "sShape": "RECTANGLE", - "nSashQty": "2", - "nSashPosition": "1" - }, - { - "sId": "202211", - "sFamily": "Optima", - "sName": "Optima_ANTA_RIBALTA_CHAMFER_2SASH_3T_12_3T", - "sOpeningType": "ANTA_RIBALTA", - "sShape": "CHAMFER", - "nSashQty": "2", + "nSashQty": "3", "nSashPosition": "1" } + ] \ No newline at end of file diff --git a/Test.UI/Properties/PublishProfiles/IISProfile.pubxml b/Test.UI/Properties/PublishProfiles/IISProfile.pubxml new file mode 100644 index 0000000..30fae91 --- /dev/null +++ b/Test.UI/Properties/PublishProfiles/IISProfile.pubxml @@ -0,0 +1,25 @@ + + + + + MSDeploy + true + Release + Any CPU + https://iis01.egalware.com/Lux/test/ + false + 8f1d6298-c1e6-44e6-82bd-4128ae17c0c7 + false + https://IIS01.egalware.com:8172/MsDeploy.axd + Default Web Site/Lux/test + + true + WMSVC + true + true + jenkins + <_SavePWD>true + <_TargetId>IISWebDeploy + net8.0 + + \ No newline at end of file diff --git a/Test.UI/Test.UI.csproj b/Test.UI/Test.UI.csproj index 435a85f..e3221e7 100644 --- a/Test.UI/Test.UI.csproj +++ b/Test.UI/Test.UI.csproj @@ -34,7 +34,6 @@ - diff --git a/WebWindow.Base/WebWindow.Base.csproj b/WebWindow.Base/WebWindow.Base.csproj index 74a0418..ceaacca 100644 --- a/WebWindow.Base/WebWindow.Base.csproj +++ b/WebWindow.Base/WebWindow.Base.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.9.1615 + 2.7.9.2909 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -28,3 +28,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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..1dd914a 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) {
@@ -130,7 +136,7 @@ } else { - + } } @@ -138,7 +144,7 @@
@fillTable(i, j)@FillTable(i, j)
- + } else if (currStep == CompileStep.Frame) { @@ -189,19 +195,19 @@
Frame joints
- +
- +
- +
@foreach (Joint joint in FrameWindow.JointList) {
- + -
-
- - -
- @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++; - } - } - } - } - } *@
@@ -590,7 +470,7 @@
- +
@@ -603,7 +483,7 @@ int IndexModify = i * 2 + j;
- +
} @@ -621,19 +501,19 @@
Sash joints
- +
- +
- +
@foreach (Joint joint in item.JointList) {
- + - - - + +
@@ -820,10 +701,11 @@
Fill type
- + @for (int i = 0; i < IN_GlassList.Count; i++) + { + + }
@@ -843,41 +725,25 @@
Color
+
+
+ + +
+
- - + + +
-
-

-

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

-
-
-

-

- -
-
- -
-
- -
-

-
diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index 47dba65..22d230b 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -28,28 +28,26 @@ 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)) + // Se viene passato un JWD + if (m_CurrJwd != value && value != "") { - m_SelTemplate = value; - SelFamilyHardware = IN_SelFamilyHardware; - JsonWindow WindowFromJson = JsonConvert.DeserializeObject(m_SelTemplate.JWD, new PolymorphicJsonConverter()) ?? new JsonWindow(""); + m_CurrJwd = value; + // Aggiornati parametri di ingresso selezionati + UpdateSelParameter(); + JsonWindow WindowFromJson = JsonConvert.DeserializeObject(m_CurrJwd, 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 + // Recupero dimensioni Frame e Joint del frame della finestra precedente if (m_PreviousWindow != null) { for (int i = 0; i < 2; i++) @@ -60,16 +58,45 @@ namespace WebWindowComplex } 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); - CreateElementTable(m_CurrWindow.AreaList[0], 1, 1, 1, 1); + // Aggiornate liste di sash, split, splitted, fill e itemTable + UpdateLists(); + } + } + } + + [Parameter] + public Template IN_SelTemplate + { + get => m_SelTemplate; + set + { + // Se viene passato il template selezionato oppure se non è ancora stato selezionato un template oppure se si cambia template di selezione + if (value != null && (m_SelTemplate == null || (m_SelTemplate != null && value.nIndex != m_SelTemplate.nIndex)) && !string.IsNullOrEmpty(value.JWD)) + { + m_SelTemplate = value; + // Aggiornamento parametri di ingresso selezionati + UpdateSelParameter(); + 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 del 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) + { + // Aggiornamento liste sash, split, splitted, fill e itemTable + UpdateLists(); } } } @@ -81,10 +108,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,17 +166,7 @@ namespace WebWindowComplex General } - protected enum ColorWindow - { - Bianco = 0, - Grigio = 1, - Tortora, - Blu, - Verde, - Nero - } - - protected enum positionJoints + protected enum PositionJoints { BL = 0, // Bottom Left BR = 1, // Bottom Right @@ -145,10 +180,10 @@ namespace WebWindowComplex protected Frame FrameWindow { - get => m_Frame; + get => m_Frame!; set => m_Frame = value; } - + protected string? m_CurrJwd { get; set; } protected string m_SelSVG { get; set; } = ""; /// @@ -180,17 +215,11 @@ namespace WebWindowComplex { get => m_SplittedList; } - protected List SplitParentList - { - get => m_SplitParentList; - } protected List ItemTableList { get => m_ItemTableList; } - protected TemplateSelectDTO? SelTemplateDTO { get; set; } = null; - protected string SelFamilyHardware { get @@ -213,33 +242,85 @@ namespace WebWindowComplex } } } + protected string SelColorMaterial { get; set; } = ""; + + protected string SelMaterial { get; set; } = ""!; + + protected string SelGlass { get; set; } = ""; #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 che resetta le liste (sash, split, splitted, fill e itemTable) e le crea nuovamente + /// + protected void UpdateLists() + { + m_maxCol = 0; + m_maxRow = 0; + m_FillList = new List(); + m_SashList = new List(); + m_SplitList = 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); + } + + /// + /// Metodo per settare i parmateri di ingresso selezionati + /// + protected void UpdateSelParameter() + { + SelFamilyHardware = IN_SelFamilyHardware; + SelColorMaterial = IN_SelColorMaterial ?? ""; + SelMaterial = IN_SelMaterial ?? ""; + SelGlass = IN_SelGlass ?? ""; + Sash.m_HardwareCompleteList = IN_HardwareList; + Sash.s_FamilyHardwareList = IN_FamilyHardwareList; + Sash.s_SelFamilyHW = IN_SelFamilyHardware; + } + /// /// Metodo per la scelta della maniglia univoca /// - /// + /// anta su cui si seleziona la maniglia /// - protected async Task changeHandle(SashDimension sashDim) + protected void changeHandle(SashDimension sashDim, Sash currSash) { - //if(m_SashList[0].AreaList.Count < 3) - //{ - foreach (SashDimension item in SashList[0].SashList) + // Cerco la Sash che si sta considerando nella lista Sash + foreach (Sash s in SashList) { - if (item.Equals(sashDim)) + if (s.Equals(currSash)) { - item.bHasHandle = true; - } - else - { - item.bHasHandle = false; + // Per ogni anta della Sash setto bHasHandle + foreach (SashDimension item in s.SashList) + { + if (item.Equals(sashDim)) + { + item.bHasHandle = true; + } + else + { + item.bHasHandle = false; + } + } } } - //} - await Task.Delay(1); } // Ancora da fare... @@ -258,8 +339,8 @@ namespace WebWindowComplex { var CurrJwd = JsonConvert.SerializeObject(m_CurrWindow.Serialize(), Formatting.Indented); Dictionary Args = new Dictionary(); + Args.Add("Mode", $"{(int)Enums.EngineQueryType.Preview}"); Args.Add("Jwd", CurrJwd); - Args.Add("Mode", 1.ToString()); await EC_OnUpdate.InvokeAsync(Args); } } @@ -269,8 +350,13 @@ namespace WebWindowComplex /// protected async Task DoReset() { - SelFamilyHardware = IN_SelFamilyHardware; - JsonWindow WindowFromJson = JsonConvert.DeserializeObject(m_SelTemplate.JWD, new PolymorphicJsonConverter()) ?? new JsonWindow(""); + // Aggiornati parametri di ingresso selezionati + UpdateSelParameter(); + 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; @@ -278,17 +364,8 @@ namespace WebWindowComplex } 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(); - m_ItemTableList = new List(); - m_maxCol = 0; - m_maxRow = 0; - // popolo le liste Fill, Sash e Split - CreateWindowsList(m_CurrWindow.AreaList[0], false); - CreateElementTable(m_CurrWindow.AreaList[0], 1, 1, 1, 1); + // Aggiorante liste sash, split, splitted, fill e itemTable + UpdateLists(); currSash = -1; await DoPreviewSvg(); } @@ -303,18 +380,17 @@ namespace WebWindowComplex /// /// Selezione del template /// - /// template selezionato + /// 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 + /// step successivo protected async void NextStepAndPreview(CompileStep newStep, int Index = -1) { currStep = newStep; @@ -325,6 +401,11 @@ namespace WebWindowComplex await DoPreviewSvg(); } + /// + /// Metodo per riempire le liste Sash, Split, Splitted e Fill + /// + /// Area da classificare + /// Parametro per sapere se si è dentro un'anta protected void CreateWindowsList(Area node, bool IntoSash) { if (node != null) @@ -369,6 +450,14 @@ namespace WebWindowComplex } } + /// + /// Metodo per riempire la lista ItemTable in modo da poter rappresentarla come tabella + /// + /// Area da classificare + /// numero di riga + /// numero di colonna + /// numero di riga massimo + /// numero di colonna massimo protected void CreateElementTable(Area node, int row, int col, int maxRow, int maxCol) { if (node != null) @@ -377,7 +466,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 +482,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 +511,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 +525,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 +557,7 @@ namespace WebWindowComplex CreateElementTable(item, row, col, maxRow, maxCol); } } - if(maxCol> m_maxCol) + if (maxCol > m_maxCol) { m_maxCol = maxCol; } @@ -477,13 +566,19 @@ namespace WebWindowComplex m_maxRow = maxRow; } } - - private string fillTable(int row, int col) + + /// + /// Metodo per riempire tabella con contenuto vuoto o con i simboli per rappresentare la struttura + /// + /// riga della cella + /// colonna della cella + /// + 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 +604,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 "└"; } @@ -525,11 +620,11 @@ namespace WebWindowComplex return "├"; } } - // Non solo alla riga successiva + // Non sono alla riga successiva else { // se ha un solo figlio - if(itemSameCol.Last().NumChild == 1) + if (itemSameCol.Last().NumChild == 1) { return " "; } @@ -560,30 +655,22 @@ 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) + /// tipo di giunzione (ANGLED o FULL_H o FULL_V) + /// area su cui eseguire la funzione (Frame o Sash) /// - private async Task AllJointsFrame(int n_type, int n_place) + private async Task ChangeAllJoints(WindowConst.Joints type, Area area) { - Joints type = Joints.ANGLED; - if (n_type == 2) - { - type = Joints.FULL_H; - } - else if (n_type == 3) - { - 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 a = (Sash)area; + foreach (Joint joint in a.JointList) { joint.SetSelJointType(type); } @@ -592,17 +679,12 @@ namespace WebWindowComplex } /// - /// Metodo per settare tutti i Joints di Frame o Sash come ANGLED o FULL_H o FULL_V + /// Metodo per settare tutti i Fill in contemporanea /// - /// tipo di riempimento (GLASS o WOOD) + /// tipo di riempimento (GLASS o WOOD) /// - private async Task AllFill(int n_type) + private async Task ChangeAllFill(WindowConst.FillTypes type) { - FillTypes type = FillTypes.GLASS; - if (n_type == 2) - { - type = FillTypes.WOOD; - } foreach (Fill currFill in m_FillList) { currFill.SetFillType(type); @@ -613,23 +695,29 @@ namespace WebWindowComplex /// /// Metodo per copiare contenuto di un'anta in un'altra anta /// - /// 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) + /// Sash corrispondente all'anta + /// Indice dell'anta che si copia + /// Indice dell'anta che si modifica + 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 + /// + /// Area Splitted corrente + /// Indice della Sash che si vuole copiare + /// + private async Task CopySash(Splitted currSplitted, int numSash) { //Rimuovo contenuto di Splitted currSplitted.AreaList.RemoveAll(i => i != null); @@ -641,6 +729,11 @@ namespace WebWindowComplex await DoPreviewSvg(); } + /// + /// Metodo per scambiare due aree di uno split + /// + /// Area corrente + /// private async Task SwapTwoAree(Area currArea) { currArea.SwapAree(); @@ -651,26 +744,14 @@ namespace WebWindowComplex #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 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_ItemTableList = new List(); - - private List m_SplitParentList = new List(); - private int m_maxCol = 0; private int m_maxRow = 0; @@ -679,11 +760,8 @@ namespace WebWindowComplex #region Private Properties private Window? m_CurrWindow { get; set; } = null; - private Window? m_PreviousWindow { get; set; } = null; - private Template m_SelTemplate { get; set; } = null!; - private string m_SelFamilyHardware { get; set; } = ""; #endregion Private Properties @@ -693,55 +771,40 @@ namespace WebWindowComplex /// /// Metodo per andare allo step successivo /// - /// 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("Mode", $"{(int)Enums.EngineQueryType.Preview}"); Args.Add("Jwd", e.sJwd); - Args.Add("Mode", 1.ToString()); EC_OnUpdate.InvokeAsync(Args); } /// /// Calcola il css del tab selezionato /// - /// + /// Step /// 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 + /// Calcola larghezza colonna contenente nav da mostrare /// /// private string mainCss() @@ -749,6 +812,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/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 3f19654..f91cbce 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.9.1615 + 2.7.9.2909 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -42,3 +42,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WebWindowComplex/Window.cs b/WebWindowComplex/Window.cs index 0364c68..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 @@ -17,7 +17,7 @@ namespace WebWindowComplex { public event EventHandler OnPreview = delegate { }; - private String m_sProfilePath; + private string m_sProfilePath; public string sProfilePath { get @@ -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); - 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 3e80884..3228850 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.9.1615 + 2.7.9.2909 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -53,3 +53,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WebWindowTest/Json/JsonUtility.cs b/WebWindowTest/Json/JsonUtility.cs index a5e2fd1..b26ce62 100644 --- a/WebWindowTest/Json/JsonUtility.cs +++ b/WebWindowTest/Json/JsonUtility.cs @@ -24,6 +24,48 @@ namespace WebWindowTest.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,14 +80,20 @@ namespace WebWindowTest.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)); return Window; @@ -54,8 +102,21 @@ namespace WebWindowTest.Json public class JsonArea { - private List m_AreaList = new List(); + private int m_nIdGroup; + [JsonProperty] + public int IdGroup + { + get + { + return m_nIdGroup; + } + set + { + m_nIdGroup = value; + } + } + private List m_AreaList = new List(); [JsonProperty] public List AreaList { @@ -168,16 +229,18 @@ namespace WebWindowTest.Json { } - public JsonFrame(Shapes Shape, bool BottomRail, int BottomRailQty) : base(AreaTypes.FRAME) + public JsonFrame(Shapes Shape, bool BottomRail, int BottomRailQty, int nIdGroup) : base(AreaTypes.FRAME) { m_Shape = Shape; m_bBottomRail = BottomRail; m_nBottomRailQty = BottomRailQty; + IdGroup = nIdGroup; } internal override Area Deserialize(Area ParentArea, Window ParentWindow) { Frame newFrame = new Frame(null, ParentWindow); + newFrame.SetIdGroup(IdGroup); newFrame.SetAreaType(AreaTypes.FRAME); newFrame.SetSelShape(m_Shape); newFrame.SetBottomRail(m_bBottomRail); @@ -200,7 +263,7 @@ namespace WebWindowTest.Json } public class JsonSash : JsonArea - { + { private bool m_bIsSashVertical; [JsonProperty] public bool bIsSashVertical @@ -304,18 +367,20 @@ namespace WebWindowTest.Json { } - public JsonSash(bool bIsSashVertical, SashTypes SashType, bool SashBottomRail, int SashBottomRailQty, string Hardware) : base(AreaTypes.SASH) + public JsonSash(bool bIsSashVertical, SashTypes SashType, bool SashBottomRail, int SashBottomRailQty, string Hardware, int nIdGroup) : base(AreaTypes.SASH) { m_bIsSashVertical = bIsSashVertical; m_SashType = SashType; m_bBottomRail = SashBottomRail; m_nBottomRailQty = SashBottomRailQty; m_Hardware = Hardware; + IdGroup = nIdGroup; } internal override Area Deserialize(Area ParentArea, Window ParentWindow) { Sash newSash = new Sash(ParentArea, ParentWindow); + newSash.SetIdGroup(IdGroup); newSash.SetAreaType(AreaTypes.SASH); newSash.SetSashQty(m_SashList.Count); newSash.SetIsSashVertical(m_bIsSashVertical); @@ -360,17 +425,45 @@ namespace WebWindowTest.Json } } - private List m_SplitPositionList = new List(); + private bool m_SplitStartVert; [JsonProperty] - public List SplitPositionList + public bool SplitStartVert { get { - return m_SplitPositionList; + return m_SplitStartVert; } set { - m_SplitPositionList = value; + m_SplitStartVert = value; + } + } + + private List m_SplitVertList = new List(); + [JsonProperty] + public List SplitVertList + { + get + { + return m_SplitVertList; + } + set + { + m_SplitVertList = value; + } + } + + private List m_SplitHorizList = new List(); + [JsonProperty] + public List SplitHorizList + { + get + { + return m_SplitHorizList; + } + set + { + m_SplitHorizList = value; } } @@ -378,22 +471,42 @@ namespace WebWindowTest.Json { } - public JsonSplit(SplitShapes SplitShape) : base(AreaTypes.SPLIT) + public JsonSplit(SplitShapes SplitShape, int nIdGroup) : base(AreaTypes.SPLIT) { m_SplitShape = SplitShape; + IdGroup = nIdGroup; } internal override Area Deserialize(Area ParentArea, Window ParentWindow) { Split Split = new Split(ParentArea, ParentWindow); + Split.SetIdGroup(IdGroup); Split.SetAreaType(AreaTypes.SPLIT); Split.SetSplitShape(m_SplitShape, true); - Split.SetSplitQty(m_SplitPositionList.Count - 1, true); - //Split.AppliedDone(); - for (var SplitIndex = 0; SplitIndex <= m_SplitPositionList.Count - 1; SplitIndex++) + Split.SetSplitStartVert(m_SplitStartVert); + if(m_SplitVertList.Count == 0) + Split.SetSplitQtyVert(0, true); + else { - Split.SplitPositionList[SplitIndex].SetIsRelative(m_SplitPositionList[SplitIndex].bIsRelative); - Split.SplitPositionList[SplitIndex].SetDimension(m_SplitPositionList[SplitIndex].dDimension); + //Split.SplitVertList.Clear(); + Split.SetSplitQtyVert(m_SplitVertList.Count - 1, true); + for (var SplitIndex = 0; SplitIndex <= m_SplitVertList.Count - 1; SplitIndex++) + { + Split.SplitVertList[SplitIndex].SetIsRelative(m_SplitVertList[SplitIndex].bIsRelative); + Split.SplitVertList[SplitIndex].SetDimension(m_SplitVertList[SplitIndex].dDimension); + } + } + if(m_SplitHorizList.Count == 0) + Split.SetSplitQtyHoriz(0, true); + else + { + //Split.SplitHorizList.Clear(); + Split.SetSplitQtyHoriz(m_SplitHorizList.Count - 1, true); + for (var SplitIndex = 0; SplitIndex <= m_SplitHorizList.Count - 1; SplitIndex++) + { + Split.SplitHorizList[SplitIndex].SetIsRelative(m_SplitHorizList[SplitIndex].bIsRelative); + Split.SplitHorizList[SplitIndex].SetDimension(m_SplitHorizList[SplitIndex].dDimension); + } } foreach (var Area in AreaList) { @@ -412,22 +525,27 @@ namespace WebWindowTest.Json public JsonSplitted() : base(AreaTypes.SPLITTED) { } + public JsonSplitted(int nIdGroup) : base(AreaTypes.SPLITTED) + { + IdGroup = nIdGroup; + } internal override Area Deserialize(Area ParentArea, Window ParentWindow) { - Splitted Split = new Splitted(ParentArea, ParentWindow); - Split.SetAreaType(AreaTypes.SPLITTED); + Splitted newSplitted = new Splitted(ParentArea, ParentWindow); + newSplitted.SetIdGroup(IdGroup); + newSplitted.SetAreaType(AreaTypes.SPLITTED); //Split.AppliedDone(); foreach (var Area in AreaList) { - var AreaDeserealized = Area.Deserialize(Split, ParentWindow); + var AreaDeserealized = Area.Deserialize(newSplitted, ParentWindow); if (AreaDeserealized != null) { - Split.AreaList.Add(AreaDeserealized); + newSplitted.AreaList.Add(AreaDeserealized); } } - return Split; + return newSplitted; } } @@ -452,14 +570,16 @@ namespace WebWindowTest.Json { } - public JsonFill(FillTypes FillType) : base(AreaTypes.FILL) + public JsonFill(FillTypes FillType, int nIdGroup) : base(AreaTypes.FILL) { m_FillType = FillType; + IdGroup = nIdGroup; } internal override Area Deserialize(Area ParentArea, Window ParentWindow) { Fill Fill = new Fill(ParentArea, ParentWindow); + Fill.SetIdGroup(IdGroup); Fill.SetAreaType(AreaTypes.FILL); Fill.SetFillType(m_FillType); //Fill.AppliedDone(); @@ -561,6 +681,16 @@ namespace WebWindowTest.Json public class JsonSashDimension { + private int m_nSashId; + [JsonProperty] + public int nSashId + { + get + { + return m_nSashId; + } + } + private Openings m_OpeningType; [JsonProperty] [JsonConverter(typeof(StringEnumConverter))] @@ -600,11 +730,12 @@ namespace WebWindowTest.Json } } - public JsonSashDimension(Openings OpeningType, bool bHasHandle, double dDimension) + public JsonSashDimension(Openings OpeningType, bool bHasHandle, double dDimension, int nSashId) { m_OpeningType = OpeningType; m_bHasHandle = bHasHandle; m_dDimension = dDimension; + m_nSashId = nSashId; } } diff --git a/WebWindowTest/ParametriOpzioni.cs b/WebWindowTest/ParametriOpzioni.cs new file mode 100644 index 0000000..c91dbcc --- /dev/null +++ b/WebWindowTest/ParametriOpzioni.cs @@ -0,0 +1,196 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WebWindowTest +{ + 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/WebWindowTest/Test.razor b/WebWindowTest/Test.razor index 7c78520..8829cac 100644 --- a/WebWindowTest/Test.razor +++ b/WebWindowTest/Test.razor @@ -136,7 +136,7 @@ } else { - @fillTable(i, j) + @FillTable(i, j) } } @@ -144,7 +144,7 @@
- + } else if (currStep == CompileStep.Frame) { @@ -153,101 +153,117 @@ 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
+
Dimension
+ @foreach (FrameDimension dimension in FrameWindow.DimensionList) + { +
+ @dimension.sName + + mm +
+ } +
+
+
+
+
+
+
Threshold
- + + +
+
+
+
+
+
+
+
+
+
Frame joints
+
+
+ +
+
+ +
+
+ +
+
+ @foreach (Joint joint in FrameWindow.JointList) + { +
+ + +
+ } +
+
+
+ @if (!(FrameWindow.AreaList[0] is Split)) + { +
+
+
+
Frame
+
+ +
+
+
+
+ } +
+ @if (m_SashList.Count == 0) + { +
+
+
+
+
Bottom rail
+
+ Quantity + +
}
- @if (m_SashList.Count == 0) - { -
-
-
-
-
Bottom rail
-
- Quantity - -
-
-
-
-
- }
} @@ -260,86 +276,97 @@ @for (int i = 0; i < SplitList.Count; i++) { Split currSplit = SplitList[i]; -
+
- @if ((currSplit.ParentArea is Splitted || currSplit.ParentArea is Sash) && SashList.Count > 0) - { - @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")
- } +
@(descParentSplit(currSplit))
Split
- @if (currSplit.nSplitQty == 1) + @if ((currSplit.nSplitQtyVert == 1 && currSplit.nSplitQtyHoriz == 1) || + (currSplit.nSplitQtyVert == 1 && currSplit.nSplitQtyHoriz == 0) || + (currSplit.nSplitQtyVert == 0 && currSplit.nSplitQtyHoriz == 1)) {
} -
- Number - +
+
+
+ + +
+
-
- - +
+ @if (currSplit.nSplitQtyVert > 0) + { +
+
+ QtyVert + +
+
+ } + @if (currSplit.nSplitQtyHoriz > 0) + { +
+
+ QtyHoriz + +
+
+ }
- @foreach (var dim in currSplit.SplitPositionList) +
+ @if (currSplit.SplitVertList.Count > 0) + { +
+ @foreach (var dim in currSplit.SplitVertList) + { +
+ Width + + % +
+ } +
+ } + @if (currSplit.SplitHorizList.Count > 0) + { +
+ @foreach (var dim in currSplit.SplitHorizList) + { +
+ Height + + % +
+ + } +
+ } +
+ @if(currSplit.SelSplitShape == Json.WindowConst.SplitShapes.GRID) { - 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 - - % +
+
+
+
+ +
+
+ +
+
+
}
@@ -349,7 +376,8 @@
} - +
+
@for (int i = 0; i < SplittedList.Count; i++) { Splitted currSplitted = SplittedList[i]; @@ -360,7 +388,7 @@
- +
@for (int j = 0; j < SashList.Count; j++) @@ -368,11 +396,11 @@ int Index = j;
- +
} - +
@@ -393,157 +421,101 @@ { Sash item = SashList[currSash];
-
-
-
-
- Number - -
-
-
-
-
-
-
-
Orientation
-
- - -
+
+
+
+
+
+ Number +
-
-
-
-
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 - - % -
-
-
- -
-
- -
-
-
- @for (int k = 1; k <= i * 2 + j; k++) - { - int IndexCopy = k; - int IndexModify = i * 2 + j; -
-
- -
-
- } -
-
-
-
- } - } -
-
-
-
-
-
Sash joints
-
-
- -
-
- -
-
- -
-
- @foreach (Joint joint in item.JointList) - { +
+
+
+
+
Orientation
- - + +
- } +
+
+
+
+
+
+
Bottom rail
+
+ Quantity + +
+
-
- @for (int i = 0; i < item.AreaList.Count; i++) +
+ @for (int i = 0; i <= item.SashList.Count / 2; i++) { - Area anta; - @if (item.AreaList[i] is Splitted) + for (int j = 0; j < 2 && (i * 2 + j <= item.SashList.Count - 1); j++) { - anta = item.AreaList[i]; - } - else - { - anta = item; - } - @if (!(anta.AreaList[0] is Split)) - { -
+ SashDimension sash = item.SashList[i * 2 + j]; +
-
Anta @(i + 1)
+ @if (item.SashList.Count == 1) + { +
Opening
+ } + else + { +
Sash opening @(i * 2 + j + 1)
+ }
- + + +
+
+ Dimension + + % +
+
+
+ +
+
+ +
+
+
+ @for (int k = 1; k <= i * 2 + j; k++) + { + int IndexCopy = k; + int IndexModify = i * 2 + j; +
+
+ +
+
+ }
@@ -551,33 +523,91 @@ } }
-
-
-
-
-
-
Hardware
-
-
-
- - +
+
+
+
+
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)
+
+ +
+
+
+
+ } + } +
+
+
+
+
+
+
Hardware
+
+
+
+ + +
+
+
+
+ +
+
@@ -593,20 +623,20 @@
-
+
-
-
-
Fill Area
+
Area Fill
+
+
+
+ +
-
-
-
- -
-
- +
+
+ +
@@ -669,135 +699,123 @@ else if (currStep == CompileStep.General) {
-
-
-
-
-
-
Generic
-
- - -
-
- - -
-
-
-
-
-
-
-
Fill type
-
- - -
-
- - -
-
-
-
-
-
-
-
-
-
Color
-
- - -
-
-

-

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

-
-
-

-

- -
-
- -
-
- -
-

-
-
-
-
-
- @if (m_SashList.Count > 0) - { +
+
-
Hardware
+
Generic
- - + @for (int i = 0; i < IN_MaterialList.Count; i++) + { + + }
- - + + + + +
+
+
+
+
+
+
+
Fill type
+
+ +
- - + + +
- } +
+
+
+
+
Color
+
+
+ + +
+
+
+ + +
+
+
+
+
+ @if (m_SashList.Count > 0) + { +
+
+
+
+
Hardware
+
+ + +
+
+ + +
+
+ + +
+
+
+
+
+ } +
} diff --git a/WebWindowTest/Test.razor.cs b/WebWindowTest/Test.razor.cs index a154dba..de384d0 100644 --- a/WebWindowTest/Test.razor.cs +++ b/WebWindowTest/Test.razor.cs @@ -1,9 +1,12 @@ using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Web; +using Microsoft.Net.Http.Headers; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System.Reflection.Metadata; +using System.Reflection.Metadata.Ecma335; using System.Runtime.InteropServices; +using WebWindow.Base; using WebWindowTest.DTO; using WebWindowTest.Json; using static WebWindowTest.Json.WindowConst; @@ -32,22 +35,21 @@ namespace WebWindowTest get => m_CurrJwd; set { + // Se viene passato un JWD if (m_CurrJwd != value && value != "") { m_CurrJwd = value; - SelFamilyHardware = IN_SelFamilyHardware; - JsonWindow WindowFromJson = JsonConvert.DeserializeObject(m_CurrJwd, new PolymorphicJsonConverter()) ?? new JsonWindow(""); + // Aggiornati parametri di ingresso selezionati + UpdateSelParameter(); + JsonWindow WindowFromJson = JsonConvert.DeserializeObject(m_CurrJwd, 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 + // Recupero dimensioni Frame e Joint del frame della finestra precedente if (m_PreviousWindow != null) { for (int i = 0; i < 2; i++) @@ -58,16 +60,8 @@ namespace WebWindowTest } 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); - CreateElementTable(m_CurrWindow.AreaList[0], 1, 1, 1, 1); + // Aggiornate liste di sash, split, splitted, fill e itemTable + UpdateLists(); } } } @@ -78,23 +72,21 @@ namespace WebWindowTest get => m_SelTemplate; set { - // Se non ho ancora selezionato template oppure se cambio template di selezione + // Se viene passato il template selezionato oppure se non è ancora stato selezionato un template oppure se si cambia 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; - JsonWindow WindowFromJson = JsonConvert.DeserializeObject(m_SelTemplate.JWD, new PolymorphicJsonConverter()) ?? new JsonWindow(""); + // Aggiornamento parametri di ingresso selezionati + UpdateSelParameter(); + 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 + // Recupero dimensioni Frame e Joint del frame della finestra precedente if (m_PreviousWindow != null) { for (int i = 0; i < 2; i++) @@ -105,16 +97,8 @@ namespace WebWindowTest } 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); - CreateElementTable(m_CurrWindow.AreaList[0], 1, 1, 1, 1); + // Aggiornamento liste sash, split, splitted, fill e itemTable + UpdateLists(); } } } @@ -126,10 +110,28 @@ namespace WebWindowTest 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 @@ -166,17 +168,7 @@ namespace WebWindowTest General } - protected enum ColorWindow - { - Bianco = 0, - Grigio = 1, - Tortora, - Blu, - Verde, - Nero - } - - protected enum positionJoints + protected enum PositionJoints { BL = 0, // Bottom Left BR = 1, // Bottom Right @@ -190,10 +182,10 @@ namespace WebWindowTest protected Frame FrameWindow { - get => m_Frame; + get => m_Frame!; set => m_Frame = value; } - protected string m_CurrJwd { get; set; } + protected string? m_CurrJwd { get; set; } protected string m_SelSVG { get; set; } = ""; /// @@ -225,17 +217,11 @@ namespace WebWindowTest { get => m_SplittedList; } - //protected List SplitParentList - //{ - // get => m_SplitParentList; - //} protected List ItemTableList { get => m_ItemTableList; } - protected TemplateSelectDTO? SelTemplateDTO { get; set; } = null; - protected string SelFamilyHardware { get @@ -258,6 +244,11 @@ namespace WebWindowTest } } } + protected string SelColorMaterial { get; set; } = ""; + + protected string SelMaterial { get; set; } = ""!; + + protected string SelGlass { get; set; } = ""; #endregion Protected Properties @@ -277,27 +268,33 @@ namespace WebWindowTest } /// - /// Metodo per la scelta della maniglia univoca + /// Metodo che resetta le liste (sash, split, splitted, fill e itemTable) e le crea nuovamente /// - /// - /// - protected async Task changeHandle(SashDimension sashDim) + protected void UpdateLists() { - //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); + m_maxCol = 0; + m_maxRow = 0; + m_FillList = new List(); + m_SashList = new List(); + m_SplitList = 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); + } + + /// + /// Metodo per settare i parmateri di ingresso selezionati + /// + protected void UpdateSelParameter() + { + SelFamilyHardware = IN_SelFamilyHardware; + SelColorMaterial = IN_SelColorMaterial ?? ""; + SelMaterial = IN_SelMaterial ?? ""; + SelGlass = IN_SelGlass ?? ""; + Sash.m_HardwareCompleteList = IN_HardwareList; + Sash.s_FamilyHardwareList = IN_FamilyHardwareList; + Sash.s_SelFamilyHW = IN_SelFamilyHardware; } // Ancora da fare... @@ -316,8 +313,8 @@ namespace WebWindowTest { var CurrJwd = JsonConvert.SerializeObject(m_CurrWindow.Serialize(), Formatting.Indented); Dictionary Args = new Dictionary(); + Args.Add("Mode", $"{(int)Enums.EngineQueryType.Preview}"); Args.Add("Jwd", CurrJwd); - Args.Add("Mode", 1.ToString()); await EC_OnUpdate.InvokeAsync(Args); } } @@ -327,12 +324,14 @@ namespace WebWindowTest /// protected async Task DoReset() { - SelFamilyHardware = IN_SelFamilyHardware; + // Aggiornati parametri di ingresso selezionati + Area.nCounterGroup = 0; + UpdateSelParameter(); JsonWindow WindowFromJson; if (string.IsNullOrEmpty(CurrJwd)) - WindowFromJson = JsonConvert.DeserializeObject(m_SelTemplate.JWD, new PolymorphicJsonConverter()) ?? new JsonWindow(""); + WindowFromJson = JsonConvert.DeserializeObject(m_SelTemplate.JWD, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", ""); else - WindowFromJson = JsonConvert.DeserializeObject(m_CurrJwd, new PolymorphicJsonConverter()) ?? new JsonWindow(""); + WindowFromJson = JsonConvert.DeserializeObject(m_CurrJwd!, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", ""); if (m_CurrWindow != null) { m_CurrWindow.OnPreview -= M_CurrWindow_OnPreview; @@ -340,18 +339,10 @@ namespace WebWindowTest } 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(); - m_ItemTableList = new List(); - m_maxCol = 0; - m_maxRow = 0; - // popolo le liste Fill, Sash e Split - CreateWindowsList(m_CurrWindow.AreaList[0], false); - CreateElementTable(m_CurrWindow.AreaList[0], 1, 1, 1, 1); + // Aggiorante liste sash, split, splitted, fill e itemTable + UpdateLists(); currSash = -1; + currStep = CompileStep.Gerarchia; await DoPreviewSvg(); } @@ -362,31 +353,114 @@ namespace WebWindowTest await EC_OnClose.InvokeAsync(true); } + /// + /// Metodo per la scelta della maniglia univoca + /// + /// anta su cui si seleziona la maniglia + /// + protected void changeHandle(SashDimension sashDim, Sash currSash) + { + // Cerco la Sash che si sta considerando nella lista Sash + foreach (Sash s in SashList) + { + if (s.Equals(currSash)) + { + // Per ogni anta della Sash setto bHasHandle + foreach (SashDimension item in s.SashList) + { + if (item.Equals(sashDim)) + { + item.bHasHandle = true; + } + else + { + if (item.bHasHandle) + { + switch (item.SelOpeningType) + { + case Openings.TILTTURN_LEFT: + item.SetOpeningType(Openings.TURNONLY_LEFT); + break; + case Openings.TILTTURN_RIGHT: + item.SetOpeningType(Openings.TURNONLY_RIGHT); + break; + default: + break; + } + } + item.bHasHandle = false; + } + } + } + } + } + + /// + /// Metodo per la scelta dello split intero nella modalità griglia + /// + /// split su cui si sceglie + /// + protected void changeStartVert(ChangeEventArgs e, Split currSplit) + { + // Cerco la Sash che si sta considerando nella lista Sash + foreach (Split s in SplitList) + { + if (s.Equals(currSplit)) + { + s.SetSplitStartVert((bool)e.Value); + } + } + } + + /// + /// Metodo per determinare la descrizione del parent dello split corrente + /// + /// split corrente + /// + protected string descParentSplit(Split currSplit) + { + if((currSplit.ParentArea is Splitted || currSplit.ParentArea is Sash) && SashList.Count > 0) + { + for(int j = 0; j < SashList.Count; j++) + { + if(SashList[j].Equals(currSplit.ParentArea)) + { + return "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)) + { + return "Sash " + (j + 1) + " - anta " + (k + 1); + } + } + } + } + } + else + { + return "Frame"; + } + return ""; + } + /// /// Selezione del template /// - /// template selezionato + /// 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 + /// Metodo per riempire le liste Sash, Split, Splitted e Fill /// - /// step successivo - protected async void NextStepAndPreview(CompileStep newStep, int Index = -1) - { - currStep = newStep; - if (newStep == CompileStep.Sash) - currSash = Index; - else - currSash = -1; - await DoPreviewSvg(); - } - + /// Area da classificare + /// Parametro per sapere se si è dentro un'anta protected void CreateWindowsList(Area node, bool IntoSash) { if (node != null) @@ -431,6 +505,14 @@ namespace WebWindowTest } } + /// + /// Metodo per riempire la lista ItemTable in modo da poter rappresentarla come tabella + /// + /// Area da classificare + /// numero di riga + /// numero di colonna + /// numero di riga massimo + /// numero di colonna massimo protected void CreateElementTable(Area node, int row, int col, int maxRow, int maxCol) { if (node != null) @@ -439,7 +521,7 @@ namespace WebWindowTest { 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)); @@ -455,12 +537,12 @@ namespace WebWindowTest 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)); @@ -484,7 +566,7 @@ namespace WebWindowTest } 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)); @@ -498,7 +580,7 @@ namespace WebWindowTest 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 @@ -530,7 +612,7 @@ namespace WebWindowTest CreateElementTable(item, row, col, maxRow, maxCol); } } - if(maxCol> m_maxCol) + if (maxCol > m_maxCol) { m_maxCol = maxCol; } @@ -539,13 +621,19 @@ namespace WebWindowTest m_maxRow = maxRow; } } - - private string fillTable(int row, int col) + + /// + /// Metodo per riempire tabella con contenuto vuoto o con i simboli per rappresentare la struttura + /// + /// riga della cella + /// colonna della cella + /// + 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]); } @@ -571,10 +659,10 @@ namespace WebWindowTest 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 "└"; } @@ -587,11 +675,11 @@ namespace WebWindowTest return "├"; } } - // Non solo alla riga successiva + // Non sono alla riga successiva else { // se ha un solo figlio - if(itemSameCol.Last().NumChild == 1) + if (itemSameCol.Last().NumChild == 1) { return " "; } @@ -622,21 +710,12 @@ namespace WebWindowTest /// /// 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) + /// tipo di giunzione (ANGLED o FULL_H o FULL_V) + /// area su cui eseguire la funzione (Frame o Sash) /// - private async Task AllJointsFrame(int n_type, Area area) + private async Task ChangeAllJoints(WindowConst.Joints type, Area area) { - Joints type = Joints.ANGLED; - if (n_type == 2) - { - type = Joints.FULL_H; - } - else if (n_type == 3) - { - type = Joints.FULL_V; - } - if(area is Frame) + if (area is Frame) { foreach (Joint joint in FrameWindow.JointList) { @@ -645,41 +724,22 @@ namespace WebWindowTest } else { - Sash s = (Sash)area; - foreach (Joint joint in s.JointList) + Sash a = (Sash)area; + foreach (Joint joint in a.JointList) { joint.SetSelJointType(type); } } - //if (n_place == 0) - //{ - // foreach (Joint joint in FrameWindow.JointList) - // { - // joint.SetSelJointType(type); - // } - //} - //else if (n_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 + /// Metodo per settare tutti i Fill in contemporanea /// - /// tipo di riempimento (GLASS o WOOD) + /// tipo di riempimento (GLASS o WOOD) /// - private async Task AllFill(int n_type) + private async Task ChangeAllFill(WindowConst.FillTypes type) { - FillTypes type = FillTypes.GLASS; - if (n_type == 2) - { - type = FillTypes.WOOD; - } foreach (Fill currFill in m_FillList) { currFill.SetFillType(type); @@ -690,26 +750,33 @@ namespace WebWindowTest /// /// Metodo per copiare contenuto di un'anta in un'altra anta /// - /// 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) + /// Sash corrispondente all'anta + /// Indice dell'anta che si copia + /// Indice dell'anta che si modifica + 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 + /// + /// Area Splitted corrente + /// Indice della Sash che si vuole copiare + /// + private async Task CopySash(Splitted currSplitted, int numSash) { - //Rimuovo contenuto di Splitted + //Rimuovo contenuto di Splitted e rimuovo area da conteggio gruppi currSplitted.AreaList.RemoveAll(i => i != null); + //Area.DelCounterGroup(); // Copio sash Area a = SashList[numSash].Copy(currSplitted); a.SetParentArea(currSplitted); @@ -718,6 +785,11 @@ namespace WebWindowTest await DoPreviewSvg(); } + /// + /// Metodo per scambiare due aree di uno split + /// + /// Area corrente + /// private async Task SwapTwoAree(Area currArea) { currArea.SwapAree(); @@ -727,26 +799,15 @@ namespace WebWindowTest #endregion Protected Methods #region Private Fields + private CompileStep currStep; - private int currSash = -1; - - private ColorWindow currColorWin = ColorWindow.Bianco; - - private Frame m_Frame; - + 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_ItemTableList = new List(); - - //private List m_SplitParentList = new List(); - private int m_maxCol = 0; private int m_maxRow = 0; @@ -755,67 +816,63 @@ namespace WebWindowTest #region Private Properties private Window? m_CurrWindow { get; set; } = null; - private Window? m_PreviousWindow { get; set; } = null; - private Template m_SelTemplate { get; set; } = null!; - private string m_SelFamilyHardware { get; set; } = ""; #endregion Private Properties #region Private Methods + /// + /// Metodo per cambiare step e aggiornare preview svg + /// + /// step successivo + private async void NextStepAndPreview(CompileStep newStep, int Index = -1) + { + currStep = newStep; + if (newStep == CompileStep.Sash) + currSash = Index; + else + currSash = -1; + await DoPreviewSvg(); + } + /// /// Metodo per andare allo step successivo /// - /// 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("Mode", $"{(int)Enums.EngineQueryType.Preview}"); Args.Add("Jwd", e.sJwd); - Args.Add("Mode", 1.ToString()); EC_OnUpdate.InvokeAsync(Args); } /// /// Calcola il css del tab selezionato /// - /// + /// Step /// 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 contenente nav da mostrare /// @@ -825,13 +882,31 @@ namespace WebWindowTest return (currStep == CompileStep.Template) ? "col-12" : "col-6"; } + /// + /// Calcola larghezza border descrizione split + /// + /// + private string splitCss(Split currSplit) + { + return (currSplit.SelSplitShape == SplitShapes.GRID ) ? "col-sm-12" : "col-sm-6"; + } + + /// + /// Calcola larghezza border descrizione split + /// + /// + private string splitContentCss(Split currSplit) + { + return (currSplit.SelSplitShape == SplitShapes.GRID) ? "col-sm-6" : "col-sm-12"; + } + /// /// 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"; + return (currStep == CompileStep.Template) ? "col-8 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"; } /// @@ -840,7 +915,7 @@ namespace WebWindowTest /// 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"; + return (currStep == CompileStep.Template) ? "col-4 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 diff --git a/WebWindowTest/WebWindowTest.csproj b/WebWindowTest/WebWindowTest.csproj index 8b86ea8..b72783d 100644 --- a/WebWindowTest/WebWindowTest.csproj +++ b/WebWindowTest/WebWindowTest.csproj @@ -18,4 +18,8 @@ + + + + diff --git a/WebWindowTest/Window.cs b/WebWindowTest/Window.cs index f3e35f3..cf19a29 100644 --- a/WebWindowTest/Window.cs +++ b/WebWindowTest/Window.cs @@ -5,9 +5,11 @@ using System.Collections.ObjectModel; using System.ComponentModel; using System.Drawing; using System.Runtime.Intrinsics.Arm; +using System.Xml.Linq; using System.Xml.Serialization; using WebWindowTest.Json; using static WebWindowTest.Json.WindowConst; +using static WebWindowTest.ParametriOpzioni; namespace WebWindowTest { @@ -16,7 +18,7 @@ namespace WebWindowTest { public event EventHandler OnPreview = delegate { }; - private String m_sProfilePath; + private string m_sProfilePath; public string sProfilePath { get @@ -29,6 +31,48 @@ namespace WebWindowTest } } + 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 { @@ -44,7 +88,7 @@ namespace WebWindowTest 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; @@ -53,7 +97,6 @@ namespace WebWindowTest internal string sSerialized() { return JsonConvert.SerializeObject(Serialize(), Formatting.Indented); - } internal void OnUpdatePreview(string sJwd) @@ -79,6 +122,39 @@ namespace WebWindowTest public abstract class Area { + // Conteggio dei macro elementi + private static int m_CounterGroup = 0; + public static void AddCounterGroup() + { + m_CounterGroup++; + } + //public static void DelCounterGroup() + //{ + // m_CounterGroup--; + //} + public static int nCounterGroup + { + get => m_CounterGroup; + set => m_CounterGroup = value; + } + + private int m_IdGroup; + public int IdGroup + { + get + { + return m_IdGroup; + } + + set + { + m_IdGroup = value; + } + } + public void SetIdGroup(int nIdGroup) + { + m_IdGroup = nIdGroup; + } protected Window m_ParentWindow; public Window ParentWindow @@ -163,7 +239,8 @@ namespace WebWindowTest // Aggiungo Area split di default Split SplitArea = Split.CreateSplit(this, SplitShapes.HORIZONTAL); // imposto i parametri di default - SplitArea.SetSplitQty(1); + SplitArea.SetSplitQtyHoriz(1); + SplitArea.SetSplitStartVert(false); // Aggiungo area AreaList.Add(SplitArea); // Creo le due aree Splitted @@ -337,6 +414,8 @@ namespace WebWindowTest break; } } + // salvo tipo Joint + Joints oldJointType = JointList[0].SelJointType; // aggiungo Joint m_JointList.Clear(); switch (SelShape) @@ -348,17 +427,21 @@ namespace WebWindowTest case Shapes.ARC: case Shapes.DOUBLEARC: { - JointList.Add(new Joint(this, 1, Joints.FULL_H)); - JointList.Add(new Joint(this, 2, Joints.FULL_H)); - JointList.Add(new Joint(this, 3, Joints.FULL_H)); - JointList.Add(new Joint(this, 4, Joints.FULL_H)); + JointList.Add(new Joint(this, 1, oldJointType)); + JointList.Add(new Joint(this, 2, oldJointType)); + JointList.Add(new Joint(this, 3, oldJointType)); + JointList.Add(new Joint(this, 4, oldJointType)); + //JointList.Add(new Joint(this, 1, Joints.FULL_H)); + //JointList.Add(new Joint(this, 2, Joints.FULL_H)); + //JointList.Add(new Joint(this, 3, Joints.FULL_H)); + //JointList.Add(new Joint(this, 4, Joints.FULL_H)); break; } case Shapes.ARC_FULL: { - JointList.Add(new Joint(this, 1, Joints.FULL_H)); - JointList.Add(new Joint(this, 2, Joints.FULL_H)); + JointList.Add(new Joint(this, 1, oldJointType)); + JointList.Add(new Joint(this, 2, oldJointType)); JointList.Add(new Joint(this, 3, Joints.ANGLED)); JointList.Add(new Joint(this, 4, Joints.ANGLED)); break; @@ -366,8 +449,8 @@ namespace WebWindowTest case Shapes.TRIANGLE: { - JointList.Add(new Joint(this, 1, Joints.FULL_H)); - JointList.Add(new Joint(this, 2, Joints.FULL_H)); + JointList.Add(new Joint(this, 1, oldJointType)); + JointList.Add(new Joint(this, 2, oldJointType)); JointList.Add(new Joint(this, 3, Joints.ANGLED)); break; } @@ -578,7 +661,10 @@ namespace WebWindowTest internal override JsonArea Serialize() { - JsonFrame JsonFrame = new JsonFrame(m_Shape, m_bBottomRail, m_nBottomRailQty); + Area.nCounterGroup = 0; + if (nCounterGroup < IdGroup) + Area.nCounterGroup = IdGroup; + JsonFrame JsonFrame = new JsonFrame(m_Shape, m_bBottomRail, m_nBottomRailQty, IdGroup); foreach (var Dimension in DimensionList) JsonFrame.DimensionList.Add(Dimension.Serialize()); foreach (var Joint in JointList) @@ -624,7 +710,7 @@ namespace WebWindowTest // aggiungo area Sash di default for (var SplitIndex = m_SashList.Count; SplitIndex <= value - 1; SplitIndex++) { - SashList.Add(new SashDimension(dNewDimension, true, this)); + SashList.Add(new SashDimension(dNewDimension, true, this, SplitIndex+1)); } } else if (value < m_SashList.Count) @@ -716,8 +802,9 @@ namespace WebWindowTest } // Aggiungo all'ultimo Splitted l'area di vetro - Fill newFill = new Fill(AreaList[1], ParentWindow); - newFill.SetFillType(FillTypes.GLASS); + Fill newFill = Fill.CreateFill(AreaList[1], FillTypes.GLASS); + //Fill newFill = new Fill(AreaList[1], ParentWindow); + //newFill.SetFillType(FillTypes.GLASS); newFill.SetAreaType(AreaTypes.FILL); AreaList[AreaList.Count - 1].AreaList.Add(newFill); } @@ -730,37 +817,6 @@ namespace WebWindowTest break; } } - //if (AreaList[AreaList.Count - 1].AreaList.Count == 0) - //{ - // if (ContentArea.Count > 0) - // { - // if (ContentArea[0] is Fill) - // { - // for (int SplitIndex = 0; SplitIndex <= AreaList.Count() - 1; SplitIndex++) - // { - // if (SplitIndex == 0) - // { - // AreaList[0].AreaList.Add(ContentArea[0]); - // } - // else - // { - // Fill f1 = (Fill)ContentArea[0]; - // AreaList[SplitIndex].AreaList.Add(Fill.CreateFill(AreaList[SplitIndex], f1.FillType)); - // } - // } - // } - // else - // { - // AreaList[0].AreaList.Add(ContentArea[0]); - // AreaList[1].AreaList.Add(ContentArea[0]); - // } - // } - // else - // { - // Fill f1 = (Fill)AreaList[AreaList.Count - 2].AreaList[0]; - // AreaList[AreaList.Count - 1].AreaList.Add(Fill.CreateFill(AreaList[AreaList.Count - 1], f1.FillType)); - // } - //} } } RefreshHardwareList(); @@ -786,7 +842,7 @@ namespace WebWindowTest dNewDimension = dLastDimension / (Qty + 1 - nSashQty); // aggiungo area Sash di default for (var SplitIndex = m_SashList.Count; SplitIndex <= Qty - 1; SplitIndex++) - SashList.Add(new SashDimension(dNewDimension, true, this)); + SashList.Add(new SashDimension(dNewDimension, true, this, SplitIndex+1)); } else if (Qty < m_SashList.Count) { @@ -1092,7 +1148,7 @@ namespace WebWindowTest internal void SetSelHardwareFromId(string sId) { - m_SelHardware = m_HardwareList.FirstOrDefault(x => x.sId == sId); + m_SelHardware = m_HardwareList.FirstOrDefault(x => x.sId == sId)?? new Hardware("","","","","",0,0); if (m_SelHardware == null) m_SelHardware = m_HardwareList[0]; } @@ -1125,8 +1181,8 @@ namespace WebWindowTest } } - private ObservableCollection m_HwdOptionList = new ObservableCollection(); - public ObservableCollection HwdOptionList + private ObservableCollection m_HwdOptionList = new ObservableCollection(); + public ObservableCollection HwdOptionList { get { @@ -1141,6 +1197,8 @@ namespace WebWindowTest internal static Sash CreateSash(Area Area) { Sash newSash = new Sash(Area, Area.ParentWindow); + AddCounterGroup(); + newSash.SetIdGroup(nCounterGroup); newSash.SetAreaType(AreaTypes.SASH); newSash.SetSashQty(1); newSash.SetOrientationSashType(OrientationSash.VERTICAL); @@ -1283,38 +1341,40 @@ namespace WebWindowTest 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) { Sash newSash = new Sash(newParentArea, m_ParentWindow); + AddCounterGroup(); + newSash.SetIdGroup(nCounterGroup); newSash.SetAreaType(AreaType); // Imposta la quantità di ante e definisce SashDimension di ogni anta ai valori di default newSash.SetSashQty(nSashQty); @@ -1346,7 +1406,9 @@ namespace WebWindowTest internal override JsonArea Serialize() { - JsonSash JsonSash = new JsonSash(m_bIsSashVertical, m_SashType, m_bSashBottomRail, m_nSashBottomRailQty, m_SelHardware.sId); + if (nCounterGroup < IdGroup) + Area.nCounterGroup = IdGroup; + JsonSash JsonSash = new JsonSash(m_bIsSashVertical, m_SashType, m_bSashBottomRail, m_nSashBottomRailQty, m_SelHardware.sId, IdGroup); foreach (var SashDimension in SashList) JsonSash.SashList.Add(SashDimension.Serialize()); foreach (var Joint in JointList) @@ -1359,62 +1421,81 @@ namespace WebWindowTest public class Split : Area { - public int nSplitQty + private bool m_bSplitStartVert = true; + public bool bSplitStartVert { get { - return m_SplitPositionList.Count > 0 ? m_SplitPositionList.Count - 1 : 0; + return m_bSplitStartVert; + } + set + { + m_bSplitStartVert = value; + m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); + } + } + internal void SetSplitStartVert(bool SplitStartVert) + { + bSplitStartVert = SplitStartVert; + } + public int nSplitQtyVert + { + get + { + return m_SplitVertList.Count > 0 ? m_SplitVertList.Count - 1 : 0; } set { // Ricalcolo dimensioni aggiungendo split - if (value > m_SplitPositionList.Count - 1) + if (value > m_SplitVertList.Count - 1) { // recupero larghezza ultimo double dLastDimension = 100; double dNewDimension = 100; - if (m_SplitPositionList.Count > 0) + if (m_SplitVertList.Count > 0) { - dLastDimension = m_SplitPositionList[m_SplitPositionList.Count - 1].dDimension; - dNewDimension = dLastDimension / (value + 1 - nSplitQty); - m_SplitPositionList[m_SplitPositionList.Count - 1].SetDimension(dNewDimension); + dLastDimension = m_SplitVertList[m_SplitVertList.Count - 1].dDimension; + dNewDimension = dLastDimension / (value + 1 - nSplitQtyVert); + m_SplitVertList[m_SplitVertList.Count - 1].SetDimension(dNewDimension); } else - dNewDimension = dLastDimension / (value + 1 - nSplitQty); + dNewDimension = dLastDimension / (value + 1 - nSplitQtyVert); // aggiungo area Split di default - for (var SplitIndex = m_SplitPositionList.Count; SplitIndex <= value; SplitIndex++) - SplitPositionList.Add(new SplitDimension(dNewDimension, true, this)); + for (var SplitIndex = m_SplitVertList.Count; SplitIndex <= value; SplitIndex++) + m_SplitVertList.Add(new SplitDimension(dNewDimension, true, this, true)); } - else if(value == 0) + else if (value == 0) { - SplitPositionList.RemoveAt(1); - SplitPositionList.RemoveAt(0); + m_SplitVertList.RemoveAt(1); + m_SplitVertList.RemoveAt(0); } // Ricalcolo dimensioni rimuovendo split else { double dLastDimension = 0; - for (var SplitIndex = m_SplitPositionList.Count - 1; SplitIndex >= value + 1; SplitIndex += -1) + for (var SplitIndex = m_SplitVertList.Count - 1; SplitIndex >= value + 1; SplitIndex += -1) { - dLastDimension += m_SplitPositionList[SplitIndex].dDimension; - SplitPositionList.RemoveAt(SplitIndex); + dLastDimension += m_SplitVertList[SplitIndex].dDimension; + m_SplitVertList.RemoveAt(SplitIndex); } - dLastDimension += m_SplitPositionList[SplitPositionList.Count - 1].dDimension; - SplitPositionList[SplitPositionList.Count - 1].SetDimension(dLastDimension); + dLastDimension += m_SplitVertList[m_SplitVertList.Count - 1].dDimension; + m_SplitVertList[m_SplitVertList.Count - 1].SetDimension(dLastDimension); } + // Controllo quanti split orizzontali ci sono + int nHoriz = m_SplitHorizList.Count > 0 ? m_SplitHorizList.Count : 1; // Se aggiungo split devo aggiungere vetro nell'area splitted aggiunta - for (var SplitIndex = AreaList.Count; SplitIndex <= SplitPositionList.Count - 1; SplitIndex++) + for (var SplitIndex = AreaList.Count; SplitIndex <= (m_SplitVertList.Count * nHoriz) - 1; SplitIndex++) { AreaList.Add(Splitted.CreateSplitted(this)); - Fill newFill = new Fill(AreaList.Last(), ParentWindow); - newFill.SetFillType(FillTypes.GLASS); + Fill newFill = Fill.CreateFill(AreaList[SplitIndex], FillTypes.GLASS); newFill.SetAreaType(AreaTypes.FILL); AreaList[AreaList.Count - 1].AreaList.Add(newFill); } // Se ho più di uno split, elimino l'ultimo if (AreaList.Count > 2) { - for (var SplitIndex = SplitPositionList.Count; SplitIndex <= AreaList.Count - 1; SplitIndex++) + int nAreaList = AreaList.Count - 1; + for (var SplitIndex = (m_SplitVertList.Count * nHoriz); SplitIndex <= nAreaList; SplitIndex++) { AreaList.Remove(AreaList[AreaList.Count - 1]); } @@ -1430,30 +1511,128 @@ namespace WebWindowTest m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); } } - - internal void SetSplitQty(int Qty, bool NotifyProperty = false) + internal void SetSplitQtyVert(int QtyVert, bool NotifyProperty = false) { - if (Qty > m_SplitPositionList.Count) + if (QtyVert > m_SplitVertList.Count) { // recupero larghezza ultimo double dLastDimension = 100; double dNewDimension = 100; - if (m_SplitPositionList.Count > 0) + if (m_SplitVertList.Count > 0) { - dLastDimension = m_SplitPositionList[m_SplitPositionList.Count - 1].dDimension; - dNewDimension = dLastDimension / (Qty + 1 - nSplitQty); - m_SplitPositionList[m_SplitPositionList.Count - 1].dDimension = dNewDimension; + dLastDimension = m_SplitVertList[m_SplitVertList.Count - 1].dDimension; + dNewDimension = dLastDimension / (QtyVert + 1 - nSplitQtyVert); + m_SplitVertList[m_SplitVertList.Count - 1].dDimension = dNewDimension; } else - dNewDimension = dLastDimension / (Qty + 1 - nSplitQty); + dNewDimension = dLastDimension / (QtyVert + 1 - nSplitQtyVert); // aggiungo area Split di default - for (var SplitIndex = m_SplitPositionList.Count; SplitIndex <= Qty; SplitIndex++) - SplitPositionList.Add(new SplitDimension(dNewDimension, true, this)); + for (var SplitIndex = m_SplitVertList.Count; SplitIndex <= QtyVert; SplitIndex++) + m_SplitVertList.Add(new SplitDimension(dNewDimension, true, this, true)); } - else if (Qty < m_SplitPositionList.Count) + else if (QtyVert < m_SplitVertList.Count) { - for (var SplitIndex = m_SplitPositionList.Count - 1; SplitIndex >= Qty; SplitIndex += -1) - SplitPositionList.RemoveAt(SplitIndex); + for (var SplitIndex = m_SplitVertList.Count - 1; SplitIndex >= QtyVert; SplitIndex += -1) + m_SplitVertList.RemoveAt(SplitIndex); + } + } + + public int nSplitQtyHoriz + { + get + { + return m_SplitHorizList.Count > 0 ? m_SplitHorizList.Count - 1 : 0; + } + set + { + // Ricalcolo dimensioni aggiungendo split + if (value > m_SplitHorizList.Count - 1) + { + // recupero larghezza ultimo + double dLastDimension = 100; + double dNewDimension = 100; + if (m_SplitHorizList.Count > 0) + { + dLastDimension = m_SplitHorizList[m_SplitHorizList.Count - 1].dDimension; + dNewDimension = dLastDimension / (value + 1 - nSplitQtyHoriz); + m_SplitHorizList[m_SplitHorizList.Count - 1].SetDimension(dNewDimension); + } + else + dNewDimension = dLastDimension / (value + 1 - nSplitQtyHoriz); + // aggiungo area Split di default + for (var SplitIndex = m_SplitHorizList.Count; SplitIndex <= value; SplitIndex++) + m_SplitHorizList.Add(new SplitDimension(dNewDimension, true, this, false)); + } + else if (value == 0) + { + m_SplitHorizList.RemoveAt(1); + m_SplitHorizList.RemoveAt(0); + } + // Ricalcolo dimensioni rimuovendo split + else + { + double dLastDimension = 0; + for (var SplitIndex = m_SplitHorizList.Count - 1; SplitIndex >= value + 1; SplitIndex += -1) + { + dLastDimension += m_SplitHorizList[SplitIndex].dDimension; + m_SplitHorizList.RemoveAt(SplitIndex); + } + dLastDimension += m_SplitHorizList[m_SplitHorizList.Count - 1].dDimension; + m_SplitHorizList[m_SplitHorizList.Count - 1].SetDimension(dLastDimension); + } + // Controllo quanti split verticali ci sono + int nVert = m_SplitVertList.Count > 0 ? m_SplitVertList.Count : 1; + // Se aggiungo split devo aggiungere vetro nell'area splitted aggiunta + for (var SplitIndex = AreaList.Count; SplitIndex <= (m_SplitHorizList.Count * nVert) - 1; SplitIndex++) + { + AreaList.Add(Splitted.CreateSplitted(this)); + Fill newFill = Fill.CreateFill(AreaList[SplitIndex], FillTypes.GLASS); + newFill.SetAreaType(AreaTypes.FILL); + AreaList[AreaList.Count - 1].AreaList.Add(newFill); + } + // Se ho più di uno split, elimino l'ultimo + if (AreaList.Count > 2) + { + int nAreaList = AreaList.Count - 1; + for (var SplitIndex = (m_SplitHorizList.Count * nVert); SplitIndex <= nAreaList; SplitIndex++) + { + AreaList.Remove(AreaList[AreaList.Count - 1]); + } + } + // Se elimino l'unico split presente + else + { + Splitted s = (Splitted)AreaList[0]; + s.SetParentArea(ParentArea); + ParentArea.AreaList.Add(s); + ParentArea.AreaList.Remove(this); + } + m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); + } + } + internal void SetSplitQtyHoriz(int QtyHoriz, bool NotifyProperty = false) + { + if (QtyHoriz > m_SplitHorizList.Count) + { + // recupero larghezza ultimo + double dLastDimension = 100; + double dNewDimension = 100; + if (m_SplitHorizList.Count > 0) + { + dLastDimension = m_SplitHorizList[m_SplitHorizList.Count - 1].dDimension; + dNewDimension = dLastDimension / (QtyHoriz + 1 - nSplitQtyHoriz); + m_SplitHorizList[m_SplitHorizList.Count - 1].dDimension = dNewDimension; + } + else + dNewDimension = dLastDimension / (QtyHoriz + 1 - nSplitQtyHoriz); + // aggiungo area Split di default + for (var SplitIndex = m_SplitHorizList.Count; SplitIndex <= QtyHoriz; SplitIndex++) + m_SplitHorizList.Add(new SplitDimension(dNewDimension, true, this, false)); + } + else if (QtyHoriz < m_SplitHorizList.Count) + { + for (var SplitIndex = m_SplitHorizList.Count - 1; SplitIndex >= QtyHoriz; SplitIndex += -1) + m_SplitHorizList.RemoveAt(SplitIndex); } } @@ -1482,6 +1661,39 @@ namespace WebWindowTest set { m_SelSplitShape = (SplitShapes)IdNameStruct.IdFromInd(value, m_SplitShapeList); + // Cancello elementi nello split e azzero quantità orizzontale e verticale + AreaList.Clear(); + SetSplitQtyVert(0); + SetSplitQtyHoriz(0); + if (m_SelSplitShape == SplitShapes.VERTICAL) + { + // Inserisco valori di default + SetSplitQtyVert(1); + SetSplitStartVert(true); + } + else if (m_SelSplitShape == SplitShapes.HORIZONTAL) + { + // Inserisco valori di default + SetSplitQtyHoriz(1); + SetSplitStartVert(false); + } + else + { + // Inserisco valori di default + SetSplitQtyVert(1); + SetSplitQtyHoriz(1); + SetSplitStartVert(true); + } + // Aggiungo area Splitted e vetro + int nVert = m_SplitVertList.Count > 0 ? m_SplitVertList.Count : 1; + int nHoriz = m_SplitHorizList.Count > 0 ? m_SplitHorizList.Count : 1; + for (var SplitIndex = 0; SplitIndex <= (nVert * nHoriz) - 1; SplitIndex++) + { + AreaList.Add(Splitted.CreateSplitted(this)); + Fill newFill = Fill.CreateFill(AreaList[SplitIndex], FillTypes.GLASS); + newFill.SetAreaType(AreaTypes.FILL); + AreaList[SplitIndex].AreaList.Add(newFill); + } m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); } } @@ -1519,6 +1731,32 @@ namespace WebWindowTest } } + private ObservableCollection m_SplitVertList = new ObservableCollection(); + public ObservableCollection SplitVertList + { + get + { + return m_SplitVertList; + } + set + { + m_SplitVertList = value; + } + } + + private ObservableCollection m_SplitHorizList = new ObservableCollection(); + public ObservableCollection SplitHorizList + { + get + { + return m_SplitHorizList; + } + set + { + m_SplitHorizList = value; + } + } + public Split(Area ParentArea, Window ParentWindow) : base(ParentArea, ParentWindow) { } @@ -1526,6 +1764,8 @@ namespace WebWindowTest internal static Split CreateSplit(Area Area, SplitShapes SplitShape) { Split Split = new Split(Area, Area.ParentWindow); + AddCounterGroup(); + Split.SetIdGroup(nCounterGroup); Split.SetAreaType(AreaTypes.SPLIT); Split.SetSplitShape(SplitShape, true); return Split; @@ -1534,7 +1774,11 @@ namespace WebWindowTest public override Split Copy(Area newParentArea) { Split newSplit = new Split(newParentArea, ParentWindow); - newSplit.SetSplitQty(nSplitQty); + AddCounterGroup(); + newSplit.SetIdGroup(nCounterGroup); + newSplit.SetSplitStartVert(bSplitStartVert); + newSplit.SetSplitQtyVert(nSplitQtyVert); + newSplit.SetSplitQtyHoriz(nSplitQtyHoriz); newSplit.SetSplitShape(SelSplitShape, true); newSplit.SetAreaType(AreaType); foreach(var item in AreaList) @@ -1547,9 +1791,16 @@ namespace WebWindowTest internal override JsonArea Serialize() { - JsonSplit JsonSplit = new JsonSplit(m_SelSplitShape); - foreach (var SplitPosition in m_SplitPositionList) - JsonSplit.SplitPositionList.Add(SplitPosition.Serialize()); + if (nCounterGroup < IdGroup) + Area.nCounterGroup = IdGroup; + JsonSplit JsonSplit = new JsonSplit(m_SelSplitShape, IdGroup); + //foreach (var SplitPosition in m_SplitPositionList) + // JsonSplit.SplitPositionList.Add(SplitPosition.Serialize()); + JsonSplit.SplitStartVert = bSplitStartVert; + foreach (var SplitVert in m_SplitVertList) + JsonSplit.SplitVertList.Add(SplitVert.Serialize()); + foreach (var SplitHoriz in m_SplitHorizList) + JsonSplit.SplitHorizList.Add(SplitHoriz.Serialize()); foreach (var Area in AreaList) JsonSplit.AreaList.Add(Area.Serialize()); return JsonSplit; @@ -1558,7 +1809,6 @@ namespace WebWindowTest public class Splitted : Area { - public Splitted(Area ParentArea, Window ParentWindow) : base(ParentArea, ParentWindow) { } @@ -1566,6 +1816,8 @@ namespace WebWindowTest internal static Splitted CreateSplitted(Area ParentArea) { Splitted Splitted = new Splitted(ParentArea, ParentArea.ParentWindow); + AddCounterGroup(); + Splitted.SetIdGroup(nCounterGroup); Splitted.SetAreaType(AreaTypes.SPLITTED); return Splitted; } @@ -1573,6 +1825,8 @@ namespace WebWindowTest public override Splitted Copy(Area newParentArea) { Splitted newSplitted = new Splitted(newParentArea, ParentWindow); + AddCounterGroup(); + newSplitted.SetIdGroup(nCounterGroup); newSplitted.SetAreaType(AreaType); foreach (var item in AreaList) { @@ -1584,7 +1838,9 @@ namespace WebWindowTest internal override JsonArea Serialize() { - JsonSplitted JsonSplitted = new JsonSplitted(); + if (nCounterGroup < IdGroup) + Area.nCounterGroup = IdGroup; + JsonSplitted JsonSplitted = new JsonSplitted(IdGroup); foreach (var Area in AreaList) JsonSplitted.AreaList.Add(Area.Serialize()); return JsonSplitted; @@ -1649,6 +1905,8 @@ namespace WebWindowTest internal static Fill CreateFill(Area AreaParent, FillTypes FillType) { Fill Fill = new Fill(AreaParent, AreaParent.ParentWindow); + AddCounterGroup(); + Fill.SetIdGroup(nCounterGroup); Fill.SetAreaType(AreaTypes.FILL); Fill.SetFillType(FillType); return Fill; @@ -1657,6 +1915,8 @@ namespace WebWindowTest public override Fill Copy(Area newParentArea) { Fill newFill = new Fill(newParentArea, m_ParentWindow); + AddCounterGroup(); + newFill.SetIdGroup(nCounterGroup); newFill.SetFillType(SelFillType); newFill.SetAreaType(AreaType); return newFill; @@ -1664,7 +1924,9 @@ namespace WebWindowTest internal override JsonArea Serialize() { - JsonFill JsonFill = new JsonFill(FillType); + if (nCounterGroup < IdGroup) + Area.nCounterGroup = IdGroup; + JsonFill JsonFill = new JsonFill(FillType, IdGroup); foreach (var Area in AreaList) JsonFill.AreaList.Add(Area.Serialize()); return JsonFill; @@ -1681,6 +1943,7 @@ namespace WebWindowTest return m_ParentArea; } } + private int m_nIndex; public int nIndex { @@ -1831,7 +2094,7 @@ namespace WebWindowTest } } - public class AGBOption + public partial class ParametriOpzioni { public enum HDWOPTIONTYPES : int { @@ -1840,7 +2103,7 @@ namespace WebWindowTest COMBO = 3 } - private HDWOPTIONTYPES m_Type; + protected HDWOPTIONTYPES m_Type; public HDWOPTIONTYPES Type { get @@ -1867,6 +2130,25 @@ namespace WebWindowTest } } + private Visibility m_OptVisibility; + public Visibility OptVisibility + { + get + { + return m_OptVisibility; + } + } + + public ParametriOpzioni(ParametriOpzioniParametri HdwOptionParam) + { + m_sName = HdwOptionParam.NomeParametro; + m_sDescription = HdwOptionParam.DescrizioneParametro; + m_OptVisibility = Visibility.VISIBLE; // If(HdwOptionParam.Visible.ToLower = "true", Visibility.Visible, Visibility.Collapsed) + } + } + + public class AGBOptionCombo : ParametriOpzioni + { private List m_ValueList = new List(); public List ValueList { @@ -1889,30 +2171,13 @@ namespace WebWindowTest } } - 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 @@ -1942,6 +2207,28 @@ namespace WebWindowTest } } + 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 @@ -2019,6 +2306,15 @@ namespace WebWindowTest { // reference private Sash m_Parent; + + private int m_nSashId; + public int nSashId + { + get + { + return m_nSashId; + } + } private bool m_bIsRelative = false; public bool bIsRelative @@ -2197,17 +2493,18 @@ namespace WebWindowTest public SashDimension Copy() { - SashDimension newSashDim = new SashDimension(dDimension, bIsRelative, m_Parent); + SashDimension newSashDim = new SashDimension(dDimension, bIsRelative, m_Parent, m_nSashId); newSashDim.SetOpeningType(SelOpeningType); newSashDim.SetHasHandle(bHasHandle); return newSashDim; } - public SashDimension(double dDimension, bool bIsRelative, Sash Parent) + public SashDimension(double dDimension, bool bIsRelative, Sash Parent, int nSashId) { m_dDimension = dDimension; m_bIsRelative = bIsRelative; m_Parent = Parent; + m_nSashId = nSashId; // assengno maniglia if (Parent.SashList.Count == 0 || !Parent.SashList.Any(x => x.bHasHandle)) m_bHasHandle = true; @@ -2232,13 +2529,13 @@ namespace WebWindowTest case Openings.TILTTURN_LEFT: { - SetOpeningType(Openings.TILTTURN_RIGHT); + SetOpeningType(Openings.TURNONLY_RIGHT); break; } case Openings.TILTTURN_RIGHT: { - SetOpeningType(Openings.TILTTURN_LEFT); + SetOpeningType(Openings.TURNONLY_LEFT); break; } @@ -2285,7 +2582,7 @@ namespace WebWindowTest internal JsonSashDimension Serialize() { - JsonSashDimension JsonSashDimension = new JsonSashDimension(OpeningType, m_bHasHandle, m_dDimension); + JsonSashDimension JsonSashDimension = new JsonSashDimension(OpeningType, m_bHasHandle, m_dDimension, m_nSashId); return JsonSashDimension; } } @@ -2308,6 +2605,20 @@ namespace WebWindowTest m_bIsRelative = value; } + private bool m_bIsVertListDim = false; + public bool bIsVertListDim + { + get + { + return m_bIsVertListDim; + } + } + internal void SetIsVertListDim(bool value) + { + m_bIsVertListDim = value; + } + + private double m_dDimension; public double dDimension { @@ -2323,8 +2634,13 @@ namespace WebWindowTest // se sono in percentuale if (m_bIsRelative) { + List RelativeDimList = new List(); + if (bIsVertListDim) + RelativeDimList = m_Parent.SplitVertList.Where(x => x.bIsRelative).ToList(); + else + RelativeDimList = m_Parent.SplitHorizList.Where(x => x.bIsRelative).ToList(); // verifico se ci sono assoluti - List RelativeDimList = m_Parent.SplitPositionList.Where(x => x.bIsRelative).ToList(); + //List RelativeDimList = m_Parent.SplitPositionList.Where(x => x.bIsRelative).ToList(); if (RelativeDimList.Count > 0) { if (m_Parent.bIsPercentage) @@ -2395,14 +2711,15 @@ namespace WebWindowTest public SplitDimension Copy() { - SplitDimension newSplitDim = new SplitDimension(dDimension, bIsRelative, m_Parent); + SplitDimension newSplitDim = new SplitDimension(dDimension, bIsRelative, m_Parent, bIsVertListDim); return newSplitDim; } - public SplitDimension(double dDimension, bool bIsRelative, Split Parent) + public SplitDimension(double dDimension, bool bIsRelative, Split Parent, bool IsVertList) { m_dDimension = dDimension; m_bIsRelative = bIsRelative; m_Parent = Parent; + m_bIsVertListDim = IsVertList; } internal JsonSplitDimension Serialize()