diff --git a/Test.UI/Components/Pages/EditJWD.razor.cs b/Test.UI/Components/Pages/EditJWD.razor.cs index e08d6ae..96d8b25 100644 --- a/Test.UI/Components/Pages/EditJWD.razor.cs +++ b/Test.UI/Components/Pages/EditJWD.razor.cs @@ -91,6 +91,12 @@ namespace Test.UI.Components.Pages new string("ProfiloSaomad") }; + protected List AvailThresholdList { get; set; } = new List() + { + new Threshold(1, "Bottom"), + new Threshold(3, "Threshold") + }; + [Inject] protected IConfiguration Config { get; set; } = null!; @@ -129,7 +135,7 @@ namespace Test.UI.Components.Pages Random random = new Random(); CalcUid = Convert.ToString(random.Next(1000, 10000)); windowUid = CalcUid; - //InitialJwd = File.ReadAllText("Data\\FinestraSplitVert.jwd"); + //InitialJwd = File.ReadAllText("Data\\FinestraSplitGrid.jwd"); InitialJwd = File.ReadAllText("Data\\AntaDoppia.jwd"); //InitialJwd = File.ReadAllText("Data\\ArcoAntaDoppia.jwd"); currJwd = InitialJwd; @@ -143,7 +149,8 @@ namespace Test.UI.Components.Pages Glass = AvailGlassList, Hardware = AvailHardwareList, Material = AvailMaterialList, - Profile = AvailProfileList + Profile = AvailProfileList, + Threshold = AvailThresholdList }; CurrData = new LivePayload() { @@ -162,46 +169,33 @@ namespace Test.UI.Components.Pages #region Private Fields private string apiUrl = ""; - private string calcTag = ""; - private string CalcUid = "CurrWindow"; - + private string windowUid = "CurrWindow"; private string cFileHardware = "Hardware/Setup.json"; - - private string cFileTemplate = "Data/Setup.json"; - - private string colorMassUpdate; - private string currSvg = ""; - - private string familyHWMassUpdate; - private string GenericBasePath = ""; + private string colorMassUpdate; + private string familyHWMassUpdate; private string glassMassUpdate; - private Hardware hardwareMassUpdate; - - private string channelHwOpt = ""; - private string imgBasePath = ""; + private string materialMassUpdate; + private string profileMassUpdate; /// /// Semaforo x definire se sia già in modalità ionterattiva o di prerendering /// private bool isInteractive = false; - private string materialMassUpdate; - private string outClose = ""; - private string outSave = ""; - private string profileMassUpdate; + private string imgBasePath = ""; + private string channelHwOpt = ""; private string channelShape = ""; private string channelSvg = ""; - private string windowUid = "CurrWindow"; #endregion Private Fields diff --git a/Test.UI/Data/AntaDoppia.jwd b/Test.UI/Data/AntaDoppia.jwd index ca2ffb8..07d466c 100644 --- a/Test.UI/Data/AntaDoppia.jwd +++ b/Test.UI/Data/AntaDoppia.jwd @@ -36,6 +36,7 @@ "JointType": "FULL_V" } ], + "Threshold": "Bottom", "BottomRail": false, "BottomRailQty": 0, "GroupId": 1, diff --git a/Test.UI/Data/AntaSingola.jwd b/Test.UI/Data/AntaSingola.jwd index dbeaeda..049e822 100644 --- a/Test.UI/Data/AntaSingola.jwd +++ b/Test.UI/Data/AntaSingola.jwd @@ -36,6 +36,7 @@ "JointType": "FULL_V" } ], + "Threshold": "Bottom", "BottomRail": false, "BottomRailQty": 0, "GroupId": 1, diff --git a/Test.UI/Data/ArcoAntaDoppia.jwd b/Test.UI/Data/ArcoAntaDoppia.jwd index d21f48d..7b2b5be 100644 --- a/Test.UI/Data/ArcoAntaDoppia.jwd +++ b/Test.UI/Data/ArcoAntaDoppia.jwd @@ -41,6 +41,7 @@ "JointType": "ANGLED" } ], + "Threshold": "Threshold", "BottomRail": false, "BottomRailQty": 0, "GroupId": 1, diff --git a/Test.UI/Data/FinDueAnteBottomFisso.jwd b/Test.UI/Data/FinDueAnteBottomFisso.jwd index 76aec15..2882852 100644 --- a/Test.UI/Data/FinDueAnteBottomFisso.jwd +++ b/Test.UI/Data/FinDueAnteBottomFisso.jwd @@ -36,6 +36,7 @@ "JointType": "FULL_V" } ], + "Threshold": "Bottom", "BottomRail": false, "BottomRailQty": 0, "GroupId": 1, diff --git a/Test.UI/Data/FinestraDueAnteSeparate.jwd b/Test.UI/Data/FinestraDueAnteSeparate.jwd index d109c4f..2d8dbe7 100644 --- a/Test.UI/Data/FinestraDueAnteSeparate.jwd +++ b/Test.UI/Data/FinestraDueAnteSeparate.jwd @@ -41,6 +41,7 @@ "JointType": "FULL_V" } ], + "Threshold": "Bottom", "BottomRail": false, "BottomRailQty": 0, "GroupId": 1, diff --git a/Test.UI/Data/FinestraSplitGrid.jwd b/Test.UI/Data/FinestraSplitGrid.jwd index 6474e08..5367e5f 100644 --- a/Test.UI/Data/FinestraSplitGrid.jwd +++ b/Test.UI/Data/FinestraSplitGrid.jwd @@ -36,6 +36,7 @@ "JointType": "FULL_V" } ], + "Threshold": "Bottom", "BottomRail": false, "BottomRailQty": 0, "GroupId": 1, diff --git a/Test.UI/Data/FinestraSplitVert.jwd b/Test.UI/Data/FinestraSplitVert.jwd index ffb59bc..0e0b9cd 100644 --- a/Test.UI/Data/FinestraSplitVert.jwd +++ b/Test.UI/Data/FinestraSplitVert.jwd @@ -36,6 +36,7 @@ "JointType": "FULL_V" } ], + "Threshold": "Bottom", "BottomRail": false, "BottomRailQty": 0, "GroupId": 1, diff --git a/WebAedificaConfigurator/WebAedificaConfigurator.csproj b/WebAedificaConfigurator/WebAedificaConfigurator.csproj index b74113a..63b386c 100644 --- a/WebAedificaConfigurator/WebAedificaConfigurator.csproj +++ b/WebAedificaConfigurator/WebAedificaConfigurator.csproj @@ -12,7 +12,7 @@ - + diff --git a/WebWindowComplex/Compo/CardFrame.razor b/WebWindowComplex/Compo/CardFrame.razor index e753f54..dc7de7d 100644 --- a/WebWindowComplex/Compo/CardFrame.razor +++ b/WebWindowComplex/Compo/CardFrame.razor @@ -42,10 +42,16 @@
- + @foreach (var item in Frame.m_ThresholdList) + { + + } + + @* + *@
diff --git a/WebWindowComplex/Compo/CardFrame.razor.cs b/WebWindowComplex/Compo/CardFrame.razor.cs index 7c389b7..4638656 100644 --- a/WebWindowComplex/Compo/CardFrame.razor.cs +++ b/WebWindowComplex/Compo/CardFrame.razor.cs @@ -1,3 +1,4 @@ +using Egw.Window.Data; using Microsoft.AspNetCore.Components; using WebWindowComplex.Models; @@ -76,8 +77,27 @@ namespace WebWindowComplex.Compo svgNoHw = true }; _ = EC_UpdatePreview.InvokeAsync(args); - //_ = EC_ReqOptionHw.InvokeAsync(CurrFrameWindow); - //_ = EC_UpdateShape.InvokeAsync(CurrFrameWindow); + } + } + } + + /// + /// Metodo per selezionare threshold + /// + protected int SelThreshold + { + get => CurrFrameWindow.SelThresholdFromType; + set + { + if (CurrFrameWindow.SelThresholdFromType != value) + { + CurrFrameWindow.SelThresholdFromType = value; + var args = new DataUpdateFrame() + { + currFrame = CurrFrameWindow, + svgNoHw = false + }; + _ = EC_UpdatePreview.InvokeAsync(args); } } } diff --git a/WebWindowComplex/DTO/BaseListPayload.cs b/WebWindowComplex/DTO/BaseListPayload.cs index 4285bcb..43096ee 100644 --- a/WebWindowComplex/DTO/BaseListPayload.cs +++ b/WebWindowComplex/DTO/BaseListPayload.cs @@ -44,6 +44,11 @@ namespace WebWindowComplex.DTO /// public List Profile { get; set; } = null!; + /// + /// Elenco profili ammessi + /// + public List Threshold { get; set; } = null!; + /// /// Verifica di validità dell'intero Payload /// @@ -56,7 +61,8 @@ namespace WebWindowComplex.DTO bool matOK = Material != null && Material.Count > 0; bool colorOK = ColorMaterial != null && ColorMaterial.Count > 0; bool profileOK = Profile != null && Profile.Count > 0; - return famHwOK && glassOK && hwOK && colorOK && matOK && profileOK; + bool thresholdOK = Threshold != null && Threshold.Count > 0; + return famHwOK && glassOK && hwOK && colorOK && matOK && profileOK && thresholdOK; } /// /// Verifica che Payload sia almeno parzialmente popolato @@ -70,7 +76,8 @@ namespace WebWindowComplex.DTO bool matOK = Material != null && Material.Count > 0; bool colorOK = ColorMaterial != null && ColorMaterial.Count > 0; bool profileOK = Profile != null && Profile.Count > 0; - return famHwOK || glassOK || hwOK || colorOK || matOK || profileOK; + bool thresholdOK = Threshold != null && Threshold.Count > 0; + return famHwOK || glassOK || hwOK || colorOK || matOK || profileOK || thresholdOK; } } } diff --git a/WebWindowComplex/Json/JsonUtility.cs b/WebWindowComplex/Json/JsonUtility.cs index ef9d0de..5a0bf63 100644 --- a/WebWindowComplex/Json/JsonUtility.cs +++ b/WebWindowComplex/Json/JsonUtility.cs @@ -1,4 +1,5 @@ -using Microsoft.VisualBasic; +using Egw.Window.Data; +using Microsoft.VisualBasic; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; @@ -201,6 +202,20 @@ namespace WebWindowComplex.Json } } + private string m_Threshold; + [JsonProperty] + public string Threshold + { + get + { + return m_Threshold; + } + set + { + m_Threshold = value; + } + } + private bool m_bBottomRail; [JsonProperty] public bool BottomRail @@ -247,9 +262,10 @@ namespace WebWindowComplex.Json { } - public JsonFrame(Shapes Shape, bool BottomRail, int BottomRailQty, int GroupId) : base(AreaTypes.FRAME) + public JsonFrame(Shapes Shape, string sThreshold, bool BottomRail, int BottomRailQty, int GroupId) : base(AreaTypes.FRAME) { m_Shape = Shape; + m_Threshold= sThreshold; m_bBottomRail = BottomRail; m_nBottomRailQty = BottomRailQty; base.GroupId = GroupId; @@ -261,6 +277,7 @@ namespace WebWindowComplex.Json newFrame.SetGroupId(GroupId); newFrame.SetAreaType(AreaTypes.FRAME); newFrame.SetSelShape(m_Shape); + newFrame.SetSelThresholdFromName(m_Threshold); newFrame.SetBottomRail(m_bBottomRail); newFrame.SetBottomRailQty(m_nBottomRailQty); //if(ArcElement != null) diff --git a/WebWindowComplex/Models/Frame.cs b/WebWindowComplex/Models/Frame.cs index d8e1fc2..451b5f7 100644 --- a/WebWindowComplex/Models/Frame.cs +++ b/WebWindowComplex/Models/Frame.cs @@ -1,4 +1,5 @@ -using System; +using Egw.Window.Data; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -10,6 +11,13 @@ namespace WebWindowComplex.Models { public class Frame : Area { + #region Public Fields + + // Lista hardware completa passata dal chiamante del componente + public static List m_ThresholdList = new List(); + + #endregion Public Fields + #region Public Constructors public Frame(Area ParentArea, Window ParentWindow) : base(ParentArea, ParentWindow) @@ -44,6 +52,30 @@ namespace WebWindowComplex.Models } } + public Threshold SelThreshold + { + get + { + return m_SelThreshold; + } + set + { + m_SelThreshold = value; + } + } + + public int SelThresholdFromType + { + get + { + return m_SelThreshold.Type; + } + set + { + m_SelThreshold = m_ThresholdList.Where(x=>x.Type.Equals(value)).First(); + } + } + public int BottomRailQty { get @@ -329,6 +361,7 @@ namespace WebWindowComplex.Models newFrame.SetSelShape(Shapes.RECTANGLE); newFrame.SetBottomRail(false); newFrame.SetBottomRailQty(0); + newFrame.SetSelThresholdFromName(m_ThresholdList.FirstOrDefault().Name); //newFrame.FrameArcElem = null; return newFrame; } @@ -338,7 +371,7 @@ namespace WebWindowComplex.Models Area.nCounterGroup = 0; if (nCounterGroup < GroupId) Area.nCounterGroup = GroupId; - JsonFrame JsonFrame = new JsonFrame(m_Shape, m_bBottomRail, m_nBottomRailQty, GroupId); + JsonFrame JsonFrame = new JsonFrame(m_Shape, m_SelThreshold.Name, m_bBottomRail, m_nBottomRailQty, GroupId); //if (FrameArcElem != null) // JsonFrame.ArcElement = FrameArcElem.Serialize(); //else @@ -477,6 +510,11 @@ namespace WebWindowComplex.Models m_Shape = Value; } + internal void SetSelThresholdFromName(string value) + { + m_SelThreshold = m_ThresholdList.Where(x=>x.Name.Equals(value)).First(); + } + #endregion Internal Methods #region Private Fields @@ -485,6 +523,8 @@ namespace WebWindowComplex.Models private bool m_bBottomRail; + private Threshold m_SelThreshold; + private List m_DimensionList = new List(); private List m_JointList = new List(); diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index bb1e71e..13053e3 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -583,7 +583,7 @@ namespace WebWindowComplex }; //FrameArcElement ae = new FrameArcElement(frame, window, 10, true, true); JsonWindow jsonWindow = new JsonWindow("Profilo78", "Pino", "Black", "Vetro BE 2S 4T/16/4T"); - JsonFrame jsonFrame = new JsonFrame(Shapes.RECTANGLE, false, 0, 1); + JsonFrame jsonFrame = new JsonFrame(Shapes.RECTANGLE, null, false, 0, 1); jsonWindow.AreaList.Add(jsonFrame); //jsonFrame.ArcElement = ae.Serialize(); foreach (var Dimension in DimensionList) @@ -744,6 +744,7 @@ namespace WebWindowComplex /// protected void UpdateSelParameter() { + Frame.m_ThresholdList = ListPayload.Threshold; Sash.m_HardwareCompleteList = ListPayload.Hardware; Sash.s_FamilyHardwareList = ListPayload.FamilyHardware; if (CurrSelection != null && CurrSelection.IsValid()) @@ -988,7 +989,7 @@ namespace WebWindowComplex /// private async Task ReqResetDict(DataUpdateRes args) { - _ = EC_ActionReq.InvokeAsync(args.req); + await EC_ActionReq.InvokeAsync(args.req); } /// diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index fc6086b..c325db4 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.12.1812 + 2.7.12.2212 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -18,7 +18,7 @@ - + @@ -405,6 +405,10 @@ + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 767c465..4c4311f 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.12.1917 + 2.7.12.2212 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -26,7 +26,7 @@ - + @@ -485,6 +485,26 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/WebWindowTest/WebWindowTest.csproj b/WebWindowTest/WebWindowTest.csproj index 3493714..9a892fc 100644 --- a/WebWindowTest/WebWindowTest.csproj +++ b/WebWindowTest/WebWindowTest.csproj @@ -12,7 +12,7 @@ - +