diff --git a/Test.UI/Hardware/Setup.json b/Test.UI/Hardware/Setup.json index 4a81ba4..d587146 100644 --- a/Test.UI/Hardware/Setup.json +++ b/Test.UI/Hardware/Setup.json @@ -1,371 +1,371 @@ [ { - "Description": "Rect_Sash_Compl", - "FamilyName": "Rect", - "Id": "000547", - "OpeningType": "CO", - "SashPosition": 1, - "SashQty": 2, - "Shape": "Rectangular" + "id": "000548", + "familyName": "Rect", + "description": "Rect_DoubleSash", + "openingType": "TiltTurn", + "shape": "Rectangular", + "sashQty": 2, + "sashPosition": 1 }, { - "Description": "Vasistas", - "FamilyName": "Vasistas", - "Id": "000573", - "OpeningType": "VA", - "SashPosition": 1, - "SashQty": 1, - "Shape": "Rectangular" + "id": "000546", + "familyName": "Trap", + "description": "Trap_Sash", + "openingType": "TiltTurn", + "shape": "Trapezoidal", + "sashQty": 1, + "sashPosition": 1 }, { - "Description": "Profilo78_Rect_TripleSash_HiddenHinges", - "FamilyName": "Profilo78", - "Id": "000561", - "OpeningType": "AR", - "SashPosition": 1, - "SashQty": 3, - "Shape": "Rectangular" + "id": "000547", + "familyName": "Rect", + "description": "Rect_Sash_Compl", + "openingType": "ComplanarSlide", + "shape": "Rectangular", + "sashQty": 2, + "sashPosition": 1 }, { - "Description": "Profilo78_TurnOnly_Rect_DoubleSash", - "FamilyName": "Profilo78", - "Id": "000563", - "OpeningType": "AB", - "SashPosition": 1, - "SashQty": 2, - "Shape": "Rectangular" + "id": "000561", + "familyName": "Profilo78", + "description": "Profilo78_Rect_TripleSash_HiddenHinges", + "openingType": "TiltTurn", + "shape": "Rectangular", + "sashQty": 3, + "sashPosition": 1 }, { - "Description": "Profilo78_TurnOnly_Rect_TripleSash", - "FamilyName": "Profilo78", - "Id": "000564", - "OpeningType": "AB", - "SashPosition": 2, - "SashQty": 3, - "Shape": "Rectangular" + "id": "000563", + "familyName": "Profilo78", + "description": "Profilo78_TurnOnly_Rect_DoubleSash", + "openingType": "TurnOnly", + "shape": "Rectangular", + "sashQty": 2, + "sashPosition": 1 }, { - "Description": "SegArc_2S_TurnOnly", - "FamilyName": "SegArc", - "Id": "000603", - "OpeningType": "AB", - "SashPosition": 1, - "SashQty": 2, - "Shape": "Arc" + "id": "000564", + "familyName": "Profilo78", + "description": "Profilo78_TurnOnly_Rect_TripleSash", + "openingType": "TurnOnly", + "shape": "Rectangular", + "sashQty": 3, + "sashPosition": 2 }, { - "Description": "Arc_2S_TurnOnly", - "FamilyName": "Arc", - "Id": "000602", - "OpeningType": "AB", - "SashPosition": 1, - "SashQty": 2, - "Shape": "FullArc" + "id": "000603", + "familyName": "SegArc", + "description": "SegArc_2S_TurnOnly", + "openingType": "TurnOnly", + "shape": "Arc", + "sashQty": 2, + "sashPosition": 1 }, { - "Description": "SegArc_1S_TurnOnly", - "FamilyName": "SegArc", - "Id": "000601", - "OpeningType": "AB", - "SashPosition": 1, - "SashQty": 1, - "Shape": "Arc" + "id": "000602", + "familyName": "Arc", + "description": "Arc_2S_TurnOnly", + "openingType": "TurnOnly", + "shape": "FullArc", + "sashQty": 2, + "sashPosition": 1 }, { - "Description": "SemiArc_1S", - "FamilyName": "SemiArc", - "Id": "000610", - "OpeningType": "AR", - "SashPosition": 1, - "SashQty": 1, - "Shape": "SemiFullArc" + "id": "000601", + "familyName": "SegArc", + "description": "SegArc_1S_TurnOnly", + "openingType": "TurnOnly", + "shape": "Arc", + "sashQty": 1, + "sashPosition": 1 }, { - "Description": "SemiSegArc_S1", - "FamilyName": "SemiSegArc", - "Id": "000611", - "OpeningType": "AR", - "SashPosition": 1, - "SashQty": 1, - "Shape": "SemiArc" + "id": "000610", + "familyName": "SemiArc", + "description": "SemiArc_1S", + "openingType": "TiltTurn", + "shape": "SemiFullArc", + "sashQty": 1, + "sashPosition": 1 }, { - "Description": "Arc_1S", - "FamilyName": "Arc", - "Id": "000596", - "OpeningType": "AR", - "SashPosition": 1, - "SashQty": 1, - "Shape": "FullArc" + "id": "000611", + "familyName": "SemiSegArc", + "description": "SemiSegArc_S1", + "openingType": "TiltTurn", + "shape": "SemiArc", + "sashQty": 1, + "sashPosition": 1 }, { - "Description": "SegArc_2S", - "FamilyName": "SegArc", - "Id": "000599", - "OpeningType": "AR", - "SashPosition": 1, - "SashQty": 2, - "Shape": "Arc" + "id": "000596", + "familyName": "Arc", + "description": "Arc_1S", + "openingType": "TiltTurn", + "shape": "FullArc", + "sashQty": 1, + "sashPosition": 1 }, { - "Description": "SegArc_1S", - "FamilyName": "SegArc", - "Id": "000597", - "OpeningType": "AR", - "SashPosition": 1, - "SashQty": 1, - "Shape": "Arc" + "id": "000599", + "familyName": "SegArc", + "description": "SegArc_2S", + "openingType": "TiltTurn", + "shape": "Arc", + "sashQty": 2, + "sashPosition": 1 }, { - "Description": "Test aria 4", - "FamilyName": "Test aria 4", - "Id": "000609", - "OpeningType": "AR", - "SashPosition": 1, - "SashQty": 2, - "Shape": "Arc" + "id": "000597", + "familyName": "SegArc", + "description": "SegArc_1S", + "openingType": "TiltTurn", + "shape": "Arc", + "sashQty": 1, + "sashPosition": 1 }, { - "Description": "Arc_2S", - "FamilyName": "Arc", - "Id": "000598", - "OpeningType": "AR", - "SashPosition": 1, - "SashQty": 2, - "Shape": "FullArc" + "id": "000598", + "familyName": "Arc", + "description": "Arc_2S", + "openingType": "TiltTurn", + "shape": "FullArc", + "sashQty": 2, + "sashPosition": 1 }, { - "Description": "Arc_1S_TurnOnly", - "FamilyName": "Arc", - "Id": "000600", - "OpeningType": "AB", - "SashPosition": 1, - "SashQty": 1, - "Shape": "FullArc" + "id": "000600", + "familyName": "Arc", + "description": "Arc_1S_TurnOnly", + "openingType": "TurnOnly", + "shape": "FullArc", + "sashQty": 1, + "sashPosition": 1 }, { - "Description": "Trap_S1_TurnOnly", - "FamilyName": "Trap", - "Id": "000606", - "OpeningType": "AB", - "SashPosition": 1, - "SashQty": 1, - "Shape": "Trapezoidal" + "id": "000606", + "familyName": "Trap", + "description": "Trap_S1_TurnOnly", + "openingType": "TurnOnly", + "shape": "Trapezoidal", + "sashQty": 1, + "sashPosition": 1 }, { - "Description": "Trap_S2", - "FamilyName": "Trap", - "Id": "000605", - "OpeningType": "AR", - "SashPosition": 1, - "SashQty": 2, - "Shape": "Trapezoidal" + "id": "000605", + "familyName": "Trap", + "description": "Trap_S2", + "openingType": "TiltTurn", + "shape": "Trapezoidal", + "sashQty": 2, + "sashPosition": 1 }, { - "Description": "Trap_S2_TurnOnly", - "FamilyName": "Trap", - "Id": "000607", - "OpeningType": "AB", - "SashPosition": 1, - "SashQty": 2, - "Shape": "Trapezoidal" + "id": "000607", + "familyName": "Trap", + "description": "Trap_S2_TurnOnly", + "openingType": "TurnOnly", + "shape": "Trapezoidal", + "sashQty": 2, + "sashPosition": 1 }, { - "Description": "Trap_S1", - "FamilyName": "Trap", - "Id": "000604", - "OpeningType": "AR", - "SashPosition": 1, - "SashQty": 1, - "Shape": "Trapezoidal" + "id": "000604", + "familyName": "Trap", + "description": "Trap_S1", + "openingType": "TiltTurn", + "shape": "Trapezoidal", + "sashQty": 1, + "sashPosition": 1 }, { - "Description": "Slide_quadruple", - "FamilyName": "Slide", - "Id": "000595", - "OpeningType": "AS", - "SashPosition": 2, - "SashQty": 4, - "Shape": "Rectangular" + "id": "000595", + "familyName": "Slide", + "description": "Slide_quadruple", + "openingType": "LiftSlide", + "shape": "Rectangular", + "sashQty": 4, + "sashPosition": 2 }, { - "Description": "Slide_2S", - "FamilyName": "Slide", - "Id": "000592", - "OpeningType": "AS", - "SashPosition": 1, - "SashQty": 2, - "Shape": "Rectangular" + "id": "000592", + "familyName": "Slide", + "description": "Slide_2S", + "openingType": "LiftSlide", + "shape": "Rectangular", + "sashQty": 2, + "sashPosition": 1 }, { - "Description": "Slide_4S", - "FamilyName": "Slide", - "Id": "000594", - "OpeningType": "AS", - "SashPosition": 2, - "SashQty": 4, - "Shape": "Rectangular" + "id": "000594", + "familyName": "Slide", + "description": "Slide_4S", + "openingType": "LiftSlide", + "shape": "Rectangular", + "sashQty": 4, + "sashPosition": 2 }, { - "Description": "Slide_double", - "FamilyName": "Slide", - "Id": "000593", - "OpeningType": "AS", - "SashPosition": 1, - "SashQty": 2, - "Shape": "Rectangular" + "id": "000593", + "familyName": "Slide", + "description": "Slide_double", + "openingType": "LiftSlide", + "shape": "Rectangular", + "sashQty": 2, + "sashPosition": 1 }, { - "Description": "Profilo78_TurnOnly_Rect_QuadrupleSash", - "FamilyName": "Profilo78", - "Id": "000575", - "OpeningType": "AB", - "SashPosition": 2, - "SashQty": 4, - "Shape": "Rectangular" + "id": "000575", + "familyName": "Profilo78", + "description": "Profilo78_TurnOnly_Rect_QuadrupleSash", + "openingType": "TurnOnly", + "shape": "Rectangular", + "sashQty": 4, + "sashPosition": 2 }, { - "Description": "Profilo78_Rect_Sash", - "FamilyName": "Profilo78", - "Id": "000558", - "OpeningType": "AR", - "SashPosition": 1, - "SashQty": 1, - "Shape": "Rectangular" + "id": "000558", + "familyName": "Profilo78", + "description": "Profilo78_Rect_Sash", + "openingType": "TiltTurn", + "shape": "Rectangular", + "sashQty": 1, + "sashPosition": 1 }, { - "Description": "Profilo78_Rect_DoubleSash", - "FamilyName": "Profilo78", - "Id": "000559", - "OpeningType": "AR", - "SashPosition": 1, - "SashQty": 2, - "Shape": "Rectangular" + "id": "000559", + "familyName": "Profilo78", + "description": "Profilo78_Rect_DoubleSash", + "openingType": "TiltTurn", + "shape": "Rectangular", + "sashQty": 2, + "sashPosition": 1 }, { - "Description": "Profilo78_TurnOnly_Rect_TripleSash_CenterHandle", - "FamilyName": "Profilo78", - "Id": "000566", - "OpeningType": "AB", - "SashPosition": 2, - "SashQty": 3, - "Shape": "Rectangular" + "id": "000566", + "familyName": "Profilo78", + "description": "Profilo78_TurnOnly_Rect_TripleSash_CenterHandle", + "openingType": "TurnOnly", + "shape": "Rectangular", + "sashQty": 3, + "sashPosition": 2 }, { - "Description": "Profilo78_TurnOnly_Rect_TripleSash_SideHandle", - "FamilyName": "Profilo78", - "Id": "000565", - "OpeningType": "AB", - "SashPosition": 1, - "SashQty": 3, - "Shape": "Rectangular" + "id": "000565", + "familyName": "Profilo78", + "description": "Profilo78_TurnOnly_Rect_TripleSash_SideHandle", + "openingType": "TurnOnly", + "shape": "Rectangular", + "sashQty": 3, + "sashPosition": 1 }, { - "Description": "Profilo78_Rect_Sash", - "FamilyName": "Profilo78", - "Id": "000562", - "OpeningType": "AB", - "SashPosition": 1, - "SashQty": 1, - "Shape": "Rectangular" + "id": "000562", + "familyName": "Profilo78", + "description": "Profilo78_Rect_Sash", + "openingType": "TurnOnly", + "shape": "Rectangular", + "sashQty": 1, + "sashPosition": 1 }, { - "Description": "Profilo78_Rect_TripleSash", - "FamilyName": "Profilo78", - "Id": "000560", - "OpeningType": "AR", - "SashPosition": 1, - "SashQty": 3, - "Shape": "Rectangular" + "id": "000560", + "familyName": "Profilo78", + "description": "Profilo78_Rect_TripleSash", + "openingType": "TiltTurn", + "shape": "Rectangular", + "sashQty": 3, + "sashPosition": 1 }, { - "Description": "Rect_DoubleSash_4", - "FamilyName": "Rect", - "Id": "000550", - "OpeningType": "AR", - "SashPosition": 1, - "SashQty": 2, - "Shape": "Rectangular" + "id": "000550", + "familyName": "Rect", + "description": "Rect_DoubleSash_4", + "openingType": "TiltTurn", + "shape": "Rectangular", + "sashQty": 2, + "sashPosition": 1 }, { - "Description": "Rect_DoubleSashStrana", - "FamilyName": "Rect", - "Id": "000552", - "OpeningType": "AR", - "SashPosition": 1, - "SashQty": 3, - "Shape": "Rectangular" + "id": "000552", + "familyName": "Rect", + "description": "Rect_DoubleSashStrana", + "openingType": "TiltTurn", + "shape": "Rectangular", + "sashQty": 3, + "sashPosition": 1 }, { - "Description": "Rect_DoubleSash", - "FamilyName": "Rect", - "Id": "000549", - "OpeningType": "AR", - "SashPosition": 1, - "SashQty": 2, - "Shape": "Rectangular" + "id": "000549", + "familyName": "Rect", + "description": "Rect_DoubleSash", + "openingType": "TiltTurn", + "shape": "Rectangular", + "sashQty": 2, + "sashPosition": 1 }, { - "Description": "Round_Sash", - "FamilyName": "Round", - "Id": "000555", - "OpeningType": "BI", - "SashPosition": 1, - "SashQty": 1, - "Shape": "Circular" + "id": "000555", + "familyName": "Round", + "description": "Round_Sash", + "openingType": "Pivot", + "shape": "Circular", + "sashQty": 1, + "sashPosition": 1 }, { - "Description": "Rect_Sash_Bilico", - "FamilyName": "Rect", - "Id": "000556", - "OpeningType": "BI", - "SashPosition": 1, - "SashQty": 1, - "Shape": "Rectangular" + "id": "000556", + "familyName": "Rect", + "description": "Rect_Sash_Bilico", + "openingType": "Pivot", + "shape": "Rectangular", + "sashQty": 1, + "sashPosition": 1 }, { - "Description": "Rect_QuadrupolSash_Bandiera", - "FamilyName": "Rect", - "Id": "000554", - "OpeningType": "AB", - "SashPosition": 2, - "SashQty": 4, - "Shape": "Rectangular" + "id": "000554", + "familyName": "Rect", + "description": "Rect_QuadrupolSash_Bandiera", + "openingType": "TurnOnly", + "shape": "Rectangular", + "sashQty": 4, + "sashPosition": 2 }, { - "Description": "Rect_Sash_Bandiera", - "FamilyName": "Rect", - "Id": "000551", - "OpeningType": "AB", - "SashPosition": 1, - "SashQty": 1, - "Shape": "Rectangular" + "id": "000551", + "familyName": "Rect", + "description": "Rect_Sash_Bandiera", + "openingType": "TurnOnly", + "shape": "Rectangular", + "sashQty": 1, + "sashPosition": 1 }, { - "Description": "Rect_Sash", - "FamilyName": "Rect", - "Id": "000544", - "OpeningType": "AR", - "SashPosition": 1, - "SashQty": 1, - "Shape": "Rectangular" + "id": "000544", + "familyName": "Rect", + "description": "Rect_Sash", + "openingType": "TiltTurn", + "shape": "Rectangular", + "sashQty": 1, + "sashPosition": 1 }, { - "Description": "Rect_TripleSash", - "FamilyName": "Rect", - "Id": "000553", - "OpeningType": "AR", - "SashPosition": 1, - "SashQty": 3, - "Shape": "Rectangular" + "id": "000553", + "familyName": "Rect", + "description": "Rect_TripleSash", + "openingType": "TiltTurn", + "shape": "Rectangular", + "sashQty": 3, + "sashPosition": 1 }, { - "Description": "Rect_Sash_4", - "FamilyName": "Rect", - "Id": "000545", - "OpeningType": "AR", - "SashPosition": 1, - "SashQty": 1, - "Shape": "Rectangular" + "id": "000545", + "familyName": "Rect", + "description": "Rect_Sash_4", + "openingType": "TiltTurn", + "shape": "Rectangular", + "sashQty": 1, + "sashPosition": 1 } ] \ No newline at end of file diff --git a/WebAedificaConfigurator/WebAedificaConfigurator.csproj b/WebAedificaConfigurator/WebAedificaConfigurator.csproj index 2b08dd6..127bb1f 100644 --- a/WebAedificaConfigurator/WebAedificaConfigurator.csproj +++ b/WebAedificaConfigurator/WebAedificaConfigurator.csproj @@ -12,7 +12,7 @@ - + diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index c3ecb29..13688c3 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.818 + 2.7.10.918 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -18,7 +18,7 @@ - + @@ -132,6 +132,11 @@ + + + + + diff --git a/WebWindowComplex/Window.cs b/WebWindowComplex/Window.cs index d7bacff..614ff83 100644 --- a/WebWindowComplex/Window.cs +++ b/WebWindowComplex/Window.cs @@ -273,7 +273,7 @@ namespace WebWindowComplex Sash SashArea = Sash.CreateSash(ParentArea); SashArea.SelFamilyHardware = Sash.s_FamilyHardwareList.First(); SashArea.RefreshHardwareList(); - if(SashArea.HardwareList.Count == 0) + if (SashArea.HardwareList.Count == 0) { SashArea.Remove(); return true; @@ -1172,9 +1172,9 @@ namespace WebWindowComplex internal void SetSelHardwareFromId(string sId) { if (m_HardwareList.Count == 0) - m_SelHardware = m_HardwareCompleteList.FirstOrDefault(x => x.Id.Equals(sId)) ?? new Hardware("", "", "", "", "", 0, 0); + m_SelHardware = m_HardwareCompleteList.FirstOrDefault(x => x.Id.Equals(sId)) ?? new Hardware("", "", "", Enums.OpeningTypes.Null, "", 0, 0); else - m_SelHardware = m_HardwareList.FirstOrDefault(x => x.Id.Equals(sId)) ?? new Hardware("", "", "", "", "", 0, 0); + m_SelHardware = m_HardwareList.FirstOrDefault(x => x.Id.Equals(sId)) ?? new Hardware("", "", "", Enums.OpeningTypes.Null, "", 0, 0); if (m_SelHardware == null) m_SelHardware = m_HardwareList[0]; //SelFamilyHardware = m_SelHardware.FamilyName; @@ -1188,7 +1188,7 @@ namespace WebWindowComplex } set { - m_SelHardware = m_HardwareList.FirstOrDefault(x => !string.IsNullOrEmpty(value) && x.Id.Equals(value)) ?? new Hardware("", "", "", "", "", 0, 0); + m_SelHardware = m_HardwareList.FirstOrDefault(x => !string.IsNullOrEmpty(value) && x.Id.Equals(value)) ?? new Hardware("", "", "", Enums.OpeningTypes.Null, "", 0, 0); ParentWindow.OnUpdatePreview(ParentWindow.sSerialized()); } } @@ -1238,109 +1238,75 @@ namespace WebWindowComplex return "Rectangular"; } - internal OpeningTypes GetOpeningType(Openings OpeningType) + internal Enums.OpeningTypes GetOpeningType(Openings OpeningType) { switch (OpeningType) { case Openings.TURNONLY_LEFT: case Openings.TURNONLY_RIGHT: { - return OpeningTypes.TURNONLY; + return Enums.OpeningTypes.TurnOnly; } case Openings.TILTTURN_LEFT: case Openings.TILTTURN_RIGHT: { - return OpeningTypes.TILTTURN; + return Enums.OpeningTypes.TiltTurn; } case Openings.TILTONLY_TOP: case Openings.TILTONLY_BOTTOM: { - return OpeningTypes.TILTONLY; + return Enums.OpeningTypes.TiltOnly; } case Openings.PIVOT: { - return OpeningTypes.PIVOT; + return Enums.OpeningTypes.Pivot; } case Openings.FIXED: { - return OpeningTypes.FIXED; + return Enums.OpeningTypes.Fixed; } case Openings.COMPLANARSLIDE_LEFT: case Openings.COMPLANARSLIDE_RIGHT: { - return OpeningTypes.COMPLANARSLIDE; + return Enums.OpeningTypes.ComplanarSlide; } case Openings.LIFTSLIDE_LEFT: case Openings.LIFTSLIDE_RIGHT: { - return OpeningTypes.LIFTSLIDE; + return Enums.OpeningTypes.LiftSlide; } default: { - return OpeningTypes.NULL; + return Enums.OpeningTypes.Null; } } } - - private string ConvertOpeningType() + private Enums.OpeningTypes ConvertOpeningType() { + var answ = Enums.OpeningTypes.Null; if (m_SashList.Count > 1) { for (int i = 0; i < m_SashList.Count; i++) { if (m_SashList[i].bHasHandle) { - if (GetOpeningType(m_SashList[i].OpeningType) == OpeningTypes.TURNONLY) - return "AB"; - else - return "AR"; + answ = GetOpeningType(m_SashList[i].OpeningType); } } - return ""; } - else if (m_SashList.Count == 1) + else { - switch (GetOpeningType(m_SashList[0].OpeningType)) - { - case OpeningTypes.TILTTURN: - { - return "AR"; - } - case OpeningTypes.TURNONLY: - { - return "AB"; - } - case OpeningTypes.TILTONLY: - { - return "VA"; - } - case OpeningTypes.PIVOT: - { - return "BI"; - } - case OpeningTypes.COMPLANARSLIDE: - { - return "CO"; - } - case OpeningTypes.LIFTSLIDE: - { - return "AS"; - } - default: - { - return ""; - } - } + answ = GetOpeningType(m_SashList[0].OpeningType); } - return ""; + return answ; } public void RefreshHardwareList() @@ -1349,13 +1315,13 @@ namespace WebWindowComplex { m_HardwareList.Clear(); string sSashShape = FindSashShape(); - string sOpeningType = ConvertOpeningType(); + Enums.OpeningTypes sOpeningType = ConvertOpeningType(); var iComp = StringComparison.InvariantCultureIgnoreCase; var rawList = m_HardwareCompleteList - .Where(x => x.Id == "000000" || - (!string.IsNullOrEmpty(m_SelFamilyHardware) && x.FamilyName.Equals(m_SelFamilyHardware, iComp) && x.SashQty == nSashQty && x.Shape.Equals(sSashShape, iComp) && x.OpeningType.Equals(sOpeningType, iComp)) - ) - .ToList(); + .Where(x => x.Id == "000000" || + (!string.IsNullOrEmpty(m_SelFamilyHardware) && x.FamilyName.Equals(m_SelFamilyHardware, iComp) && x.SashQty == nSashQty && x.Shape.Equals(sSashShape, iComp) && x.OpeningType == sOpeningType) + ) + .ToList(); if (rawList != null && rawList.Count > 0) { m_HardwareList = new List(rawList); diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 833cdad..7c2a0b7 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.818 + 2.7.10.918 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -26,7 +26,7 @@ - + @@ -164,6 +164,13 @@ + + + + + + + diff --git a/WebWindowTest/WebWindowTest.csproj b/WebWindowTest/WebWindowTest.csproj index e2be174..d06e030 100644 --- a/WebWindowTest/WebWindowTest.csproj +++ b/WebWindowTest/WebWindowTest.csproj @@ -12,7 +12,7 @@ - + diff --git a/WebWindowTest/Window.cs b/WebWindowTest/Window.cs index 5b88ce8..bffa8bb 100644 --- a/WebWindowTest/Window.cs +++ b/WebWindowTest/Window.cs @@ -136,7 +136,7 @@ namespace WebWindowTest } private int m_IdGroup; - public int IdGroup + public int IdGroup { get { @@ -146,7 +146,7 @@ namespace WebWindowTest set { m_IdGroup = value; - } + } } public void SetIdGroup(int nIdGroup) { @@ -278,7 +278,7 @@ namespace WebWindowTest SashArea.SetSelHardwareFromId(SashArea.HardwareList.First().Id); // Aggiungo area AreaList.Add(SashArea); - if(SashArea.nSashQty == 1) + if (SashArea.nSashQty == 1) { // Inserisco il riempimento precedente AreaList[0].AreaList.Add(ContentArea[0]); @@ -303,7 +303,7 @@ namespace WebWindowTest 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]; @@ -710,12 +710,12 @@ namespace WebWindowTest // aggiungo area Sash di default for (var SplitIndex = m_SashList.Count; SplitIndex <= value - 1; SplitIndex++) { - SashList.Add(new SashDimension(dNewDimension, true, this, SplitIndex+1)); + SashList.Add(new SashDimension(dNewDimension, true, this, SplitIndex + 1)); } } 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) @@ -725,7 +725,7 @@ namespace WebWindowTest } dLastDimension += m_SashList[SashList.Count - 1].dDimension; SashList[SashList.Count - 1].SetDimension(dLastDimension); - if(value == 1) + if (value == 1) SashList[0].SetHasHandle(true); } else @@ -733,7 +733,7 @@ namespace WebWindowTest SashList.RemoveAt(0); } } - if(m_SashList.Count == 0) + if (m_SashList.Count == 0) { Area child = AreaList[0]; // Se nella singola anta ho uno split @@ -774,7 +774,7 @@ namespace WebWindowTest 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 @@ -829,7 +829,7 @@ namespace WebWindowTest } internal void SetSashQty(int Qty) { - if(Qty >= 0 && Qty <= 4) + if (Qty >= 0 && Qty <= 4) { if (Qty > m_SashList.Count) { @@ -902,7 +902,7 @@ namespace WebWindowTest set { m_SelOrientationSashType = (OrientationSash)IdNameStruct.IdFromInd(value, m_OrientationSashTypeList); - if(value == 0) + if (value == 0) { m_bIsSashVertical = true; } @@ -1026,7 +1026,7 @@ namespace WebWindowTest set { // Controllo che il valore inserito sia positivo - if(value >= 0) + if (value >= 0) { m_nSashBottomRailQty = value; if (m_nSashBottomRailQty > 0) @@ -1153,12 +1153,12 @@ namespace WebWindowTest internal void SetSelHardwareFromId(string sId) { - if(m_HardwareList.Count == 0) - m_SelHardware = m_HardwareCompleteList.FirstOrDefault(x => x.Id == sId) ?? new Hardware("", "", "", "", "", 0, 0); + if (m_HardwareList.Count == 0) + m_SelHardware = m_HardwareCompleteList.FirstOrDefault(x => x.Id == sId) ?? new Hardware("", "", "", Enums.OpeningTypes.Null, "", 0, 0); else - m_SelHardware = m_HardwareList.FirstOrDefault(x => x.Id == sId)?? new Hardware("","","","","",0,0); + m_SelHardware = m_HardwareList.FirstOrDefault(x => x.Id == sId) ?? new Hardware("", "", "", Enums.OpeningTypes.Null, "", 0, 0); if (m_SelHardware == null) - m_SelHardware = m_HardwareList[0]; + m_SelHardware = m_HardwareList[0]; } public int SelHardwareTypeIndex @@ -1224,123 +1224,86 @@ namespace WebWindowTest { return "Rectangular"; } - - internal OpeningTypes GetOpeningType(Openings OpeningType) + internal Enums.OpeningTypes GetOpeningType(Openings OpeningType) { switch (OpeningType) { case Openings.TURNONLY_LEFT: case Openings.TURNONLY_RIGHT: { - return OpeningTypes.TURNONLY; + return Enums.OpeningTypes.TurnOnly; } case Openings.TILTTURN_LEFT: case Openings.TILTTURN_RIGHT: { - return OpeningTypes.TILTTURN; + return Enums.OpeningTypes.TiltTurn; } case Openings.TILTONLY_TOP: case Openings.TILTONLY_BOTTOM: { - return OpeningTypes.TILTONLY; + return Enums.OpeningTypes.TiltOnly; } case Openings.PIVOT: { - return OpeningTypes.PIVOT; + return Enums.OpeningTypes.Pivot; } case Openings.FIXED: { - return OpeningTypes.FIXED; + return Enums.OpeningTypes.Fixed; } case Openings.COMPLANARSLIDE_LEFT: case Openings.COMPLANARSLIDE_RIGHT: { - return OpeningTypes.COMPLANARSLIDE; + return Enums.OpeningTypes.ComplanarSlide; } case Openings.LIFTSLIDE_LEFT: case Openings.LIFTSLIDE_RIGHT: { - return OpeningTypes.LIFTSLIDE; + return Enums.OpeningTypes.LiftSlide; } default: { - return OpeningTypes.NULL; + return Enums.OpeningTypes.Null; } } } - - private string ConvertOpeningType() + private Enums.OpeningTypes ConvertOpeningType() { - if(m_SashList.Count > 1) + var answ = Enums.OpeningTypes.Null; + 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) { - if (GetOpeningType(m_SashList[i].OpeningType) == OpeningTypes.TURNONLY) - return "ANTA_BANDIERA"; - else - return "ANTA_RIBALTA"; + answ = GetOpeningType(m_SashList[i].OpeningType); } - + } - return ""; } - else if (m_SashList.Count > 0) + else { - switch (GetOpeningType(m_SashList[0].OpeningType)) - { - case OpeningTypes.TILTTURN: - { - return "ANTA_RIBALTA"; - } - case OpeningTypes.TURNONLY: - { - return "ANTA_BANDIERA"; - } - case OpeningTypes.TILTONLY: - { - return "VASISTAS"; - } - case OpeningTypes.PIVOT: - { - return "PIVOT"; - } - - case OpeningTypes.COMPLANARSLIDE: - { - return "COMPLANARE"; - } - - case OpeningTypes.LIFTSLIDE: - { - return "ALZANTE_SCORREVOLE"; - } - default: - { - return ""; - } - } + answ = GetOpeningType(m_SashList[0].OpeningType); } - return ""; + return answ; } public void RefreshHardwareList() { m_HardwareList.Clear(); string sSashShape = FindSashShape(); - string sOpeningType = ConvertOpeningType(); + Enums.OpeningTypes sOpeningType = ConvertOpeningType(); var iComp = StringComparison.InvariantCultureIgnoreCase; var rawList = m_HardwareCompleteList .Where(x => x.Id == "000000" || - (x.FamilyName.Equals(s_SelFamilyHW, iComp) && x.SashQty == nSashQty && x.Shape.Equals(sSashShape, iComp) && x.OpeningType.Equals(sOpeningType, iComp)) + (x.FamilyName.Equals(s_SelFamilyHW, iComp) && x.SashQty == nSashQty && x.Shape.Equals(sSashShape, iComp) && x.OpeningType.Equals(sOpeningType)) ) .ToList(); if (rawList != null && rawList.Count > 0) @@ -1401,12 +1364,12 @@ namespace WebWindowTest newSash.RefreshHardwareList(); newSash.RefreshHardwareOptionList(); newSash.SetSelHardware(SelHardware); - for (int i = 0; i x.sValue == HdwOptionParam.ValoreCorrente)?? new AGBOptionParameter("", ""); + m_sValue = m_ValueList.FirstOrDefault(x => x.sValue == HdwOptionParam.ValoreCorrente) ?? new AGBOptionParameter("", ""); } } @@ -2295,7 +2258,7 @@ namespace WebWindowTest { // reference private Sash m_Parent; - + private int m_nSashId; public int nSashId { @@ -2626,7 +2589,7 @@ namespace WebWindowTest List RelativeDimList = new List(); if (bIsVertListDim) RelativeDimList = m_Parent.SplitVertList.Where(x => x.bIsRelative).ToList(); - else + 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(); @@ -2671,7 +2634,7 @@ namespace WebWindowTest dRes += RelativeDimList[Ind].dDimension; } dRes = (100 - dRes); - if(dRes != 0) + if (dRes != 0) RelativeDimList[nIndex - 1].SetDimension(dRes); else return; @@ -2690,8 +2653,8 @@ namespace WebWindowTest } m_dDimension = value; m_Parent.ParentWindow.OnUpdatePreview(m_Parent.ParentWindow.sSerialized()); - } - + } + } } internal void SetDimension(double dValue)