From 46ee89fbdeea2c98dafd254fc33889b07ff79c4e Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Wed, 6 Aug 2025 19:08:51 +0200 Subject: [PATCH] Aggiunto funzionamento BottomRail per Sash --- EgtWindowMaker/ManageWindow/ManageWindowVM.vb | 27 ++++++++++-------- EgtWindowMaker/Utility/JsonUtility.vb | 28 ++++++++++++++++++- 2 files changed, 42 insertions(+), 13 deletions(-) diff --git a/EgtWindowMaker/ManageWindow/ManageWindowVM.vb b/EgtWindowMaker/ManageWindow/ManageWindowVM.vb index 704ee21..1b52831 100644 --- a/EgtWindowMaker/ManageWindow/ManageWindowVM.vb +++ b/EgtWindowMaker/ManageWindow/ManageWindowVM.vb @@ -1753,9 +1753,6 @@ Public Class Frame For nJointIndex = 0 To m_JointList.Count - 1 Dim tg = EgtLuaSetGlobIntVar("WDG.JOINT" & nJointIndex + 1, m_JointList(nJointIndex).SelJointType) Next - If m_Shape = Shapes.DOUBLECHAMFER OrElse m_Shape = Shapes.DOUBLEARC Then - Dim tg = EgtLuaSetGlobIntVar("WDG.JOINT5", Joints.ANGLED) - End If Dim tlt = EgtLuaCallFunction("WinCreate_CreateFrame") EgtLuaGetGlobIntVar("WDG.AREAID", m_nAreaId) nAreaId = m_nAreaId @@ -2236,10 +2233,13 @@ Public Class Sash If nSashQty = 1 Then ' creo anta Dim tf = EgtLuaSetGlobIntVar("WDG.AREAID", nAreaId) - Dim tg = EgtLuaSetGlobIntVar("WDG.JOINTBL", m_JointList(0).SelJointType) - Dim th = EgtLuaSetGlobIntVar("WDG.JOINTBR", m_JointList(1).SelJointType) - Dim tj = EgtLuaSetGlobIntVar("WDG.JOINTTR", m_JointList(2).SelJointType) - Dim tkt = EgtLuaSetGlobIntVar("WDG.JOINTTL", m_JointList(3).SelJointType) + For nJointIndex = 0 To m_JointList.Count - 1 + Dim tg = EgtLuaSetGlobIntVar("WDG.JOINT" & nJointIndex + 1, m_JointList(nJointIndex).SelJointType) + Next + 'Dim tg = EgtLuaSetGlobIntVar("WDG.JOINTBL", m_JointList(0).SelJointType) + 'Dim th = EgtLuaSetGlobIntVar("WDG.JOINTBR", m_JointList(1).SelJointType) + 'Dim tj = EgtLuaSetGlobIntVar("WDG.JOINTTR", m_JointList(2).SelJointType) + 'Dim tkt = EgtLuaSetGlobIntVar("WDG.JOINTTL", m_JointList(3).SelJointType) Dim tft = EgtLuaSetGlobIntVar("WDG.SASHTYPE", m_SashType) Dim tfr = EgtLuaSetGlobIntVar("WDG.OPENINGTYPE", m_SashList(0).SelOpeningType.Id) Dim tlt = EgtLuaCallFunction("WinCreate_AddSash") @@ -2325,10 +2325,13 @@ Public Class Sash ' creo ante For nSashIndex = 0 To m_SashList.Count - 1 Dim tf = EgtLuaSetGlobIntVar("WDG.AREAID", Area.AreaList(nSashIndex).nAreaId) - Dim tg = EgtLuaSetGlobIntVar("WDG.JOINTBL", m_JointList(0).SelJointType) - Dim th = EgtLuaSetGlobIntVar("WDG.JOINTBR", m_JointList(1).SelJointType) - Dim tj = EgtLuaSetGlobIntVar("WDG.JOINTTR", m_JointList(2).SelJointType) - Dim tkt = EgtLuaSetGlobIntVar("WDG.JOINTTL", m_JointList(3).SelJointType) + For nJointIndex = 0 To m_JointList.Count - 1 + Dim tg = EgtLuaSetGlobIntVar("WDG.JOINT" & nJointIndex + 1, m_JointList(nJointIndex).SelJointType) + Next + 'Dim tg = EgtLuaSetGlobIntVar("WDG.JOINTBL", m_JointList(0).SelJointType) + 'Dim th = EgtLuaSetGlobIntVar("WDG.JOINTBR", m_JointList(1).SelJointType) + 'Dim tj = EgtLuaSetGlobIntVar("WDG.JOINTTR", m_JointList(2).SelJointType) + 'Dim tkt = EgtLuaSetGlobIntVar("WDG.JOINTTL", m_JointList(3).SelJointType) Dim tft = EgtLuaSetGlobIntVar("WDG.SASHTYPE", FinalSashTypeList(nSashIndex)) Dim tfr = EgtLuaSetGlobIntVar("WDG.OPENINGTYPE", m_SashList(nSashIndex).SelOpeningType.Id) Dim tlt = EgtLuaCallFunction("WinCreate_AddSash") @@ -2404,7 +2407,7 @@ Public Class Sash End Function Friend Overrides Function Serialize() As JsonArea - Dim JsonSash As JsonSash = New JsonSash(m_bIsSashVertical, m_SashType, m_SelHardware.sId) + Dim JsonSash As JsonSash = New JsonSash(m_bIsSashVertical, m_SashType, m_bBottomRail, m_nBottomRailQty, m_SelHardware.sId) For Each SashDimension In SashList JsonSash.SashList.Add(SashDimension.Serialize()) Next diff --git a/EgtWindowMaker/Utility/JsonUtility.vb b/EgtWindowMaker/Utility/JsonUtility.vb index 7ca9f1e..3cd02e5 100644 --- a/EgtWindowMaker/Utility/JsonUtility.vb +++ b/EgtWindowMaker/Utility/JsonUtility.vb @@ -218,6 +218,28 @@ Public Class JsonSash End Set End Property + Private m_bBottomRail As Boolean + + Public Property BottomRail As Boolean + Get + Return m_bBottomRail + End Get + Set(value As Boolean) + m_bBottomRail = value + End Set + End Property + + Private m_nBottomRailQty As Integer = 0 + + Public Property BottomRailQty As Integer + Get + Return m_nBottomRailQty + End Get + Set(value As Integer) + m_nBottomRailQty = value + End Set + End Property + Private m_Hardware As String Public Property Hardware As String @@ -233,10 +255,12 @@ Public Class JsonSash MyBase.New(AreaTypes.SASH) End Sub - Sub New(bIsSashVertical As Boolean, SashType As SashTypes, Hardware As String) + Sub New(bIsSashVertical As Boolean, SashType As SashTypes, BottomRail As Boolean, BottomRailQty As Integer, Hardware As String) MyBase.New(AreaTypes.SASH) m_bIsSashVertical = bIsSashVertical m_SashType = SashType + m_bBottomRail = BottomRail + m_nBottomRailQty = BottomRailQty m_Hardware = Hardware End Sub @@ -245,6 +269,8 @@ Public Class JsonSash Sash.SetAreaType(AreaTypes.SASH) Sash.SetSashQty(m_SashList.Count) Sash.SetIsSashVertical(m_bIsSashVertical) + Sash.SetBottomRail(m_bBottomRail) + Sash.SetBottomRailQty(m_nBottomRailQty) Sash.AppliedDone() For SashIndex = 0 To m_SashList.Count - 1 Sash.SashList(SashIndex).SetOpeningType(m_SashList(SashIndex).OpeningType)