diff --git a/Test.UI/Components/Pages/Gerarchia.razor b/Test.UI/Components/Pages/Gerarchia.razor index 6c0c77f..e807ac2 100644 --- a/Test.UI/Components/Pages/Gerarchia.razor +++ b/Test.UI/Components/Pages/Gerarchia.razor @@ -6,13 +6,14 @@ - -@*

+@* +

@m_CurrArgs.GetValueOrDefault("Jwd")

*@ diff --git a/Test.UI/Components/Pages/Gerarchia.razor.cs b/Test.UI/Components/Pages/Gerarchia.razor.cs index ca282c5..cd44bab 100644 --- a/Test.UI/Components/Pages/Gerarchia.razor.cs +++ b/Test.UI/Components/Pages/Gerarchia.razor.cs @@ -39,7 +39,8 @@ namespace Test.UI.Components.Pages protected List AvailTemplateList { get; set; } = new List(); protected List AvailHardwareList { get; set; } = new List(); - protected string FamilyHardware { get; set; } = "Natura"; + protected List AvailFamilyHardwareList { get; set; } = new List(); + protected string SelFamilyHardware { get; set; } = ""; [Inject] protected IConfiguration Config { get; set; } = null!; @@ -62,6 +63,9 @@ namespace Test.UI.Components.Pages protected override async Task OnInitializedAsync() { ConfInit(); + AvailFamilyHardwareList.Add("Natura"); + AvailFamilyHardwareList.Add("Optima"); + SelFamilyHardware = "Natura"; DLService.CalcDonePipe.EA_NewMessage += CalcDonePipe_EA_NewMessage; await ReloadData(); } diff --git a/WebWindowComplex/Json/JsonUtility.cs b/WebWindowComplex/Json/JsonUtility.cs index d4d1b1c..90920e8 100644 --- a/WebWindowComplex/Json/JsonUtility.cs +++ b/WebWindowComplex/Json/JsonUtility.cs @@ -258,31 +258,31 @@ namespace WebWindowComplex.Json } } - private bool m_bSashBottomRail; + private bool m_bBottomRail; [JsonProperty] - public bool SashBottomRail + public bool BottomRail { get { - return m_bSashBottomRail; + return m_bBottomRail; } set { - m_bSashBottomRail = value; + m_bBottomRail = value; } } - private int m_nSashBottomRailQty; + private int m_nBottomRailQty; [JsonProperty] - public int SashBottomRailQty + public int BottomRailQty { get { - return m_nSashBottomRailQty; + return m_nBottomRailQty; } set { - m_nSashBottomRailQty = value; + m_nBottomRailQty = value; } } @@ -304,12 +304,12 @@ namespace WebWindowComplex.Json { } - public JsonSash(bool bIsSashVertical, SashTypes SashType, bool SashBottomRail, int SashBottomRailQty/*, string Hardware*/) : base(AreaTypes.SASH) + public JsonSash(bool bIsSashVertical, SashTypes SashType, bool SashBottomRail, int SashBottomRailQty, string Hardware) : base(AreaTypes.SASH) { m_bIsSashVertical = bIsSashVertical; m_SashType = SashType; - m_bSashBottomRail = SashBottomRail; - m_nSashBottomRailQty = SashBottomRailQty; + m_bBottomRail = SashBottomRail; + m_nBottomRailQty = SashBottomRailQty; m_Hardware = Hardware; } @@ -319,9 +319,8 @@ namespace WebWindowComplex.Json newSash.SetAreaType(AreaTypes.SASH); newSash.SetSashQty(m_SashList.Count); newSash.SetIsSashVertical(m_bIsSashVertical); - newSash.SetSashBottomRail(m_bSashBottomRail); - newSash.SetSashBottomRailQty(m_nSashBottomRailQty); - //Sash.AppliedDone(); + newSash.SetSashBottomRail(m_bBottomRail); + newSash.SetSashBottomRailQty(m_nBottomRailQty); for (var SashIndex = 0; SashIndex <= m_SashList.Count - 1; SashIndex++) { newSash.SashList[SashIndex].SetOpeningType(m_SashList[SashIndex].OpeningType); @@ -330,8 +329,8 @@ namespace WebWindowComplex.Json } foreach (var Joint in m_JointList) newSash.JointList.Add(Joint.Deserialize((Area)ParentArea)); - //Sash.RefreshHardwareList(); - //Sash.SetSelHardwareFromId(Hardware); + newSash.RefreshHardwareList(); + newSash.SetSelHardwareFromId(Hardware); foreach (var Area in AreaList) { var AreaDeserealized = Area.Deserialize(newSash, ParentWindow); diff --git a/WebWindowComplex/Json/WindowConst.cs b/WebWindowComplex/Json/WindowConst.cs index a51ba71..144ba12 100644 --- a/WebWindowComplex/Json/WindowConst.cs +++ b/WebWindowComplex/Json/WindowConst.cs @@ -127,19 +127,7 @@ namespace WebWindowComplex.Json VOL_ZMAP = 1024, EXT_TEXT = 2048, EXT_DIMENSION = 2049 - } - - public enum GDB_ID - { - ROOT = 0, - NULL = -1, - SEL = -2, - GRID = -3, - CURRPART = -4, - CURRLAYER = -5, - SELPART = -6, - SELLAYER = -7 - } + } // Specifies the display state of an element. public enum Visibility diff --git a/WebWindowComplex/TableComp.razor b/WebWindowComplex/TableComp.razor index 5d76915..a56c256 100644 --- a/WebWindowComplex/TableComp.razor +++ b/WebWindowComplex/TableComp.razor @@ -673,18 +673,32 @@
-
+
Hardware
-
- - +
+
+
+ + +
+
+
+
+ +
+
diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index 7cf52e0..def7c6f 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -36,12 +36,16 @@ namespace WebWindowComplex if (value != null && (m_SelTemplate == null || (m_SelTemplate != null && value.nIndex != m_SelTemplate.nIndex)) && !string.IsNullOrEmpty(value.JWD)) { m_SelTemplate = value; + SelFamilyHardware = IN_SelFamilyHardware; JsonWindow WindowFromJson = JsonConvert.DeserializeObject(m_SelTemplate.JWD, new PolymorphicJsonConverter()) ?? new JsonWindow(""); if (m_CurrWindow != null) { m_CurrWindow.OnPreview -= M_CurrWindow_OnPreview; m_CurrWindow = null; } + Sash.m_HardwareCompleteList = IN_HardwareList; + Sash.s_FamilyHardwareList = IN_FamilyHardwareList; + Sash.s_SelFamilyHW = IN_SelFamilyHardware; m_CurrWindow = WindowFromJson.Deserialize(); m_CurrWindow.OnPreview += M_CurrWindow_OnPreview; // recupero dimensioni Frame e Joint Frame della finestra precedente @@ -65,10 +69,6 @@ namespace WebWindowComplex m_ItemTableList = new List(); CreateWindowsList(m_CurrWindow.AreaList[0], false); CreateElementTable(m_CurrWindow.AreaList[0], 1, 1, 1, 1); - foreach (var item in SashList) - { - item.RefreshHardwareList(IN_HardwareList, IN_FamilyHardware); - } } } } @@ -77,7 +77,10 @@ namespace WebWindowComplex public List IN_TemplateDTOList { get; set; } = null!; [Parameter] - public string IN_FamilyHardware { get; set; } = null; + public List IN_FamilyHardwareList { get; set; } = null!; + + [Parameter] + public string IN_SelFamilyHardware { get; set; } = null; [Parameter] public List IN_HardwareList { get; set; } = null; @@ -187,6 +190,29 @@ namespace WebWindowComplex protected TemplateSelectDTO? SelTemplateDTO { get; set; } = null; + 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()); + } + } + } + #endregion Protected Properties #region Protected Methods @@ -242,6 +268,7 @@ namespace WebWindowComplex /// protected async Task DoReset() { + SelFamilyHardware = IN_SelFamilyHardware; JsonWindow WindowFromJson = JsonConvert.DeserializeObject(m_SelTemplate.JWD, new PolymorphicJsonConverter()) ?? new JsonWindow(""); if (m_CurrWindow != null) { @@ -532,28 +559,28 @@ namespace WebWindowComplex /// /// Metodo per settare tutti i Joints di Frame o Sash come ANGLED o FULL_H o FULL_V /// - /// tipo di giunzione (ANGLED o FULL_H o FULL_V) - /// oggetto a cui essere applicato (Frame o Sash) + /// tipo di giunzione (ANGLED o FULL_H o FULL_V) + /// oggetto a cui essere applicato (Frame o Sash) /// - private async Task AllJointsFrame(int int_type, int int_place) + private async Task AllJointsFrame(int n_type, int n_place) { Joints type = Joints.ANGLED; - if (int_type == 2) + if (n_type == 2) { type = Joints.FULL_H; } - else if (int_type == 3) + else if (n_type == 3) { type = Joints.FULL_V; } - if (int_place == 0) + if (n_place == 0) { foreach (Joint joint in FrameWindow.JointList) { joint.SetSelJointType(type); } } - else if (int_place == 1) + else if (n_place == 1) { foreach (Joint joint in m_SashList[0].JointList) { @@ -566,13 +593,12 @@ namespace WebWindowComplex /// /// Metodo per settare tutti i Joints di Frame o Sash come ANGLED o FULL_H o FULL_V /// - /// tipo di giunzione (ANGLED o FULL_H o FULL_V) - /// oggetto a cui essere applicato (Frame o Sash) + /// tipo di riempimento (GLASS o WOOD) /// - private async Task AllFill(int int_type) + private async Task AllFill(int n_type) { FillTypes type = FillTypes.GLASS; - if (int_type == 2) + if (n_type == 2) { type = FillTypes.WOOD; } @@ -657,6 +683,8 @@ namespace WebWindowComplex private Template m_SelTemplate { get; set; } = null!; + private string m_SelFamilyHardware { get; set; } = ""; + #endregion Private Properties #region Private Methods diff --git a/WebWindowComplex/Window.cs b/WebWindowComplex/Window.cs index 9331d5c..a05602e 100644 --- a/WebWindowComplex/Window.cs +++ b/WebWindowComplex/Window.cs @@ -126,7 +126,6 @@ namespace WebWindowComplex set { m_AreaType = value; - //m_delDrawWindow(); } } internal void SetAreaType(AreaTypes AreaType) @@ -658,6 +657,13 @@ namespace WebWindowComplex public class Sash : Area { + // Lista hardware completa passata dal chiamante del componente + 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 { get @@ -823,9 +829,9 @@ namespace WebWindowComplex //} } } - //RefreshHardwareList(); + RefreshHardwareList(); RefreshHardwareOptionList(); - //SetFirstHardware(); + SetFirstHardware(); m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); } } @@ -1157,6 +1163,26 @@ namespace WebWindowComplex m_SelHardware = m_HardwareList[0]; } + public int SelHardwareTypeIndex + { + 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); + } + set + { + m_SelHardware = m_HardwareList[value]; + //m_SelOpeningType = (Openings)IdNameStruct.IdFromInd(value, m_OpeningTypeList); + ParentWindow.OnUpdatePreview(ParentWindow.sSerialized()); + } + } + internal void SetFirstHardware() { if (m_HardwareList.Count > 0) @@ -1180,26 +1206,24 @@ namespace WebWindowComplex internal static Sash CreateSash(Area Area) { - Sash NewSash = new Sash(Area, Area.ParentWindow); - NewSash.SetAreaType(AreaTypes.SASH); - NewSash.SetSashQty(1); - NewSash.SetOrientationSashType(OrientationSash.VERTICAL); - NewSash.SetIsSashVertical(true); - // recupero numero di lati dell'area contenitore - //int nOutlineLayerId = EgtGetFirstNameInGroup(Area.nAreaId, WIN_OUTLINE); - //int nJointQty = EgtGetGroupObjs(nOutlineLayerId); + Sash newSash = new Sash(Area, Area.ParentWindow); + newSash.SetAreaType(AreaTypes.SASH); + newSash.SetSashQty(1); + newSash.SetOrientationSashType(OrientationSash.VERTICAL); + newSash.SetIsSashVertical(true); for (var JointIndex = 0; JointIndex <= 3; JointIndex++) - NewSash.JointList.Add(new Joint(NewSash, JointIndex + 1, Joints.FULL_H)); - NewSash.SetSashBottomRail(false); - NewSash.SetSashBottomRailQty(0); - //NewSash.RefreshHardwareList(); - NewSash.RefreshHardwareOptionList(); - //NewSash.SetFirstHardware(); - return NewSash; + newSash.JointList.Add(new Joint(newSash, JointIndex + 1, Joints.FULL_H)); + newSash.SetSashBottomRail(false); + newSash.SetSashBottomRailQty(0); + newSash.RefreshHardwareList(); + newSash.RefreshHardwareOptionList(); + newSash.SetFirstHardware(); + return newSash; } private string FindSashShape() { // Return "R" + //return "CHAMFER"; return "RECTANGLE"; } @@ -1258,10 +1282,18 @@ namespace WebWindowComplex { if(m_SashList.Count > 1) { - if (GetOpeningType(m_SashList[0].OpeningType) == OpeningTypes.TURNONLY) - return "ANTA_BANDIERA"; - else - return "ANTA_RIBALTA"; + 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"; + } + + } + return "ANTA_BANDIERA"; } else { @@ -1301,13 +1333,13 @@ namespace WebWindowComplex } } - public void RefreshHardwareList(List HardwareCompleteList, string nameFamily) + public void RefreshHardwareList() { m_HardwareList.Clear(); string sSashShape = FindSashShape(); string sOpeningType = ConvertOpeningType(); - m_HardwareList = new ObservableCollection(from Hardware in HardwareCompleteList - where Hardware.sId == "000000" || (Hardware.sFamily == nameFamily && Hardware.nSashQty == nSashQty && Hardware.sShape == sSashShape && Hardware.sOpeningType == sOpeningType) + m_HardwareList = new ObservableCollection(from Hardware in m_HardwareCompleteList + where Hardware.sId == "000000" || (Hardware.sFamily == s_SelFamilyHW && Hardware.nSashQty == nSashQty && Hardware.sShape == sSashShape && Hardware.sOpeningType == sOpeningType) select Hardware); } @@ -1354,6 +1386,9 @@ namespace WebWindowComplex newSash.SetIsSashVertical(bIsSashVertical); newSash.SetOrientationSashType(OrientationSashType); newSash.SetSashBottomRailQty(SashBottomRailQty); + newSash.RefreshHardwareList(); + newSash.RefreshHardwareOptionList(); + newSash.SetSelHardware(SelHardware); for (int i = 0; i net8.0 enable enable - 2.7.9.1018 + 2.7.9.1209 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -261,6 +261,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +