diff --git a/Test.UI/Components/Pages/EditJWD.razor b/Test.UI/Components/Pages/EditJWD.razor index bfda185..4b6c9cb 100644 --- a/Test.UI/Components/Pages/EditJWD.razor +++ b/Test.UI/Components/Pages/EditJWD.razor @@ -10,6 +10,7 @@ EC_OnClose="CloseObj"> + @if (!string.IsNullOrEmpty(outClose)) {
@@ -22,16 +23,6 @@ else if (!string.IsNullOrEmpty(outSave)) @outSave
} - -@* - IN_ColorMaterialList="@AvailColorMaterialList" - IN_FamilyHardwareList="@AvailFamilyHardwareList" - IN_GlassList="@AvailGlassList" - IN_HardwareList="@AvailHardwareList" - IN_MaterialList="@AvailMaterialList" - LiveSVG="@currSvg" - CurrJwd="@InitialJwd" - IN_SelFamilyHardware="@SelFamilyHardware" - IN_SelColorMaterial="@SelColorMaterial" - IN_SelMaterial="@SelMaterial" - IN_SelGlass="@SelGlass" *@ \ No newline at end of file +

+ @currJwd +

diff --git a/Test.UI/Components/Pages/EditJWD.razor.cs b/Test.UI/Components/Pages/EditJWD.razor.cs index 4e6ecdd..20a632a 100644 --- a/Test.UI/Components/Pages/EditJWD.razor.cs +++ b/Test.UI/Components/Pages/EditJWD.razor.cs @@ -14,9 +14,15 @@ namespace Test.UI.Components.Pages { public partial class EditJWD : IDisposable { - #region Public Properties + + #region Public Fields public string InitialJwd = ""; + + #endregion Public Fields + + #region Public Properties + public Template SelTemplate { get; set; } = new Template(0, "---SELECT---", "", ""); #endregion Public Properties @@ -32,46 +38,54 @@ namespace Test.UI.Components.Pages #region Protected Fields + /// + /// Predisposizione valori live SVG/JWD + /// + protected LivePayload CurrData = new LivePayload(); + protected string currJwd = "..."; - protected string prevJwd = ""; protected Dictionary m_CurrArgs = new Dictionary(); + protected string prevJwd = ""; + /// + /// Configurazione elenchi anagrafiche + /// + protected BaseListPayload SetupList = new BaseListPayload(); #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() + + protected List AvailFamilyHardwareList { get; set; } = new List() { - new string("Pine"), - new string("Fir") + new string("Arc"), + new string("Profilo78") }; + 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") + new string("Vetro BE 2S 4/12/4"), + new string("Vetro BE 2S 4/16/4"), + new string("Vetro BE 3S 4/12/4/12/4"), + new string("Vetro BE 3S 4/16/4/16/4"), + new string("Vetro BE 2S 4T/12/4T"), + new string("Vetro BE 2S 4T/16/4T") }; - protected string SelFamilyHardware { get; set; } = ""; - protected string SelColorMaterial { get; set; } = ""; - protected string SelMaterial { get; set; } = ""; - protected string SelGlass { get; set; } = ""; + protected List AvailHardwareList { get; set; } = new List(); + protected List AvailMaterialList { get; set; } = new List() + { + new string("Pino"), + new string("Abete") + }; + + protected List AvailTemplateList { get; set; } = new List(); [Inject] protected IConfiguration Config { get; set; } = null!; @@ -86,6 +100,11 @@ namespace Test.UI.Components.Pages get => (MarkupString)currJwd.Replace(Environment.NewLine, "
").Replace(" ", " "); } + protected string SelColorMaterial { get; set; } = ""; + protected string SelFamilyHardware { get; set; } = ""; + protected string SelGlass { get; set; } = ""; + protected string SelMaterial { get; set; } = ""; + #endregion Protected Properties #region Protected Methods @@ -93,10 +112,6 @@ namespace Test.UI.Components.Pages protected override async Task OnInitializedAsync() { ConfInit(); - SelFamilyHardware = "Natura"; - //SelColorMaterial = "Black"; - //SelColorMaterial = "Pine"; - //SelGlass = "4T/16/4T"; InitialJwd = File.ReadAllText("Data\\AntaDoppia.jwd"); currJwd = InitialJwd; // rileggo altri dati @@ -107,6 +122,8 @@ namespace Test.UI.Components.Pages ColorMaterial = AvailColorMaterialList, FamilyHardware = AvailFamilyHardwareList, Glass = AvailGlassList, + //Hardware = new List(), + //Material = new List(), Hardware = AvailHardwareList, Material = AvailMaterialList, TemplateDTO = null @@ -119,16 +136,6 @@ namespace Test.UI.Components.Pages DLService.CalcDonePipe.EA_NewMessage += CalcDonePipe_EA_NewMessage; } - - /// - /// Configurazione elenchi anagrafiche - /// - protected BaseListPayload SetupList = new BaseListPayload(); - /// - /// Predisposizione valori live SVG/JWD - /// - protected LivePayload CurrData = new LivePayload(); - #endregion Protected Methods #region Private Fields @@ -136,14 +143,15 @@ namespace Test.UI.Components.Pages private string apiUrl = ""; private string calcTag = ""; private string CalcUid = "CurrWindow"; - private string cFileTemplate = "Data/Setup.json"; private string cFileHardware = "Hardware/Setup.json"; + private string cFileTemplate = "Data/Setup.json"; private TemplateSelectDTO? currSel = null; private string currSvg = ""; - private string imgBasePath = ""; private string GenericBasePath = ""; - + private string imgBasePath = ""; + private string outClose = ""; + private string outSave = ""; private string subChannel = ""; private string windowUid = "CurrWindow"; @@ -169,6 +177,16 @@ namespace Test.UI.Components.Pages await Task.Delay(1); } + /// + /// Effettua chiusura oggetto con eventuale save + /// + /// + private void CloseObj(bool reqSave) + { + outClose = !reqSave ? "Richiesto chiusura!" : ""; + outSave = reqSave ? "Richiesto salvataggio!" : ""; + } + private void ConfInit() { apiUrl = Config.GetValue("ServerConf:Prog.ApiUrl") ?? ""; @@ -252,18 +270,5 @@ namespace Test.UI.Components.Pages } #endregion Private Methods - - /// - /// Effettua chiusura oggetto con eventuale save - /// - /// - private void CloseObj(bool reqSave) - { - outClose = !reqSave ? "Richiesto chiusura!" : ""; - outSave = reqSave ? "Richiesto salvataggio!" : ""; - } - - private string outClose = ""; - private string outSave = ""; } } \ No newline at end of file diff --git a/Test.UI/Data/AntaDoppia.jwd b/Test.UI/Data/AntaDoppia.jwd index 12d9235..141654e 100644 --- a/Test.UI/Data/AntaDoppia.jwd +++ b/Test.UI/Data/AntaDoppia.jwd @@ -1,11 +1,10 @@ { "ProfilePath": "Profilo78", - "Material": "Pine", - "ColorMaterial": "Black", - "Glass": "4T/16/4T", + "Material": "Pino", + "ColorMaterial": "Nero", + "Glass": "Vetro BE 2S 4T/16/4T", "AreaList": [ { - "IdGroup": 1, "Shape": "RECTANGLE", "DimensionList": [ { @@ -39,19 +38,19 @@ ], "BottomRail": false, "BottomRailQty": 0, + "IdGroup": 1, "AreaList": [ { - "IdGroup": 2, "bIsSashVertical": true, "SashList": [ { - "SashId": 1, + "nSashId": 1, "OpeningType": "TURNONLY_LEFT", "bHasHandle": false, "dDimension": 50.0 }, { - "SashId": 2, + "nSashId": 2, "OpeningType": "TILTTURN_RIGHT", "bHasHandle": true, "dDimension": 50.0 @@ -77,6 +76,7 @@ } ], "Hardware": "000559", + "IdGroup": 2, "AreaList": [ { "IdGroup": 3, @@ -94,8 +94,8 @@ "IdGroup": 5, "AreaList": [ { - "IdGroup": 6, "FillType": "GLASS", + "IdGroup": 6, "AreaList": [], "AreaType": "FILL" } diff --git a/Test.UI/Data/AntaSingola.jwd b/Test.UI/Data/AntaSingola.jwd index 5748335..363ec74 100644 --- a/Test.UI/Data/AntaSingola.jwd +++ b/Test.UI/Data/AntaSingola.jwd @@ -1,8 +1,8 @@ { "ProfilePath": "Profilo78", - "Material": "Pine", + "Material": "Pino", "ColorMaterial": "Black", - "Glass": "4T/16/4T", + "Glass": "Vetro BE 2S 4T/16/4T", "AreaList": [ { "Shape": "RECTANGLE", @@ -44,7 +44,7 @@ "bIsSashVertical": true, "SashList": [ { - "SashId": 1, + "nSashId": 1, "OpeningType": "TILTTURN_LEFT", "bHasHandle": true, "dDimension": 100.0 diff --git a/Test.UI/Data/FinDueAnteBottomFisso.jwd b/Test.UI/Data/FinDueAnteBottomFisso.jwd index 2940a11..6b19f59 100644 --- a/Test.UI/Data/FinDueAnteBottomFisso.jwd +++ b/Test.UI/Data/FinDueAnteBottomFisso.jwd @@ -1,11 +1,10 @@ { "ProfilePath": "Profilo78", - "Material": "Pine", + "Material": "Pino", "ColorMaterial": "Black", - "Glass": "4T/16/4T", + "Glass": "Vetro BE 2S 4T/16/4T", "AreaList": [ { - "IdGroup": 1, "Shape": "RECTANGLE", "DimensionList": [ { @@ -39,11 +38,11 @@ ], "BottomRail": false, "BottomRailQty": 0, + "IdGroup": 1, "AreaList": [ { - "IdGroup": 2, "SplitShape": "HORIZONTAL", - "SplitStartVert": false, + "SplitStartVert": false, "SplitVertList": [], "SplitHorizList": [ { @@ -55,13 +54,14 @@ "dDimension": 60.0 } ], + "IdGroup": 2, "AreaList": [ { "IdGroup": 3, "AreaList": [ { - "IdGroup": 4, "FillType": "GLASS", + "IdGroup": 4, "AreaList": [], "AreaType": "FILL" } @@ -72,17 +72,16 @@ "IdGroup": 5, "AreaList": [ { - "IdGroup": 6, "bIsSashVertical": true, "SashList": [ { - "SashId": 1, + "nSashId": 1, "OpeningType": "TURNONLY_LEFT", "bHasHandle": false, "dDimension": 50.0 }, { - "SashId": 2, + "nSashId": 2, "OpeningType": "TILTTURN_RIGHT", "bHasHandle": true, "dDimension": 50.0 @@ -108,13 +107,14 @@ } ], "Hardware": "000559", + "IdGroup": 6, "AreaList": [ { "IdGroup": 7, "AreaList": [ { - "IdGroup": 8, "FillType": "GLASS", + "IdGroup": 8, "AreaList": [], "AreaType": "FILL" } @@ -125,8 +125,8 @@ "IdGroup": 9, "AreaList": [ { - "IdGroup": 10, "FillType": "GLASS", + "IdGroup": 10, "AreaList": [], "AreaType": "FILL" } diff --git a/Test.UI/Data/FinestraDueAnteSeparate.jwd b/Test.UI/Data/FinestraDueAnteSeparate.jwd index b051b18..5bedcb0 100644 --- a/Test.UI/Data/FinestraDueAnteSeparate.jwd +++ b/Test.UI/Data/FinestraDueAnteSeparate.jwd @@ -1,11 +1,10 @@ { "ProfilePath": "Profilo78", - "Material": "Pine", + "Material": "Pino", "ColorMaterial": "Black", - "Glass": "4T/16/4T", + "Glass": "Vetro BE 2S 4T/16/4T", "AreaList": [ { - "IdGroup": 1, "Shape": "DOUBLECHAMFER", "DimensionList": [ { @@ -44,11 +43,11 @@ ], "BottomRail": false, "BottomRailQty": 0, + "IdGroup": 1, "AreaList": [ { - "IdGroup": 2, "SplitShape": "VERTICAL", - "SplitStartVert": true, + "SplitStartVert": true, "SplitVertList": [ { "bIsRelative": true, @@ -60,16 +59,16 @@ } ], "SplitHorizList": [], + "IdGroup": 2, "AreaList": [ { "IdGroup": 3, "AreaList": [ { - "IdGroup": 4, "bIsSashVertical": true, "SashList": [ { - "SashId": 1, + "nSashId": 1, "OpeningType": "TILTTURN_LEFT", "bHasHandle": true, "dDimension": 100.0 @@ -97,10 +96,11 @@ "BottomRail": false, "BottomRailQty": 0, "Hardware": "000000", + "IdGroup": 4, "AreaList": [ { - "IdGroup": 5, "FillType": "GLASS", + "IdGroup": 5, "AreaList": [], "AreaType": "FILL" } @@ -114,11 +114,10 @@ "IdGroup": 6, "AreaList": [ { - "IdGroup": 7, "bIsSashVertical": true, "SashList": [ { - "SashId": 1, + "nSashId": 1, "OpeningType": "TILTTURN_RIGHT", "bHasHandle": true, "dDimension": 100.0 @@ -146,10 +145,11 @@ "BottomRail": false, "BottomRailQty": 0, "Hardware": "000000", + "IdGroup": 7, "AreaList": [ { - "IdGroup": 8, "FillType": "GLASS", + "IdGroup": 8, "AreaList": [], "AreaType": "FILL" } diff --git a/Test.UI/Data/FinestraSplitGrid.jwd b/Test.UI/Data/FinestraSplitGrid.jwd index 6f5f99e..ba61d49 100644 --- a/Test.UI/Data/FinestraSplitGrid.jwd +++ b/Test.UI/Data/FinestraSplitGrid.jwd @@ -1,11 +1,10 @@ { "ProfilePath": "Profilo78", - "Material": "Pine", + "Material": "Pino", "ColorMaterial": "Black", - "Glass": "4T/16/4T", + "Glass": "Vetro BE 2S 4T/16/4T", "AreaList": [ { - "IdGroup": 1, "Shape": "RECTANGLE", "DimensionList": [ { @@ -39,9 +38,9 @@ ], "BottomRail": false, "BottomRailQty": 0, + "IdGroup": 1, "AreaList": [ { - "IdGroup": 2, "SplitShape": "GRID", "SplitStartVert": false, "SplitVertList": [ @@ -68,13 +67,14 @@ "dDimension": 30.0 } ], + "IdGroup": 2, "AreaList": [ { "IdGroup": 3, "AreaList": [ { - "IdGroup": 4, "FillType": "GLASS", + "IdGroup": 4, "AreaList": [], "AreaType": "FILL" } @@ -85,8 +85,8 @@ "IdGroup": 5, "AreaList": [ { - "IdGroup": 6, "FillType": "GLASS", + "IdGroup": 6, "AreaList": [], "AreaType": "FILL" } @@ -97,8 +97,8 @@ "IdGroup": 7, "AreaList": [ { - "IdGroup": 8, "FillType": "GLASS", + "IdGroup": 8, "AreaList": [], "AreaType": "FILL" } @@ -109,8 +109,8 @@ "IdGroup": 9, "AreaList": [ { - "IdGroup": 10, "FillType": "GLASS", + "IdGroup": 10, "AreaList": [], "AreaType": "FILL" } @@ -121,8 +121,8 @@ "IdGroup": 11, "AreaList": [ { - "IdGroup": 12, "FillType": "GLASS", + "IdGroup": 12, "AreaList": [], "AreaType": "FILL" } @@ -133,8 +133,8 @@ "IdGroup": 13, "AreaList": [ { - "IdGroup": 14, "FillType": "GLASS", + "IdGroup": 14, "AreaList": [], "AreaType": "FILL" } diff --git a/Test.UI/Data/FinestraSplitVert.jwd b/Test.UI/Data/FinestraSplitVert.jwd index 60e1e4b..2651f19 100644 --- a/Test.UI/Data/FinestraSplitVert.jwd +++ b/Test.UI/Data/FinestraSplitVert.jwd @@ -1,11 +1,10 @@ { "ProfilePath": "Profilo78", - "Material": "Pine", + "Material": "Pino", "ColorMaterial": "Black", - "Glass": "4T/16/4T", + "Glass": "Vetro BE 2S 4T/16/4T", "AreaList": [ { - "IdGroup": 1, "Shape": "RECTANGLE", "DimensionList": [ { @@ -39,9 +38,9 @@ ], "BottomRail": false, "BottomRailQty": 0, + "IdGroup": 1, "AreaList": [ { - "IdGroup": 2, "SplitShape": "VERTICAL", "SplitStartVert": true, "SplitVertList": [ @@ -55,13 +54,14 @@ } ], "SplitHorizList": [], + "IdGroup": 2, "AreaList": [ { "IdGroup": 3, "AreaList": [ { - "IdGroup": 4, "FillType": "GLASS", + "IdGroup": 4, "AreaList": [], "AreaType": "FILL" } @@ -72,8 +72,8 @@ "IdGroup": 5, "AreaList": [ { - "IdGroup": 6, "FillType": "GLASS", + "IdGroup": 6, "AreaList": [], "AreaType": "FILL" } diff --git a/Test.UI/Hardware/Setup.json b/Test.UI/Hardware/Setup.json index ff15768..d587146 100644 --- a/Test.UI/Hardware/Setup.json +++ b/Test.UI/Hardware/Setup.json @@ -1,47 +1,371 @@ [ { - "Id": "000558", - "FamilyName": "Natura", - "Description": "Profilo78_Rect_Sash", - "OpeningType": "ANTA_RIBALTA", - "Shape": "Rectangular", - "SashQty": 1, - "SashPosition": 1 + "id": "000548", + "familyName": "Rect", + "description": "Rect_DoubleSash", + "openingType": "TiltTurn", + "shape": "Rectangular", + "sashQty": 2, + "sashPosition": 1 }, { - "Id": "000562", - "FamilyName": "Natura", - "Description": "Profilo78_Rect_Sash", - "OpeningType": "ANTA_BANDIERA", - "Shape": "Rectangular", - "SashQty": 1, - "SashPosition": 1 + "id": "000546", + "familyName": "Trap", + "description": "Trap_Sash", + "openingType": "TiltTurn", + "shape": "Trapezoidal", + "sashQty": 1, + "sashPosition": 1 }, { - "Id": "000559", - "FamilyName": "Natura", - "Description": "Profilo78_Rect_DoubleSash", - "OpeningType": "ANTA_RIBALTA", - "Shape": "Rectangular", - "SashQty": 2, - "SashPosition": 1 + "id": "000547", + "familyName": "Rect", + "description": "Rect_Sash_Compl", + "openingType": "ComplanarSlide", + "shape": "Rectangular", + "sashQty": 2, + "sashPosition": 1 }, { - "Id": "000563", - "FamilyName": "Natura", - "Description": "Profilo78_TurnOnly_Rect_DoubleSash", - "OpeningType": "ANTA_BANDIERA", - "Shape": "Rectangular", - "SashQty": 2, - "SashPosition": 1 + "id": "000561", + "familyName": "Profilo78", + "description": "Profilo78_Rect_TripleSash_HiddenHinges", + "openingType": "TiltTurn", + "shape": "Rectangular", + "sashQty": 3, + "sashPosition": 1 }, { - "Id": "000560", - "FamilyName": "Natura", - "Description": "Profilo78_Rect_TripleSash", - "OpeningType": "ANTA_RIBALTA", - "Shape": "Rectangular", - "SashQty": 3, - "SashPosition": 1 + "id": "000563", + "familyName": "Profilo78", + "description": "Profilo78_TurnOnly_Rect_DoubleSash", + "openingType": "TurnOnly", + "shape": "Rectangular", + "sashQty": 2, + "sashPosition": 1 + }, + { + "id": "000564", + "familyName": "Profilo78", + "description": "Profilo78_TurnOnly_Rect_TripleSash", + "openingType": "TurnOnly", + "shape": "Rectangular", + "sashQty": 3, + "sashPosition": 2 + }, + { + "id": "000603", + "familyName": "SegArc", + "description": "SegArc_2S_TurnOnly", + "openingType": "TurnOnly", + "shape": "Arc", + "sashQty": 2, + "sashPosition": 1 + }, + { + "id": "000602", + "familyName": "Arc", + "description": "Arc_2S_TurnOnly", + "openingType": "TurnOnly", + "shape": "FullArc", + "sashQty": 2, + "sashPosition": 1 + }, + { + "id": "000601", + "familyName": "SegArc", + "description": "SegArc_1S_TurnOnly", + "openingType": "TurnOnly", + "shape": "Arc", + "sashQty": 1, + "sashPosition": 1 + }, + { + "id": "000610", + "familyName": "SemiArc", + "description": "SemiArc_1S", + "openingType": "TiltTurn", + "shape": "SemiFullArc", + "sashQty": 1, + "sashPosition": 1 + }, + { + "id": "000611", + "familyName": "SemiSegArc", + "description": "SemiSegArc_S1", + "openingType": "TiltTurn", + "shape": "SemiArc", + "sashQty": 1, + "sashPosition": 1 + }, + { + "id": "000596", + "familyName": "Arc", + "description": "Arc_1S", + "openingType": "TiltTurn", + "shape": "FullArc", + "sashQty": 1, + "sashPosition": 1 + }, + { + "id": "000599", + "familyName": "SegArc", + "description": "SegArc_2S", + "openingType": "TiltTurn", + "shape": "Arc", + "sashQty": 2, + "sashPosition": 1 + }, + { + "id": "000597", + "familyName": "SegArc", + "description": "SegArc_1S", + "openingType": "TiltTurn", + "shape": "Arc", + "sashQty": 1, + "sashPosition": 1 + }, + { + "id": "000598", + "familyName": "Arc", + "description": "Arc_2S", + "openingType": "TiltTurn", + "shape": "FullArc", + "sashQty": 2, + "sashPosition": 1 + }, + { + "id": "000600", + "familyName": "Arc", + "description": "Arc_1S_TurnOnly", + "openingType": "TurnOnly", + "shape": "FullArc", + "sashQty": 1, + "sashPosition": 1 + }, + { + "id": "000606", + "familyName": "Trap", + "description": "Trap_S1_TurnOnly", + "openingType": "TurnOnly", + "shape": "Trapezoidal", + "sashQty": 1, + "sashPosition": 1 + }, + { + "id": "000605", + "familyName": "Trap", + "description": "Trap_S2", + "openingType": "TiltTurn", + "shape": "Trapezoidal", + "sashQty": 2, + "sashPosition": 1 + }, + { + "id": "000607", + "familyName": "Trap", + "description": "Trap_S2_TurnOnly", + "openingType": "TurnOnly", + "shape": "Trapezoidal", + "sashQty": 2, + "sashPosition": 1 + }, + { + "id": "000604", + "familyName": "Trap", + "description": "Trap_S1", + "openingType": "TiltTurn", + "shape": "Trapezoidal", + "sashQty": 1, + "sashPosition": 1 + }, + { + "id": "000595", + "familyName": "Slide", + "description": "Slide_quadruple", + "openingType": "LiftSlide", + "shape": "Rectangular", + "sashQty": 4, + "sashPosition": 2 + }, + { + "id": "000592", + "familyName": "Slide", + "description": "Slide_2S", + "openingType": "LiftSlide", + "shape": "Rectangular", + "sashQty": 2, + "sashPosition": 1 + }, + { + "id": "000594", + "familyName": "Slide", + "description": "Slide_4S", + "openingType": "LiftSlide", + "shape": "Rectangular", + "sashQty": 4, + "sashPosition": 2 + }, + { + "id": "000593", + "familyName": "Slide", + "description": "Slide_double", + "openingType": "LiftSlide", + "shape": "Rectangular", + "sashQty": 2, + "sashPosition": 1 + }, + { + "id": "000575", + "familyName": "Profilo78", + "description": "Profilo78_TurnOnly_Rect_QuadrupleSash", + "openingType": "TurnOnly", + "shape": "Rectangular", + "sashQty": 4, + "sashPosition": 2 + }, + { + "id": "000558", + "familyName": "Profilo78", + "description": "Profilo78_Rect_Sash", + "openingType": "TiltTurn", + "shape": "Rectangular", + "sashQty": 1, + "sashPosition": 1 + }, + { + "id": "000559", + "familyName": "Profilo78", + "description": "Profilo78_Rect_DoubleSash", + "openingType": "TiltTurn", + "shape": "Rectangular", + "sashQty": 2, + "sashPosition": 1 + }, + { + "id": "000566", + "familyName": "Profilo78", + "description": "Profilo78_TurnOnly_Rect_TripleSash_CenterHandle", + "openingType": "TurnOnly", + "shape": "Rectangular", + "sashQty": 3, + "sashPosition": 2 + }, + { + "id": "000565", + "familyName": "Profilo78", + "description": "Profilo78_TurnOnly_Rect_TripleSash_SideHandle", + "openingType": "TurnOnly", + "shape": "Rectangular", + "sashQty": 3, + "sashPosition": 1 + }, + { + "id": "000562", + "familyName": "Profilo78", + "description": "Profilo78_Rect_Sash", + "openingType": "TurnOnly", + "shape": "Rectangular", + "sashQty": 1, + "sashPosition": 1 + }, + { + "id": "000560", + "familyName": "Profilo78", + "description": "Profilo78_Rect_TripleSash", + "openingType": "TiltTurn", + "shape": "Rectangular", + "sashQty": 3, + "sashPosition": 1 + }, + { + "id": "000550", + "familyName": "Rect", + "description": "Rect_DoubleSash_4", + "openingType": "TiltTurn", + "shape": "Rectangular", + "sashQty": 2, + "sashPosition": 1 + }, + { + "id": "000552", + "familyName": "Rect", + "description": "Rect_DoubleSashStrana", + "openingType": "TiltTurn", + "shape": "Rectangular", + "sashQty": 3, + "sashPosition": 1 + }, + { + "id": "000549", + "familyName": "Rect", + "description": "Rect_DoubleSash", + "openingType": "TiltTurn", + "shape": "Rectangular", + "sashQty": 2, + "sashPosition": 1 + }, + { + "id": "000555", + "familyName": "Round", + "description": "Round_Sash", + "openingType": "Pivot", + "shape": "Circular", + "sashQty": 1, + "sashPosition": 1 + }, + { + "id": "000556", + "familyName": "Rect", + "description": "Rect_Sash_Bilico", + "openingType": "Pivot", + "shape": "Rectangular", + "sashQty": 1, + "sashPosition": 1 + }, + { + "id": "000554", + "familyName": "Rect", + "description": "Rect_QuadrupolSash_Bandiera", + "openingType": "TurnOnly", + "shape": "Rectangular", + "sashQty": 4, + "sashPosition": 2 + }, + { + "id": "000551", + "familyName": "Rect", + "description": "Rect_Sash_Bandiera", + "openingType": "TurnOnly", + "shape": "Rectangular", + "sashQty": 1, + "sashPosition": 1 + }, + { + "id": "000544", + "familyName": "Rect", + "description": "Rect_Sash", + "openingType": "TiltTurn", + "shape": "Rectangular", + "sashQty": 1, + "sashPosition": 1 + }, + { + "id": "000553", + "familyName": "Rect", + "description": "Rect_TripleSash", + "openingType": "TiltTurn", + "shape": "Rectangular", + "sashQty": 3, + "sashPosition": 1 + }, + { + "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/AreaFrame.razor b/WebWindowComplex/AreaFrame.razor new file mode 100644 index 0000000..6920bad --- /dev/null +++ b/WebWindowComplex/AreaFrame.razor @@ -0,0 +1,26 @@ +
+
+
+
+

Area frame

+
+
+ @if (CurrSashList.Count == 0 && CurrSplitList.Count == 0) + { + +
+ +
+ } +
+
+ @if (!(CurrFrameWindow.AreaList[0] is Split)) + { +
+ +
+ } +
+
+
+
\ No newline at end of file diff --git a/WebWindowComplex/AreaFrame.razor.cs b/WebWindowComplex/AreaFrame.razor.cs new file mode 100644 index 0000000..e48429e --- /dev/null +++ b/WebWindowComplex/AreaFrame.razor.cs @@ -0,0 +1,48 @@ +using Microsoft.AspNetCore.Components; + +namespace WebWindowComplex +{ + public partial class AreaFrame + { + #region Public Properties + + [Parameter] + public Frame CurrFrameWindow { get; set; } = null!; + + [Parameter] + public List CurrSashList { get; set; } = null!; + + [Parameter] + public List CurrSplitList { get; set; } = null!; + + [Parameter] + public EventCallback EC_AddSash { get; set; } + + [Parameter] + public EventCallback EC_AddWindow { get; set; } + + #endregion Public Properties + + #region Private Methods + + /// + /// Sollevo evento richiesta aggiunta sash + /// + /// + private async Task RaiseAddSash() + { + await EC_AddSash.InvokeAsync(true); + } + + /// + /// Sollevo evento richiesta aggiunta window + /// + /// + private async Task RaiseAddWindow() + { + await EC_AddWindow.InvokeAsync(true); + } + + #endregion Private Methods + } +} \ No newline at end of file diff --git a/WebWindowComplex/DTO/BaseListPayload.cs b/WebWindowComplex/DTO/BaseListPayload.cs index e0ba2bf..f9ece32 100644 --- a/WebWindowComplex/DTO/BaseListPayload.cs +++ b/WebWindowComplex/DTO/BaseListPayload.cs @@ -50,7 +50,6 @@ namespace WebWindowComplex.DTO /// public bool IsValid() { - //bool templateOK = TemplateDTO != null && TemplateDTO.Count > 0; bool famHwOK = FamilyHardware != null && FamilyHardware.Count > 0; bool hwOK = Hardware != null && Hardware.Count > 0; bool glassOK = Glass != null && Glass.Count > 0; @@ -58,5 +57,18 @@ namespace WebWindowComplex.DTO bool colorOK = ColorMaterial != null && ColorMaterial.Count > 0; return famHwOK && glassOK && hwOK && colorOK && matOK; } + /// + /// Verifica che Payload sia almeno parzialmente popolato + /// + /// + public bool IsPopulated() + { + bool famHwOK = FamilyHardware != null && FamilyHardware.Count > 0; + bool hwOK = Hardware != null && Hardware.Count > 0; + bool glassOK = Glass != null && Glass.Count > 0; + bool matOK = Material != null && Material.Count > 0; + bool colorOK = ColorMaterial != null && ColorMaterial.Count > 0; + return famHwOK || glassOK || hwOK || colorOK || matOK; + } } } diff --git a/WebWindowComplex/General.razor b/WebWindowComplex/General.razor new file mode 100644 index 0000000..b8264d3 --- /dev/null +++ b/WebWindowComplex/General.razor @@ -0,0 +1,92 @@ + +
+
+
+
+
+
+
+
+
+
General
+
+
+
+
+
+ + +
+
+ + +
+
+
+
+
+
+
+
Fill type
+
+
+
+ + +
+
+ + +
+
+
+
+
+
Color
+
+
+
+ + +
+
+ + +
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/WebWindowComplex/General.razor.cs b/WebWindowComplex/General.razor.cs new file mode 100644 index 0000000..4eb2303 --- /dev/null +++ b/WebWindowComplex/General.razor.cs @@ -0,0 +1,102 @@ +using Microsoft.AspNetCore.Components; +using WebWindowComplex.DTO; + +namespace WebWindowComplex +{ + public partial class General + { + #region Public Properties + + /// + /// Finestra corrente + /// + [Parameter] + public Window CurrWindow { get; set; } = null!; + + [Parameter] + public EventCallback EC_SelColor { get; set; } + + [Parameter] + public EventCallback EC_SelGlass { get; set; } + + [Parameter] + public EventCallback EC_SelWindMat { get; set; } + + /// + /// Elenco anagrafiche di base + /// + [Parameter] + public BaseListPayload ListPayload { get; set; } = null!; + + /// + /// Elenco Warnings attivi + /// + [Parameter] + public Dictionary ListWarnings { get; set; } = new Dictionary(); + + #endregion Public Properties + + #region Protected Properties + + protected string CurrColor + { + get => currColor; + set + { + currColor = value; + _ = EC_SelColor.InvokeAsync(value); + } + } + + protected string CurrGlass + { + get => currGlass; + set + { + currGlass = value; + _ = EC_SelGlass.InvokeAsync(value); + } + } + + protected string CurrMaterial + { + get => currMaterial; + set + { + currMaterial = value; + _ = EC_SelWindMat.InvokeAsync(value); + } + } + + #endregion Protected Properties + + #region Protected Methods + + /// + /// Calcola CSS warning + /// + /// + /// + protected string cssValid(string fKey) + { + return ListWarnings.ContainsKey(fKey) ? "border border-danger" : ""; + } + + protected override void OnParametersSet() + { + currColor = CurrWindow.sColorMaterial; + currGlass = CurrWindow.sGlass; + currMaterial = CurrWindow.sMaterial; + } + + #endregion Protected Methods + + #region Private Fields + + private string currColor = ""; + private string currGlass = ""; + private string currMaterial = ""; + + #endregion Private Fields + } +} \ No newline at end of file diff --git a/WebWindowComplex/Json/JsonUtility.cs b/WebWindowComplex/Json/JsonUtility.cs index 164836b..a1edcdf 100644 --- a/WebWindowComplex/Json/JsonUtility.cs +++ b/WebWindowComplex/Json/JsonUtility.cs @@ -397,6 +397,7 @@ namespace WebWindowComplex.Json } foreach (var Joint in m_JointList) newSash.JointList.Add(Joint.Deserialize((Area)ParentArea)); + newSash.SetSelFamilyHardwareFromIndex(Hardware); newSash.RefreshHardwareList(); newSash.SetSelHardwareFromId(Hardware); foreach (var Area in AreaList) diff --git a/WebWindowComplex/TableComp.razor b/WebWindowComplex/TableComp.razor index 9abc3a8..021ecc7 100644 --- a/WebWindowComplex/TableComp.razor +++ b/WebWindowComplex/TableComp.razor @@ -1,843 +1,438 @@ 
-
-
-
-
-
- -
-
-
- @if (currStep != CompileStep.Template) - { - - } -
-
- -
-
- -
-
+ @if (isLoading) + { + + } + else + { + if (listErrPre != null && listErrPre.Count > 0) + { +
+
Errori validazione!
+
+ +
    + @foreach (var item in listErrPre) + { +
  • @item.Value
  • + } +
-
-
- @if (string.IsNullOrEmpty(LiveData.CurrJwd)) - { - @if (currStep == CompileStep.Template && ListPayload.TemplateDTO != null) - { - - - - - - - - - - @foreach (var item in ListPayload.TemplateDTO) - { - string colorClass = ""; - @if (SelTemplateDTO != null && item.Index == SelTemplateDTO.Index) - colorClass = "table-success"; - else - colorClass = ""; - - - - - - } - -
#ImageDescription
@item.Index@item.Description
- } - } - @if (currStep == CompileStep.Tree) - { -
- - - @for (int i = 0; i < ItemTableList.Count; i++) - { - - @for (int j = 0; j < m_maxCol; j++) - { - CompileStep cs = CompileStep.Frame; - int ind = -1; - @if (j + 1 == ItemTableList[i].Col) - { - @if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.FRAME) - { - cs = CompileStep.Frame; - } - else if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.SPLIT) - { - cs = CompileStep.Split; - ind = ItemTableList[i].IndexItem; - } - else if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.SASH) - { - cs = CompileStep.Sash; - ind = ItemTableList[i].IndexItem; - } - else if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.FILL) - { - cs = CompileStep.Fill; - ind = ItemTableList[i].IndexItem; - } - - } - else - { - - } - } - - } - -
- - @FillTable(i, j)
-
+ } + else if (listErrLink != null && listErrLink.Count > 0) + { +
+
Errore configurazione:
+
- } - else if (currStep == CompileStep.Frame) - { - @if (m_CurrWindow != null) +
    + @foreach (var item in listErrLink) { - m_PreviousWindow = m_CurrWindow; +
  • @item.Value
  • } -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Frame

    -
    -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    -
    Dimension
    - @foreach (FrameDimension dimension in FrameWindow.DimensionList) +
+
+
+ } + else + { +
+
+
+
+
+ +
+
+
+ @if (currStep != CompileStep.Template) + { + + } +
+
+ +
+
+ +
+
+
+
+
+
+ @if (string.IsNullOrEmpty(LiveData.CurrJwd)) + { + @if (currStep == CompileStep.Template && ListPayload.TemplateDTO != null) + { + + + + + + + + + + @foreach (var item in ListPayload.TemplateDTO) + { + string colorClass = ""; + @if (SelTemplateDTO != null && item.Index == SelTemplateDTO.Index) + colorClass = "table-success"; + else + colorClass = ""; + + + + + + } + +
#ImageDescription
@item.Index@item.Description
+ } + } + @if (currStep == CompileStep.Tree) + { +
+ + + @for (int i = 0; i < ItemTableList.Count; i++) + { + + @for (int j = 0; j < m_maxCol; j++) + { + CompileStep cs = CompileStep.Frame; + int ind = -1; + @if (j + 1 == ItemTableList[i].Col) + { + @if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.FRAME) { -
- @dimension.sName - - mm -
+ cs = CompileStep.Frame; } - -
-
Threshold
-
- - -
-
- -
-
-
-
-
-
Joints
-
-
-
- -
-
-
-
- -
-
-
-
- -
+ else if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.SPLIT) + { + cs = CompileStep.Split; + ind = ItemTableList[i].IndexItem; + } + else if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.SASH) + { + cs = CompileStep.Sash; + ind = ItemTableList[i].IndexItem; + } + else if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.FILL) + { + cs = CompileStep.Fill; + ind = ItemTableList[i].IndexItem; + } +
+ } + else + { + + } + } + + } + +
+ + @FillTable(i, j)
+
+ + } + else if (currStep == CompileStep.Frame) + { + @if (m_CurrWindow != null) + { + m_PreviousWindow = m_CurrWindow; + } +
+
+
+
+
+
+
+
+
+

Frame

- @foreach (Joint joint in FrameWindow.JointList) - { +
- - + + + + + + + +
- } -
-
-
- @if (m_SashList.Count == 0) - { -
-
Bottom rail
-
+
+
+
+
+
Dimension
+ @foreach (FrameDimension dimension in FrameWindow.DimensionList) + { +
+ @dimension.sName + + mm +
+ } +
+
+
Threshold
- Quantity - + +
- } -
- -
-
-
- @if (!(FrameWindow.AreaList[0] is Split) || (SashList.Count == 0 && SplitList.Count == 0)) - { -
-
-
-
-

Area frame

-
- @if (SashList.Count == 0 && SplitList.Count == 0) - { - -
- -
- } -
-
- @if (!(FrameWindow.AreaList[0] is Split)) - { -
- -
- } -
-
-
-
- } -
-
-
-
-
- } - else if (currStep == CompileStep.Split) - { - @if (currSplit >= SplitList.Count || currSplit == -1) - { - currStep = CompileStep.Tree; - } - else - { - Split item = SplitList[currSplit]; -
-
-
-
-
-
-
-
-
-
@(descParentSplit(item))
-
-
-
-
-
+
+
+
-
-
Split
+
+
Joints
-
- @if ((item.nSplitQtyVert == 1 && item.nSplitQtyHoriz == 0) || (item.nSplitQtyVert == 0 && item.nSplitQtyHoriz == 1)) - { -
- -
- } -
-
+
- + +
+
+
+
+ +
+
+
+
+
-
+ @foreach (Joint joint in FrameWindow.JointList) + {
- - + + +
-
-
-
- @if (item.nSplitQtyVert > 0) - { -
-
- QtyVert - -
-
- } - @if (item.nSplitQtyHoriz > 0) - { -
-
- QtyHoriz - -
-
}
-
- @if (item.SplitVertList.Count > 0 && item.SplitHorizList.Count > 0) - { -
- @foreach (var dim in item.SplitVertList) - { -
- Width - - % -
- } -
-
- @foreach (var dim in item.SplitHorizList) - { -
- Height - - % -
- - } -
- } - else if (item.SplitHorizList.Count > 0) - { - @foreach (var dim in item.SplitHorizList) - { -
-
- Height - - % -
-
- } - } - else if (item.SplitVertList.Count > 0) - { - @foreach (var dim in item.SplitVertList) - { -
-
- Width - - % -
-
- } - } -
- @if (item.SelSplitShape == Json.WindowConst.SplitShapes.GRID) +
+
+ @if (m_SashList.Count == 0) {
-
-
-
- -
-
- -
-
+
Bottom rail
+
+
+
+ Quantity +
}
-
-
-
-
-
-
-
-
-
- } - } - else if (currStep == CompileStep.Sash) - { - @if (currSash >= SashList.Count || currSash == -1) - { - currStep = CompileStep.Tree; - } - else - { - Sash item = SashList[currSash]; -
-
-
-
-
-
-
-
-
- @if (SashList.Count > 1) - { -

Window @(currSash + 1)

- } - else - { -

Window

- } -
-
-
- -
-
-
-
-
-
- Qty sash - -
-
-
-
-
-
- - -
-
-
-
- Qty bottom rail - -
-
-
-
-
-
-
-
-
Joints
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
- @foreach (Joint joint in item.JointList) - { -
-
- - -
-
- }
-
-
-
-
Hardware
-
-
-
-
-
- - -
-
- - -
-
-
-
-
-
-
-
-
-
- @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]; - Area anta; - @if (item.AreaList[i * 2 + j] is Splitted) - { - anta = item.AreaList[i * 2 + j]; - } - else - { - anta = item; - } -
- @if (item.SashList.Count == 1) - { -
Sash
- } - else - { -
Sash @(i * 2 + j + 1)
- } -
- - -
-
- Dimension - - % -
-
-
- -
-
- -
-
- @if (!(anta.AreaList[0] is Split)) - { -
-
-
- -
-
-
-
- -
-
-
- } -
- @for (int k = 0; k <= item.SashList.Count - 1; k++) - { - @if (k != i * 2 + j) - { - int IndexCopy = k; - int IndexModify = i * 2 + j; -
-
- -
-
- } - } -
-
- - } - } -
-
-
-
-
-
-
-
- } - } - else if (currStep == CompileStep.Fill) - { - @if (currFill >= FillList.Count || currFill == -1) - { - currStep = CompileStep.Tree; - } - else - { - Fill item = FillList[currFill]; -
-
-
-
-
-
-
-
-
-

Fill @(currFill + 1)

-
-
-
- -
-
-
-
- -
-
-
-
-
-
-
Selected all fill
-
-
-
- -
-
-
-
- -
-
-
-
-
- @for (int i = 0; i < SplittedList.Count; i++) - { - Splitted currSplitted = SplittedList[i]; - @if (currSplitted.AreaList[0].Equals(item)) + @if (!(FrameWindow.AreaList[0] is Split) || (SashList.Count == 0 && SplitList.Count == 0)) { + + + } +
+
+
+
+
+ } + else if (currStep == CompileStep.Split) + { + @if (currSplit >= SplitList.Count || currSplit == -1) + { + currStep = CompileStep.Tree; + } + else + { + Split item = SplitList[currSplit]; +
+
+
+
+
-
- @if (SplittedList.Count > 1) - { -

Area split @(i + 1)

- } - else - { -

Area split

- } +
+
@(descParentSplit(item))
-
-
- -
-
- @for (int j = 0; j < SashList.Count; j++) - { - int Index = j; -
-
- +
+
+
+
+
+
+
Split
+
+
+ @if ((item.nSplitQtyVert == 1 && item.nSplitQtyHoriz == 0) || (item.nSplitQtyVert == 0 && item.nSplitQtyHoriz == 1)) + { +
+ +
+ } +
+
+
+ +
+
+
+
+
+ + +
+
+
+
+ @if (item.nSplitQtyVert > 0) + { +
+
+ QtyVert + +
+
+ } + @if (item.nSplitQtyHoriz > 0) + { +
+
+ QtyHoriz + +
+
+ } +
+
+ @if (item.SplitVertList.Count > 0 && item.SplitHorizList.Count > 0) + { +
+ @foreach (var dim in item.SplitVertList) + { +
+ Width + + % +
+ } +
+
+ @foreach (var dim in item.SplitHorizList) + { +
+ Height + + % +
+ + } +
+ } + else if (item.SplitHorizList.Count > 0) + { + @foreach (var dim in item.SplitHorizList) + { +
+
+ Height + + % +
+
+ } + } + else if (item.SplitVertList.Count > 0) + { + @foreach (var dim in item.SplitVertList) + { +
+
+ Width + + % +
+
+ } + } +
+ @if (item.SelSplitShape == Json.WindowConst.SplitShapes.GRID) + { +
+
+
+
+ +
+
+ +
+
+
+
+ }
- } -
-
-
- } - } -
-
-
-
-
- } - } - else if (currStep == CompileStep.General) - { -
-
-
-
-
-
-
-
-
-
General
-
-
-
-
-
- - -
-
- - -
-
-
-
-
-
-
-
Fill type
-
-
-
- - -
-
- - -
-
-
-
-
-
Color
-
-
-
- - -
-
- - +
@@ -846,21 +441,384 @@
-
-
+ } + } + else if (currStep == CompileStep.Sash) + { + @if (currSash >= SashList.Count || currSash == -1) + { + currStep = CompileStep.Tree; + } + else + { + Sash item = SashList[currSash]; +
+
+
+
+
+
+
+
+
+ @if (SashList.Count > 1) + { +

Window @(currSash + 1)

+ } + else + { +

Window

+ } +
+
+
+ +
+
+
+
+
+
+ Qty sash + +
+
+
+
+
+
+ + +
+
+
+
+ Qty bottom rail + +
+
+
+
+
+
+
+
+
Joints
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+ @foreach (Joint joint in item.JointList) + { +
+
+ + +
+
+ } + +
+
+
+
+
Hardware
+
+
+
+
+
+ + +
+
+ + +
+
+
+
+
+
+
+
+
+
+
+
+ @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]; + Area anta; + @if (item.AreaList[i * 2 + j] is Splitted) + { + anta = item.AreaList[i * 2 + j]; + } + else + { + anta = item; + } +
+ @if (item.SashList.Count == 1) + { +
Sash
+ } + else + { +
Sash @(i * 2 + j + 1)
+ } +
+ + +
+
+ Dimension + + % +
+
+
+ +
+
+ +
+
+ @if (!(anta.AreaList[0] is Split)) + { +
+
+
+ +
+
+
+
+ +
+
+
+ } +
+ @for (int k = 0; k <= item.SashList.Count - 1; k++) + { + @if (k != i * 2 + j) + { + int IndexCopy = k; + int IndexModify = i * 2 + j; +
+
+ +
+
+ } + } +
+
+ + } + } +
+
+
+
+
+
+
+
+ } + } + else if (currStep == CompileStep.Fill) + { + @if (currFill >= FillList.Count || currFill == -1) + { + currStep = CompileStep.Tree; + } + else + { + Fill item = FillList[currFill]; +
+
+
+
+
+
+
+
+
+

Fill @(currFill + 1)

+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+
Selected all fill
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+ @foreach (var currSplitted in SplittedList) + @* @for (int i = 0; i < SplittedList.Count; i++) *@ + { + @* Splitted currSplitted = SplittedList[i]; *@ + @if (currSplitted.AreaList[0].Equals(item)) + { +
+
+
+
+ @if (SplittedList.Count > 1) + { +

Area split @(SplittedList.IndexOf(currSplitted) + 1)

+ } + else + { +

Area split

+ } +
+
+
+ +
+
+ @foreach (var Index in SashList) + @* @for (int j = 0; j < SashList.Count; j++) *@ + { + @* int Index = j; *@ +
+
+ +
+
+ } +
+
+
+ } + } +
+
+
+
+
+ } + } + else if (currStep == CompileStep.General) + { + + }
- } +
-
-
- @if (currStep != CompileStep.Template) - { -
- @*
*@ - @outSvg - @*
*@ -
+ @if (currStep != CompileStep.Template) + { +
+ @outSvg +
+ } + if (listWarnings != null && listWarnings.Count > 0) + { +
+
Mancata corrispondenza valori:
+
+ +
    + @foreach (var item in listWarnings) + { +
  • @item.Value
  • + } +
+
+
+ } + } }
+@if (bError) +{ + +} + diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index 3019e57..4505d2e 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -49,6 +49,12 @@ namespace WebWindowComplex [Parameter] public EventCallback> EC_OnUpdate { get; set; } + /// + /// Sollevo evento errore validazione con una lista di errori rilevati + /// + [Parameter] + public EventCallback> EC_ValidError { get; set; } + /// /// Elenco anagrafiche di base /// @@ -85,122 +91,6 @@ namespace WebWindowComplex #endregion Protected Fields -#if false - [Parameter] - public string CurrJwd - { - get => m_CurrJwd; - set - { - // Se viene passato un JWD - if (m_CurrJwd != value && value != "") - { - 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; - } - 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) - { - // Aggiornate liste di sash, split, splitted, fill e itemTable - UpdateLists(); - } - } - } - [Parameter] - public string LiveSVG - { - get => m_SelSVG; - set => m_SelSVG = value; - } -#endif - -#if false - [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(); - } - } - } - - [Parameter] - public List IN_TemplateDTOList { get; set; } = null!; - - [Parameter] - public List IN_FamilyHardwareList { get; set; } = null!; - - [Parameter] - public List IN_HardwareList { get; set; } = null!; - - [Parameter] - public List IN_ColorMaterialList { get; set; } = null!; - - [Parameter] - public List IN_MaterialList { get; set; } = null!; - - [Parameter] - public List IN_GlassList { get; set; } = null!; -#endif - -#if false - [Parameter] - public string IN_SelFamilyHardware { get; set; } = null!; - - [Parameter] - public string? IN_SelColorMaterial { get; set; } = null; - - [Parameter] - public string? IN_SelMaterial { get; set; } = null; - - [Parameter] - public string? IN_SelGlass { get; set; } = null; -#endif - #region Protected Enums protected enum CompileStep @@ -242,8 +132,6 @@ namespace WebWindowComplex get => m_ItemTableList; } - protected string? m_CurrJwd { get; set; } - protected string m_SelSVG { get; set; } = ""; /// @@ -265,30 +153,7 @@ namespace WebWindowComplex } protected string SelColorMaterial { get; set; } = ""; - - protected string SelFamilyHardware - { - get - { - return m_SelFamilyHardware; - } - set - { - m_SelFamilyHardware = value; - Sash.s_SelFamilyHW = value; - for (int i = 0; i < SashList.Count; i++) - { - SashList[i].RefreshHardwareList(); - SashList[i].RefreshHardwareOptionList(); - SashList[i].SetFirstHardware(); - } - if (m_CurrWindow != null) - { - m_CurrWindow.OnUpdatePreview(m_CurrWindow.sSerialized()); - } - } - } - + protected string SelFamilyHardware { get; set; } = ""; protected string SelGlass { get; set; } = ""; protected string SelMaterial { get; set; } = ""!; @@ -644,7 +509,7 @@ namespace WebWindowComplex if (string.IsNullOrEmpty(LiveData.CurrJwd)) WindowFromJson = JsonConvert.DeserializeObject(m_SelTemplate.JWD, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", ""); else - WindowFromJson = JsonConvert.DeserializeObject(m_CurrJwd!, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", ""); + WindowFromJson = JsonConvert.DeserializeObject(LiveData.CurrJwd!, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", ""); if (m_CurrWindow != null) { m_CurrWindow.OnPreview -= M_CurrWindow_OnPreview; @@ -659,6 +524,7 @@ namespace WebWindowComplex currSplit = -1; currStep = CompileStep.Tree; editLock = false; + bError = false; await DoPreviewSvg(); } @@ -684,6 +550,11 @@ namespace WebWindowComplex await EC_OnSelectedTemplate.InvokeAsync(newSel); } + protected override void OnAfterRender(bool firstRender) + { + isLoading = false; + } + /// /// Primo init componente /// @@ -691,6 +562,11 @@ namespace WebWindowComplex { // reset editLock... editLock = false; + // reset variabile errori + bError = false; + listErrPre = new Dictionary(); + listErrLink = new Dictionary(); + listWarnings = new Dictionary(); } /// @@ -698,53 +574,152 @@ namespace WebWindowComplex /// protected override async Task OnParametersSetAsync() { - bool updateSvg = false; - // controllo elenchi BasePayload siano validi... - if (ListPayload.IsValid()) + isLoading = true; + // SOLO SE sono presenti... + if (ListPayload.IsPopulated() && LiveData.IsValid()) { - // controllo sia popolato anche per la componente LIVE - if (LiveData.IsValid()) + bool updateSvg = false; + listErrPre = new Dictionary(); + listErrLink = new Dictionary(); + listWarnings = new Dictionary(); + // controllo elenchi BasePayload siano validi... + if (ListPayload.IsValid()) { - // SOLO SE modificato live data... - if (prevLiveData == null || !prevLiveData.Equals(LiveData)) + // controllo sia popolato anche per la componente LIVE + if (LiveData.IsValid()) { - prevLiveData = LiveData; - m_CurrJwd = LiveData.CurrJwd; - m_SelSVG = LiveData.SvgPreview; - // Aggiornati parametri di ingresso selezionati - UpdateSelParameter(); - JsonWindow WindowFromJson = JsonConvert.DeserializeObject(m_CurrJwd, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", ""); - setCurrWindow(WindowFromJson); - //SOLO SE non sono in edit... - if (!editLock) + // SOLO SE modificato live data... + if (prevLiveData == null || !prevLiveData.Equals(LiveData)) { - currStep = CompileStep.Tree; + prevLiveData = new LivePayload() + { + CurrJwd = LiveData.CurrJwd, + SvgPreview = LiveData.SvgPreview + }; + m_SelSVG = LiveData.SvgPreview; + // Aggiornati parametri di ingresso selezionati + UpdateSelParameter(); + JsonWindow WindowFromJson = new JsonWindow("", "", "", ""); + // provo a deserializzare + try + { + WindowFromJson = JsonConvert.DeserializeObject(LiveData.CurrJwd, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", ""); + setCurrWindow(WindowFromJson); + //SOLO SE non sono in edit... + if (!editLock) + { + currStep = CompileStep.Tree; + } + } + // altrimenti errore! + catch (Exception ex) + { + listErrLink.Add("Window", $"Deserializing Error:{Environment.NewLine}{ex}"); + } + + updateSvg = true; + } + checkWarnings(); + } + else if (CurrSelection != null && CurrSelection.Template != null) + { + // Se viene passato il template selezionato oppure se non è ancora stato selezionato un template oppure se si cambia template di selezione + if (m_SelTemplate == null || (m_SelTemplate != null && CurrSelection.Template.nIndex != m_SelTemplate.nIndex) && !string.IsNullOrEmpty(CurrSelection.Template.JWD)) + { + m_SelTemplate = CurrSelection.Template; + // Aggiornamento parametri di ingresso selezionati + UpdateSelParameter(); + JsonWindow WindowFromJson = new JsonWindow("", "", "", ""); + // provo a deserializzare + try + { + WindowFromJson = JsonConvert.DeserializeObject(m_SelTemplate.JWD, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", ""); + setCurrWindow(WindowFromJson); + currStep = CompileStep.Template; + } + // altrimenti errore! + catch (Exception ex) + { + listErrLink.Add("Window", $"Deserializing Error:{Environment.NewLine}{ex}"); + } } updateSvg = true; } - } - else if (CurrSelection != null && CurrSelection.Template != null) - { - // Se viene passato il template selezionato oppure se non è ancora stato selezionato un template oppure se si cambia template di selezione - if (m_SelTemplate == null || (m_SelTemplate != null && CurrSelection.Template.nIndex != m_SelTemplate.nIndex) && !string.IsNullOrEmpty(CurrSelection.Template.JWD)) + if (SashList.Count > 0) { - m_SelTemplate = CurrSelection.Template; - // Aggiornamento parametri di ingresso selezionati - UpdateSelParameter(); - JsonWindow WindowFromJson = JsonConvert.DeserializeObject(m_SelTemplate.JWD, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", ""); - setCurrWindow(WindowFromJson); - currStep = CompileStep.Template; + currAnta = 0; + } + if (updateSvg) + { + await DoPreviewSvg(); } - updateSvg = true; } - if (SashList.Count > 0) - currAnta = 0; - - if (updateSvg) + else { - await DoPreviewSvg(); + checkErrorPre(); + } + isLoading = false; + } + } + + /// + /// Verifica errori prelimionari per mostrare dove sia il problema + /// + private void checkErrorPre() + { + // verifico 1:1 le liste e indico cosa manca + if (ListPayload.Hardware == null || ListPayload.Hardware.Count == 0) + { + listErrPre.Add("Hardware", "Missing Hardware List!"); + } + else + { + if (ListPayload.FamilyHardware == null || ListPayload.FamilyHardware.Count == 0) + { + listErrPre.Add("FamilyHardware", "Missing Famly HW List!"); } } + if (ListPayload.Glass == null || ListPayload.Glass.Count == 0) + { + listErrPre.Add("Glass", "Missing Glass List!"); + } + if (ListPayload.Material == null || ListPayload.Material.Count == 0) + { + listErrPre.Add("Material", "Missing Material List!"); + } + if (ListPayload.ColorMaterial == null || ListPayload.ColorMaterial.Count == 0) + { + listErrPre.Add("ColorMaterial", "Missing ColorMaterial List!"); + } + } + + /// + /// Verifica warning minori (es coerenza colori...) + /// + private void checkWarnings() + { + // verifico 1:1 le liste e i valori siano coerenti... + if (ListPayload.ColorMaterial != null && ListPayload.ColorMaterial.Count > 0) + { + // verifico colore attuale sia consistente... + if (m_CurrWindow != null) + { + if (!ListPayload.ColorMaterial.Contains(m_CurrWindow.sColorMaterial)) + { + listWarnings.Add("ColorMaterial", $"Missing Color: {m_CurrWindow.sColorMaterial}"); + } + } + } + } + + /// + /// Calcola CSS warning + /// + /// + /// + protected string cssValid(string fKey) + { + return listWarnings.ContainsKey(fKey) ? "border border-danger" : ""; } protected void setCurrWindow(JsonWindow WindowFromJson) @@ -798,19 +773,10 @@ namespace WebWindowComplex Sash.s_FamilyHardwareList = ListPayload.FamilyHardware; if (CurrSelection != null && CurrSelection.IsValid()) { - SelFamilyHardware = CurrSelection.FamilyHardware; + SelFamilyHardware = CurrSelection.FamilyHardware ?? ""; SelColorMaterial = CurrSelection.ColorMaterial ?? ""; SelMaterial = CurrSelection.Material ?? ""; SelGlass = CurrSelection.Glass ?? ""; - Sash.s_SelFamilyHW = CurrSelection.FamilyHardware ?? ""; - } - else - { - // se ho elementi, seleziono la prima - if (ListPayload.FamilyHardware.Count > 0) - { - Sash.s_SelFamilyHW = Sash.s_FamilyHardwareList.FirstOrDefault(); - } } } @@ -818,12 +784,40 @@ namespace WebWindowComplex #region Private Fields + private bool bError = false; + private int currAnta = 0; + private int currFill = -1; + private int currSash = -1; + private int currSplit = -1; + private CompileStep currStep; + private bool editLock = false; + + /// + /// Booleana fase loading + /// + private bool isLoading = false; + + /// + /// ELenco errori di coerenza/link dati (vanno risolti per disegnare/procedere) + /// + private Dictionary listErrLink = new Dictionary(); + + /// + /// Elenco errori preliminari (mancano elementi di base di validazione modello dati)) + /// + private Dictionary listErrPre = new Dictionary(); + + /// + /// Elenco warnings non bloccanti + /// + private Dictionary listWarnings = new Dictionary(); + private List m_FillList = new List(); private Frame? m_Frame; @@ -861,6 +855,11 @@ namespace WebWindowComplex #region Private Methods + private void AddSashToFrame(Frame f) + { + bError = f.AddFirstSash(); + } + /// /// Metodo per andare allo step successivo /// @@ -1099,7 +1098,7 @@ namespace WebWindowComplex /// Metodo per cambiare step e aggiornare preview svg /// /// step successivo - private async void NextStepAndPreview(CompileStep newStep, int Index = -1) + private void NextStepAndPreview(CompileStep newStep, int Index = -1) { editLock = true; currStep = newStep; @@ -1131,7 +1130,6 @@ namespace WebWindowComplex #if false await DoPreviewSvg(); #endif - await Task.Delay(1); } /// @@ -1193,5 +1191,26 @@ namespace WebWindowComplex } #endregion Private Methods + private void SelectColor(string newVal) + { + if (m_CurrWindow != null) + { + m_CurrWindow.sColorMaterial = newVal; + } + } + private void SelectMat(string newVal) + { + if (m_CurrWindow != null) + { + m_CurrWindow.sMaterial = newVal; + } + } + private void SelectGlass(string newVal) + { + if (m_CurrWindow != null) + { + m_CurrWindow.sGlass = newVal; + } + } } } \ No newline at end of file diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 44a06df..9392c8c 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.717 + 2.7.10.1012 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -18,7 +18,7 @@ - + @@ -87,6 +87,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WebWindowComplex/Window.cs b/WebWindowComplex/Window.cs index ddfb77f..2ddbd63 100644 --- a/WebWindowComplex/Window.cs +++ b/WebWindowComplex/Window.cs @@ -6,6 +6,7 @@ using System.Collections.ObjectModel; using System.ComponentModel; using System.Drawing; using System.Runtime.Intrinsics.Arm; +using System.Security.Cryptography; using System.Xml.Linq; using System.Xml.Serialization; using WebWindowComplex.Json; @@ -74,8 +75,8 @@ namespace WebWindowComplex } } - private ObservableCollection m_AreaList = new ObservableCollection(); - public ObservableCollection AreaList + private List m_AreaList = new List(); + public List AreaList { get { @@ -264,42 +265,72 @@ namespace WebWindowComplex ParentWindow.OnUpdatePreview(ParentWindow.sSerialized()); } - public void AddSash() + public bool AddFirstSash() { - List ContentArea = new List(); + bool answ = false; + // Salvo il parent Area ParentArea = AreaList[0].ParentArea; - // Salvo gli oggetti già presenti e li cancello da AreaList - ContentArea.Add(AreaList[0]); - AreaList.Remove(AreaList[0]); - // Aggiungo Area sash di default + // Creo area sash di default Sash SashArea = Sash.CreateSash(ParentArea); - Sash.s_SelFamilyHW = Sash.s_FamilyHardwareList.First(); - SashArea.RefreshHardwareList(); - SashArea.SetSelHardwareFromId(SashArea.HardwareList.First().Id); - // Aggiungo area - AreaList.Add(SashArea); - if (SashArea.nSashQty == 1) + // ricerco tra ttuti gli hw disponibili... + string sShape = FindSashShape(); + var listHwValid = Sash + .m_HardwareCompleteList + .Where(x => x.Shape == sShape && x.SashQty == 1) + .FirstOrDefault(); + if (listHwValid != null) { - // Inserisco il riempimento precedente - AreaList[0].AreaList.Add(ContentArea[0]); - AreaList[0].AreaList[0].SetParentArea(AreaList[0]); - } - else - { - // All'area Sash aggiunto uno Splitted per ogni anta - for (int i = 1; i < SashArea.nSashQty; i++) + // seleziono la famiglia del primo hw trovato... + SashArea.SelFamilyHardware = listHwValid.FamilyName; + SashArea.RefreshHardwareList(); + if (SashArea.HardwareList.Count == 0) { - AreaList[0].AreaList.Add(Splitted.CreateSplitted(SashArea)); + SashArea.Remove(); + answ = true; } - Fill fill2 = (Fill)ContentArea[0]; - for (int i = 1; i < SashArea.nSashQty; i++) + else { - AreaList[0].AreaList[1].AreaList.Add(Fill.CreateFill(AreaList[0].AreaList[1], fill2.FillType)); + SashArea.SetSelHardwareFromId(SashArea.HardwareList.First().Id); + // Salvo gli oggetti già presenti e li cancello da AreaList + List ContentArea = new List(); + ContentArea.Add(AreaList[0]); + AreaList.Remove(AreaList[0]); + // Aggiungo area + AreaList.Add(SashArea); + if (SashArea.nSashQty == 1) + { + // Inserisco il riempimento precedente + AreaList[0].AreaList.Add(ContentArea[0]); + AreaList[0].AreaList[0].SetParentArea(AreaList[0]); + } + else + { + // All'area Sash aggiunto uno Splitted per ogni anta + for (int i = 1; i < SashArea.nSashQty; i++) + { + AreaList[0].AreaList.Add(Splitted.CreateSplitted(SashArea)); + } + Fill fill2 = (Fill)ContentArea[0]; + for (int i = 1; i < SashArea.nSashQty; i++) + { + AreaList[0].AreaList[1].AreaList.Add(Fill.CreateFill(AreaList[0].AreaList[1], fill2.FillType)); + } + } + ParentWindow.OnUpdatePreview(ParentWindow.sSerialized()); } } - ParentWindow.OnUpdatePreview(ParentWindow.sSerialized()); + return answ; } + + /// + /// MockUp chiamata a c++ x scelta forma sash per Hw + /// + /// + private string FindSashShape() + { + return "Rectangular"; + } public void SwapAree() { Area tempArea; @@ -316,7 +347,8 @@ namespace WebWindowComplex public class Frame : Area { - private ObservableCollection m_ShapeList = new ObservableCollection + + private List m_ShapeList = new List { new IdNameStruct((int)Shapes.RECTANGLE, "Rectangle"), new IdNameStruct((int)Shapes.RIGHTCHAMFER, "Right Chamfer"), @@ -327,7 +359,7 @@ namespace WebWindowComplex new IdNameStruct((int)Shapes.DOUBLEARC, "Double Arc"), new IdNameStruct((int)Shapes.TRIANGLE, "Triangle") }; - public ObservableCollection ShapeList + public List ShapeList { get { @@ -431,10 +463,6 @@ namespace WebWindowComplex 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; } @@ -571,8 +599,8 @@ namespace WebWindowComplex m_Shape = Value; } - private ObservableCollection m_DimensionList = new ObservableCollection(); - public ObservableCollection DimensionList + private List m_DimensionList = new List(); + public List DimensionList { get { @@ -580,8 +608,8 @@ namespace WebWindowComplex } } - private ObservableCollection m_JointList = new ObservableCollection(); - public ObservableCollection JointList + private List m_JointList = new List(); + public List JointList { get { @@ -681,8 +709,6 @@ namespace WebWindowComplex public static List m_HardwareCompleteList = new List(); // Lista hardware completa passata dal chiamante del componente public static List s_FamilyHardwareList = new List(); - // Macro famiglia hardware scelta dal chiamante - public static string s_SelFamilyHW = ""; public int nSashQty { @@ -940,8 +966,8 @@ namespace WebWindowComplex m_bIsMeasureGlass = IsMeasureGlass; } - private ObservableCollection m_SashList = new ObservableCollection(); - public ObservableCollection SashList + private List m_SashList = new List(); + public List SashList { get { @@ -970,8 +996,8 @@ namespace WebWindowComplex m_SashType = SashType; } - private ObservableCollection m_JointList = new ObservableCollection(); - public ObservableCollection JointList + private List m_JointList = new List(); + public List JointList { get { @@ -1039,8 +1065,36 @@ namespace WebWindowComplex } } - private ObservableCollection m_HardwareList = new ObservableCollection(); - public ObservableCollection HardwareList + private string m_SelFamilyHardware; + public string SelFamilyHardware + { + get + { + return m_SelFamilyHardware; + } + set + { + m_SelFamilyHardware = value; + RefreshHardwareList(); + RefreshHardwareOptionList(); + SetFirstHardware(); + m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); + } + } + + internal string SetSelFamilyHardwareFromIndex(string codHardware) + { + if (string.IsNullOrEmpty(m_SelFamilyHardware)) + { + SelFamilyHardware = (m_HardwareCompleteList + .Where(x => x.Id == codHardware) + .First()).FamilyName; + } + return SelFamilyHardware; + } + + private List m_HardwareList = new List(); + public List HardwareList { get { @@ -1138,29 +1192,23 @@ namespace WebWindowComplex internal void SetSelHardwareFromId(string sId) { if (m_HardwareList.Count == 0) - m_SelHardware = m_HardwareCompleteList.FirstOrDefault(x => x.Id == 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 == 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; } - public int SelHardwareTypeIndex + public string SelHardwareFromId { get { - for (int i = 0; i < m_HardwareList.Count; i++) - { - if (m_HardwareList[i].Equals(m_SelHardware)) - return i; - } - return 0; - //return IdNameStruct.IndFromId((int)m_SelHardware, m_HardwareList); + return m_SelHardware.Id; } set { - m_SelHardware = m_HardwareList[value]; - //m_SelOpeningType = (Openings)IdNameStruct.IdFromInd(value, m_OpeningTypeList); + m_SelHardware = m_HardwareList.FirstOrDefault(x => !string.IsNullOrEmpty(value) && x.Id.Equals(value)) ?? new Hardware("", "", "", Enums.OpeningTypes.Null, "", 0, 0); ParentWindow.OnUpdatePreview(ParentWindow.sSerialized()); } } @@ -1173,8 +1221,8 @@ namespace WebWindowComplex } } - private ObservableCollection m_HwdOptionList = new ObservableCollection(); - public ObservableCollection HwdOptionList + private List m_HwdOptionList = new List(); + public List HwdOptionList { get { @@ -1199,6 +1247,7 @@ namespace WebWindowComplex newSash.JointList.Add(new Joint(newSash, JointIndex + 1, Joints.FULL_H)); newSash.SetSashBottomRail(false); newSash.SetSashBottomRailQty(0); + newSash.SelFamilyHardware = Sash.s_FamilyHardwareList.First(); newSash.RefreshHardwareList(); newSash.RefreshHardwareOptionList(); newSash.SetFirstHardware(); @@ -1209,109 +1258,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 "ANTA_BANDIERA"; - else - return "ANTA_RIBALTA"; + answ = GetOpeningType(m_SashList[i].OpeningType); } } - return ""; } - else if (m_SashList.Count == 1) + 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() @@ -1320,26 +1335,21 @@ 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(s_SelFamilyHW) && x.FamilyName.Equals(s_SelFamilyHW, 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 ObservableCollection(rawList); + m_HardwareList = new List(rawList); } else { - m_HardwareList = new ObservableCollection(); + m_HardwareList = new List(); } -#if false - m_HardwareList = new ObservableCollection(from Hardware in m_HardwareCompleteList - where Hardware.Id == "000000" || (Hardware.FamilyName == s_SelFamilyHW && Hardware.SashQty == nSashQty && Hardware.Shape == sSashShape && Hardware.OpeningType == sOpeningType) - select Hardware); -#endif } } @@ -1388,6 +1398,7 @@ namespace WebWindowComplex newSash.SetIsSashVertical(bIsSashVertical); newSash.SetOrientationSashType(OrientationSashType); newSash.SetSashBottomRailQty(SashBottomRailQty); + newSash.SetSelFamilyHardwareFromIndex(SelHardware.Id); newSash.RefreshHardwareList(); newSash.RefreshHardwareOptionList(); newSash.SetSelHardware(SelHardware); @@ -1681,14 +1692,14 @@ namespace WebWindowComplex } } - private ObservableCollection m_SplitShapeList = new ObservableCollection + private List m_SplitShapeList = new List { new IdNameStruct((int)SplitShapes.VERTICAL, "Vertical"), new IdNameStruct((int)SplitShapes.HORIZONTAL, "Horizontal"), new IdNameStruct((int)SplitShapes.GRID, "Grid"), new IdNameStruct((int)SplitShapes.CUSTOM, "Custom") }; - public ObservableCollection SplitShapeList + public List SplitShapeList { get { @@ -1763,8 +1774,8 @@ namespace WebWindowComplex } } - private ObservableCollection m_SplitPositionList = new ObservableCollection(); - public ObservableCollection SplitPositionList + private List m_SplitPositionList = new List(); + public List SplitPositionList { get { @@ -1776,8 +1787,8 @@ namespace WebWindowComplex } } - private ObservableCollection m_SplitVertList = new ObservableCollection(); - public ObservableCollection SplitVertList + private List m_SplitVertList = new List(); + public List SplitVertList { get { @@ -1789,8 +1800,8 @@ namespace WebWindowComplex } } - private ObservableCollection m_SplitHorizList = new ObservableCollection(); - public ObservableCollection SplitHorizList + private List m_SplitHorizList = new List(); + public List SplitHorizList { get { @@ -1915,6 +1926,7 @@ namespace WebWindowComplex return m_FillTypeList; } } + private FillTypes m_SelFillType; public FillTypes SelFillType { @@ -2750,23 +2762,6 @@ namespace WebWindowComplex return Name; } - public static int IndFromId(int Id, ObservableCollection List) - { - checked - { - int num = List.Count - 1; - for (int i = 0; i <= num; i++) - { - if (List[i].Id == Id) - { - return i; - } - } - - return 0; - } - } - public static int IndFromId(int Id, List List) { checked @@ -2784,33 +2779,11 @@ namespace WebWindowComplex } } - public static int IdFromInd(int Ind, ObservableCollection List) - { - return List[Ind].Id; - } - public static int IdFromInd(int Ind, List List) { return List[Ind].Id; } - public static int IndFromId(int Id, ObservableCollection List) - { - checked - { - int num = List.Count - 1; - for (int i = 0; i <= num; i++) - { - if (List[i] is IdNameStruct && ((IdNameStruct)List[i]).Id == Id) - { - return i; - } - } - - return 0; - } - } - public static int IndFromId(int Id, List List) { checked @@ -2828,16 +2801,6 @@ namespace WebWindowComplex } } - public static int IdFromInd(int Ind, ObservableCollection List) - { - if (List[Ind] is IdNameStruct) - { - return ((IdNameStruct)List[Ind]).Id; - } - - return 0; - } - public static int IdFromInd(int Ind, List List) { if (List[Ind] is IdNameStruct) @@ -2848,22 +2811,6 @@ namespace WebWindowComplex return 0; } - public static int IdFromName(string Name, ObservableCollection List) - { - checked - { - int num = List.Count - 1; - for (int i = 0; i <= num; i++) - { - if (string.Compare(((IdNameStruct)List[i]).Name, Name, false) == 0) - { - return ((IdNameStruct)List[i]).Id; - } - } - return 0; - } - } - public static int IdFromName(string Name, List List) { checked diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 0e7ffa0..dd40bd5 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.717 + 2.7.10.1012 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -26,7 +26,7 @@ - + @@ -102,6 +102,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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)