From 398b52cbae7a3c959de4e8c826936125be8c9f38 Mon Sep 17 00:00:00 2001 From: SaraP Date: Thu, 3 Apr 2025 14:50:05 +0200 Subject: [PATCH] DataWindow : - gestione soglia - aggiunti zoccoli per ante - aggiunte funzioni ausiliarie per il programma. --- Designing/WinConst.lua | 18 +- Designing/WinLib/WinCalculate.lua | 285 +++++++++++++++++++----------- Designing/WinLib/WinCreate.lua | 18 +- Designing/WinProject.lua | 100 +++++++++-- 4 files changed, 298 insertions(+), 123 deletions(-) diff --git a/Designing/WinConst.lua b/Designing/WinConst.lua index bd6f068..b9c1dcc 100644 --- a/Designing/WinConst.lua +++ b/Designing/WinConst.lua @@ -50,6 +50,13 @@ WIN_CHILDREN_TYPES = { MIXED = 3, } +WIN_THRESHOLD_TYPES = { + NULL = 0, + ALU = 1, -- soglia + WOOD = 2, -- legno + WOOD_ALU = 3, -- gocciolatoio in alluminio +} + WIN_SURF_APPROX = 0.05 @@ -155,6 +162,7 @@ WIN_SPLIT_STARTINTERS = 'SplitStartInters' WIN_SPLIT_ENDINTERS = 'SplitEndInters' WIN_SASH_CHILDREN = 'SashChildren' WIN_FILL_CHILDREN = 'FillChildren' +WIN_THRESHOLD_PROFILE = 'ThresholdProfile' -- PROFILI @@ -165,6 +173,7 @@ WIN_INFO_GRP = 'Info' -- nomi dei profili WIN_SASH_TOP = 'Sash_Top' WIN_SASH_BOTTOM = 'Sash_Bottom' +WIN_FIXED = 'Fixed' WIN_FIXED_TOP = 'Fixed_Top' WIN_FIXED_BOTTOM = 'Fixed_Bottom' WIN_RAIL_BOTTOM = 'Rail_Bottom' @@ -176,6 +185,7 @@ WIN_SASH_HORIZONTAL = 'Sash_Horizontal' WIN_MIXED_BOTTOM = 'Mixed_Bottom' WIN_MIXED_TOP = 'Mixed_Top' WIN_MIXED_SPLIT = 'Mixed_Split' +WIN_SASH_THRESHOLD = 'Sash_Threshold' WIN_FRAME_TOP = 'Frame_Top' WIN_FRAME_BOTTOM = 'Frame_Bottom' @@ -185,11 +195,12 @@ WIN_FRENCH_IN = 'French_In' WIN_FRENCH_OUT = 'French_Out' WIN_SASH_SPLIT = 'Sash_Split' +WIN_SLIDE = 'Slide' +WIN_SLIDE_MOVABLEBACK = 'Slide_MovableBack' WIN_SLIDE_TOP = 'Slide_Top' WIN_SLIDE_BOTTOM = 'Slide_Bottom' WIN_SLIDE_MOVABLE = 'Slide_Movable' WIN_SLIDE_FIXED = 'Slide_Fixed' -WIN_SLIDE_BOTTOM_MOVABLEBACK = 'Slide_Bottom_MovableBack' WIN_SLIDE_MOVABLE_TOP = 'Slide_Movable_Top' WIN_SLIDE_MOVABLE_BOTTOM = 'Slide_Movable_Bottom' WIN_SLIDE_MOVABLE_BACK_TOP = 'Slide_MovableBack_Top' @@ -213,8 +224,9 @@ WIN_OUTOFST = 'OfstOut' WIN_MIXED_COMMON = 'Common' WIN_SIMPLIFIED = 'Simplified' WIN_STRIP = 'Strip' -WIN_ALU = 'Alu' +WIN_WATERDRIP = 'Waterdrip' WIN_GASKET = 'Gasket' +WIN_THRESHOLD = 'Threshold' -- info sui profili WIN_SASH_TOP_OVERLAP = 'SashTopOverlap' @@ -227,7 +239,6 @@ WIN_RAILDELTA = 'RailDelta' -- per ferramenta WIN_GAPDELTA = 'GapDelta' WIN_GAPDELTAZ = 'GapDeltaZ' -WIN_GAPDELTAIN = 'GapDeltaIn' WIN_GAPDELTAOUT = 'GapDeltaOut' -- per accessori WIN_STRIP_DIST = 'StripDistance' @@ -380,6 +391,7 @@ WIN_LOGS = 'Log' WIN_GASKET_LEN = 'GasketLen' WIN_WATERDRIP = 'Waterdrip' WIN_WATERDRIP_LEN = 'WaterdripLen' +WIN_THRESHOLD_LEN = 'ThresholdLen' -- FERRAMENTA diff --git a/Designing/WinLib/WinCalculate.lua b/Designing/WinLib/WinCalculate.lua index fd22e59..ea5a730 100644 --- a/Designing/WinLib/WinCalculate.lua +++ b/Designing/WinLib/WinCalculate.lua @@ -221,7 +221,7 @@ end --------------------------------------------------------------------- -- funzione che recupera il pezzo associato ad un outline -local function FindAssociatedPart( nOutlineId) +local function FindAssociatedPart( nOutlineId, bUseBottomRail) local nCrvId = nOutlineId local nPartId = EgtGetInfo( nCrvId, WIN_REF_PART, 'i') @@ -241,10 +241,12 @@ local function FindAssociatedPart( nOutlineId) end end - -- verifico se ha bottomrail - local vBottomRailParts = EgtGetInfo( nCrvId, WIN_REF_BOTTOMRAIL_PART, 'vi') - if vBottomRailParts then - nPartId = vBottomRailParts[#vBottomRailParts] + -- se serve bottomrail verifico se presente + if bUseBottomRail then + local vBottomRailParts = EgtGetInfo( nCrvId, WIN_REF_BOTTOMRAIL_PART, 'vi') + if vBottomRailParts then + nPartId = vBottomRailParts[#vBottomRailParts] + end end return nPartId @@ -472,6 +474,10 @@ local function CalcProfileType( nAreaId) -- FRAME if nAreaType == WIN_AREATYPES.FRAME then + -- gestione soglia + local sThreshold = EgtGetInfo( nAreaId, WIN_THRESHOLD_PROFILE) or WIN_BOTTOM + local bThreshold = ( sThreshold == WIN_THRESHOLD) + -- assegno il profilo alle curve di outline local nOutlineLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_AREAOUTLINE) local nOutlineId = EgtGetFirstInGroup( nOutlineLayerId) @@ -480,18 +486,29 @@ local function CalcProfileType( nAreaId) -- recupero il tipo dei figli local nChildrenType = GetChildrenType( nOutlineId) - -- a) se non definiti gestisco come anta + -- a) se non definiti gestisco come anta o fixed if nChildrenType == WIN_CHILDREN_TYPES.NULL then - EgtRemoveInfo( nOutlineLayerId, WIN_BOTTOMRAIL) - if sName == WIN_BOTTOM then - EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SASH_BOTTOM) + local nBottomRail = EgtGetInfo( nAreaId, WIN_BOTTOMRAIL, 'i') or 0 + if nBottomRail > 0 then + -- se bottomrail gestisco come fixed + bThreshold = false + if sName == WIN_BOTTOM then + EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_RAIL .. '_' .. sThreshold) + else + EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_FIXED_TOP) + end else - EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SASH_TOP) + -- se no bottomrail gestisco come anta + if sName == WIN_BOTTOM then + EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SASH .. '_' .. sThreshold) + else + EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SASH_TOP) + end end - + -- b) se anta elseif nChildrenType == WIN_CHILDREN_TYPES.SASH then - EgtRemoveInfo( nOutlineLayerId, WIN_BOTTOMRAIL) + EgtRemoveInfo( nAreaId, WIN_BOTTOMRAIL) -- verifico tipologia di anta contro cui poggia local vChildren = EgtGetInfo( nOutlineId, WIN_SASH_CHILDREN, 'vi') local nSashArea = EgtGetParent( EgtGetParent( vChildren[1])) @@ -499,16 +516,16 @@ local function CalcProfileType( nAreaId) -- b1) alzante scorrevole if nSashType == WIN_SASHTYPES.SLIDE_MOVABLE or nSashType == WIN_SASHTYPES.SLIDE_FIXED or nSashType == WIN_SASHTYPES.SLIDE_MOVABLE_BACK then if sName == WIN_BOTTOM then - EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SLIDE_BOTTOM) + EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SLIDE .. '_' .. sThreshold) -- se le ante contro cui poggia sono tutte mobili devo aggiornare il profilo if nSashType == WIN_SASHTYPES.SLIDE_MOVABLE_BACK then - EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SLIDE_BOTTOM_MOVABLEBACK) + EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SLIDE_MOVABLEBACK .. '_' .. sThreshold) elseif nSashType == WIN_SASHTYPES.SLIDE_MOVABLE then for i = 2, #vChildren do local nSashArea = EgtGetParent( EgtGetParent( vChildren[i])) local nSashType = EgtGetInfo( nSashArea, WIN_SASHTYPE, 'i') or WIN_SASHTYPES.NULL if nSashType == WIN_SASHTYPES.SLIDE_MOVABLE_BACK then - EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SLIDE_BOTTOM_MOVABLEBACK) + EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SLIDE_MOVABLEBACK .. '_' .. sThreshold) break elseif nSashType == WIN_SASHTYPES.SLIDE_FIXED then break @@ -527,7 +544,7 @@ local function CalcProfileType( nAreaId) -- b2) standard else if sName == WIN_BOTTOM then - EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SASH_BOTTOM) + EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SASH .. '_' .. sThreshold) else EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SASH_TOP) end @@ -535,13 +552,14 @@ local function CalcProfileType( nAreaId) -- c) se riempimento elseif nChildrenType == WIN_CHILDREN_TYPES.FILL then + bThreshold = false if sName == WIN_BOTTOM then -- verifico presenza bottomrail - local nBottomRail = EgtGetInfo( nOutlineLayerId, WIN_BOTTOMRAIL, 'i') or 0 + local nBottomRail = EgtGetInfo( nAreaId, WIN_BOTTOMRAIL, 'i') or 0 if nBottomRail == 0 then - EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_FIXED_BOTTOM) + EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_FIXED .. '_' .. sThreshold) else - EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_RAIL_BOTTOM) + EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_RAIL .. '_' .. sThreshold) end else EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_FIXED_TOP) @@ -549,7 +567,8 @@ local function CalcProfileType( nAreaId) -- d) se cambio profilo elseif nChildrenType == WIN_CHILDREN_TYPES.MIXED then - EgtRemoveInfo( nOutlineLayerId, WIN_BOTTOMRAIL) + EgtRemoveInfo( nAreaId, WIN_BOTTOMRAIL) + bThreshold = false EgtSetInfo( nOutlineId, WIN_PRF_CHANGE, true) if sName == WIN_BOTTOM then EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_MIXED_BOTTOM) @@ -559,6 +578,10 @@ local function CalcProfileType( nAreaId) end nOutlineId = EgtGetNext( nOutlineId) end + -- assegno info soglia + if bThreshold then + EgtSetInfo( nAreaId, WIN_THRESHOLD, true) + end -- verifico se ci sono split e ne assegno il profilo local nSplitLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_BASESPLIT) @@ -587,7 +610,13 @@ local function CalcProfileType( nAreaId) -- se non è definita tipologia if nSashType == WIN_SASHTYPES.NULL then if sName == WIN_BOTTOM then - EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_FRAME_BOTTOM) + -- verifico se bottomrail + local nBottomRail = EgtGetInfo( nAreaId, WIN_BOTTOMRAIL, 'i') or 0 + if nBottomRail == 0 then + EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_FRAME_BOTTOM) + else + EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_RAIL_BOTTOM) + end else EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_FRAME_TOP) end @@ -723,7 +752,6 @@ local function CalculateOutlineFromAreaOutline( nAreaId) EgtSetName( nOutlineLayerId, WIN_OUTLINE) EgtSetStatus( nOutlineLayerId, GDB_ST.OFF) CopyInfo( nOutlineLayerId, nAreaOutlineLayerId, WIN_JOINTS) - CopyInfo( nOutlineLayerId, nAreaOutlineLayerId, WIN_BOTTOMRAIL) -- FRAME if nAreaType == WIN_AREATYPES.FRAME then @@ -733,9 +761,10 @@ local function CalculateOutlineFromAreaOutline( nAreaId) local nOutlineId = EgtCopyGlob( nAreaOutlineId, nOutlineLayerId) EgtSetInfo( nAreaOutlineId, WIN_COPY, nOutlineId) EgtSetInfo( nOutlineId, WIN_COPY, nAreaOutlineId) - -- se bottom riporto informazione dei bottomrail + -- se bottom riporto informazione dei bottomrail e soglia if EgtGetName( nOutlineId) == WIN_BOTTOM then - CopyInfo( nOutlineId, nOutlineLayerId, WIN_BOTTOMRAIL) + CopyInfo( nOutlineId, nAreaId, WIN_BOTTOMRAIL) + CopyInfo( nOutlineId, nAreaId, WIN_THRESHOLD) end nAreaOutlineId = EgtGetNext( nAreaOutlineId) end @@ -852,9 +881,13 @@ local function CalculateOutlineFromAreaOutline( nAreaId) EgtSetInfo( nBaseOutlineId, WIN_COPY, nOutlineId) EgtSetInfo( nOutlineId, WIN_COPY, nBaseOutlineId) EgtSetInfo( nOutlineId, WIN_PROFILETYPE, sSashProfile) + if EgtGetName( nOutlineId) == WIN_BOTTOM then + CopyInfo( nOutlineId, nAreaId, WIN_BOTTOMRAIL) + end EgtRemoveInfo( nOutlineId, WIN_PRF_CHANGE) EgtRemoveInfo( nOutlineId, WIN_REF_SPLIT) - + EgtRemoveInfo( nOutlineId, WIN_THRESHOLD) + -- verifico se outline e' segmento battente o ricevente ( che quindi deriva da split di tipo french) local bOnFrenchSplit = EgtGetInfo( nBaseOutlineId, WIN_CRV_ON_FRENCH_SPLIT, 'b') or false @@ -1036,7 +1069,7 @@ local function GetSplitOtherOutline( nSplitId, nSurfSplit, nOutlineId, bPrevOrNe end -- recupero il geo associato e costruisco superficie test - local nPartId = FindAssociatedPart( nCrv) + local nPartId = FindAssociatedPart( nCrv, true) local nGeoId = EgtGetFirstNameInGroup( nPartId, WIN_GEO) local nGeoOut = EgtGetFirstNameInGroup( nGeoId, WIN_GEO_OUT) local nGeoIn = EgtGetFirstNameInGroup( nGeoId, WIN_GEO_IN) @@ -1491,10 +1524,17 @@ local function CalcFrameGeo( nPartId, nOutlineId, nOutlineCrvNbr, nOutlineLayerI nProfileTypeE = WIN_PRF.LEFT end end - + -- calcolo il tipo di giunzione per la parte local nStartPartJointType = CalcPartJointType( nProfileTypeS, nStartJointType) local nEndPartJointType = CalcPartJointType( nProfileTypeE, nEndJointType) + -- nel caso di incontro con soglia la giunzione deve essere full + if EgtGetInfo( vPrevOutlineId[1], WIN_THRESHOLD, 'b') then + nStartPartJointType = WIN_JNT.FULL + end + if EgtGetInfo( vNextOutlineId[1], WIN_THRESHOLD, 'b') then + nEndPartJointType = WIN_JNT.FULL + end -- salvo il valore di start joint su outline per calcolo dowels -- se bottomrail è sicuramente short quindi non salvo il valore che sovrascriverebbe quello del pezzo bottom ( che potrebbe essere short o full) @@ -2605,6 +2645,11 @@ end -- funzione che calcola i dowels tra due pezzi local function CalcDowels( nOrigOutlineId, nOrigPrevOutlineId, bSashOrFrame, nBottomRail) + -- se soglia non ci sono dowels + if EgtGetInfo( nOrigOutlineId, WIN_THRESHOLD, 'b') or EgtGetInfo( nOrigPrevOutlineId, WIN_THRESHOLD, 'b') then + return + end + -- recupero i pezzi local nPart = EgtGetInfo( nOrigOutlineId, WIN_REF_PART, 'i') local nPrevPart = EgtGetInfo( nOrigPrevOutlineId, WIN_REF_PART, 'i') @@ -2698,8 +2743,8 @@ local function CalcDowels( nOrigOutlineId, nOrigPrevOutlineId, bSashOrFrame, nBo -- superficie test per il posizionamento dei dowels : è la superficie in del pezzo full local nTestSurf if not s_bCalcSolid or s_bSimplSolid then - local sCtrIn = WIN_OFST .. GetProfileCtrIn( nOutlineId, nPrevOutlineId, nProfileId) -- controprofilo in del pezzo corrente - nTestSurf = CreateProfileSurf( nOutlineId, nProfileId, sCtrIn, 100, nLayerId) + local sCtrIn = WIN_OFST .. GetProfileCtrIn( nOrigOutlineId, nPrevOutlineId, nProfileId) -- controprofilo in del pezzo corrente + nTestSurf = CreateProfileSurf( nOrigOutlineId, nProfileId, sCtrIn, 100, nLayerId) else -- è la superficie che viene utilizzata per trimmare l'end del pezzo prev local nOrigSurf = EgtGetFirstNameInGroup( nPrevSolidLay, WIN_SRF_END) @@ -2713,7 +2758,7 @@ local function CalcDowels( nOrigOutlineId, nOrigPrevOutlineId, bSashOrFrame, nBo if bSashOrFrame then -- se anta la superficie da cui non fuoriuscire è quella esterna del pezzo short, ovvero la superficie usata per trimmare lo start del pezzo corrente if not s_bCalcSolid or s_bSimplSolid then - nTestSurf2 = CreateProfileSurf( nPrevOutlineId, nPrevProfileId, WIN_OFST .. WIN_OUT, 100, nLayerId) + nTestSurf2 = CreateProfileSurf( nOrigPrevOutlineId, nPrevProfileId, WIN_OFST .. WIN_OUT, 100, nLayerId) else local nOrigSurf = EgtGetFirstNameInGroup( nSolidLay, WIN_SRF_START) nTestSurf2 = EgtCopyGlob( nOrigSurf, nLayerId) @@ -2721,31 +2766,30 @@ local function CalcDowels( nOrigOutlineId, nOrigPrevOutlineId, bSashOrFrame, nBo EgtInvertSurf( nTestSurf2) else -- se telaio la superficie da cui non fuoriuscire è quella interna del pezzo short - local sCtrIn2 = WIN_OFST .. GetProfileCtrIn( nPrevOutlineId, nOutlineId, nPrevProfileId) - nTestSurf2 = CreateProfileSurf( nPrevOutlineId, nPrevProfileId, sCtrIn2, 100, nLayerId) + local sCtrIn2 = WIN_OFST .. GetProfileCtrIn( nOrigPrevOutlineId, nOutlineId, nPrevProfileId) + nTestSurf2 = CreateProfileSurf( nOrigPrevOutlineId, nPrevProfileId, sCtrIn2, 100, nLayerId) end -- direzione per la traslazione dei dowels local vtMove = EgtIf( bSashOrFrame, - frDest:getVersX(), frDest:getVersX()) -- analizzo le singole file di dowels - for k = 1, 3 do + for k = 0, 3 do -- recupero i dowels della fila k-esima local vDowels = EgtGetNameInGroup( nPrevProfileId, WIN_DOWEL .. 'Row' .. tostring( k)) - if #vDowels == 0 then - break - end - -- recupero il dowel nella posizione più problematica ( per le ante è quello più esterno, per il telaio quello più interno) - local nDowelRef = EgtIf( bSashOrFrame, vDowels[1], vDowels[#vDowels]) - -- calcolo correzione da applicare al frame affinchè i dowels non fuoriescano da un lato visibile ( esterno per ante ed interno per telaio) - local dMove = CalcDowelFrameCorrection( nOutlineId, nPrevOutlineId, nDowelRef, frOrig, frDest, nTestSurfInverted, nTestSurf, nTestSurf2, vtMove, nLayerId, sLenKey, sPrevLenKey) - local frDestDowel = Frame3d( frDest) - frDestDowel:move( dMove * vtMove) - for i = 1, #vDowels do - -- dowels per pezzo corrente ( full) - CreateDowel( vDowels[i], nLayerId, frOrig, frDestDowel, - frDestDowel:getVersZ(), nTestSurfInverted, sLenKey, WIN_PRC_SIDETYPE.IN, nSolidId) - -- dowels per prezzo precedente ( short) - CreateDowel( vDowels[i], nPrevLayerId, frOrig, frDestDowel, frDestDowel:getVersZ(), nTestSurf, sPrevLenKey, WIN_PRC_SIDETYPE.RIGHT, nPrevSolidId) + if #vDowels > 0 then + -- recupero il dowel nella posizione più problematica ( per le ante è quello più esterno, per il telaio quello più interno) + local nDowelRef = EgtIf( bSashOrFrame, vDowels[1], vDowels[#vDowels]) + -- calcolo correzione da applicare al frame affinchè i dowels non fuoriescano da un lato visibile ( esterno per ante ed interno per telaio) + local dMove = CalcDowelFrameCorrection( nOutlineId, nPrevOutlineId, nDowelRef, frOrig, frDest, nTestSurfInverted, nTestSurf, nTestSurf2, vtMove, nLayerId, sLenKey, sPrevLenKey) + local frDestDowel = Frame3d( frDest) + frDestDowel:move( dMove * vtMove) + for i = 1, #vDowels do + -- dowels per pezzo corrente ( full) + CreateDowel( vDowels[i], nLayerId, frOrig, frDestDowel, - frDestDowel:getVersZ(), nTestSurfInverted, sLenKey, WIN_PRC_SIDETYPE.IN, nSolidId) + -- dowels per prezzo precedente ( short) + CreateDowel( vDowels[i], nPrevLayerId, frOrig, frDestDowel, frDestDowel:getVersZ(), nTestSurf, sPrevLenKey, WIN_PRC_SIDETYPE.RIGHT, nPrevSolidId) + end end end @@ -2779,8 +2823,8 @@ local function CalcDowels( nOrigOutlineId, nOrigPrevOutlineId, bSashOrFrame, nBo -- è il controprofilo in del pezzo full quindi è la stessa superficie che viene utilizzata per trimmare lo start del pezzo corrente local nTestSurf if not s_bCalcSolid or s_bSimplSolid then - local sCtrIn = WIN_OFST .. GetProfileCtrIn( nPrevOutlineId, nOutlineId, nPrevProfileId) -- controprofilo del pezzo full - nTestSurf = CreateProfileSurf( nPrevOutlineId, nPrevProfileId, sCtrIn, 100, nLayerId) + local sCtrIn = WIN_OFST .. GetProfileCtrIn( nOrigPrevOutlineId, nOutlineId, nPrevProfileId) -- controprofilo del pezzo full + nTestSurf = CreateProfileSurf( nOrigPrevOutlineId, nPrevProfileId, sCtrIn, 100, nLayerId) else local nOrigSurf = EgtGetFirstNameInGroup( nSolidLay, WIN_SRF_START) nTestSurf = EgtCopyGlob( nOrigSurf, nLayerId) @@ -2792,7 +2836,7 @@ local function CalcDowels( nOrigOutlineId, nOrigPrevOutlineId, bSashOrFrame, nBo local nTestSurf2 if bSashOrFrame then if not s_bCalcSolid or s_bSimplSolid then - nTestSurf2 = CreateProfileSurf( nOutlineId, nProfileId, WIN_OFST .. WIN_OUT, 100, nLayerId) + nTestSurf2 = CreateProfileSurf( nOrigOutlineId, nProfileId, WIN_OFST .. WIN_OUT, 100, nLayerId) else local nOrigSurf = EgtGetFirstNameInGroup( nPrevSolidLay, WIN_SRF_END) nTestSurf2 = EgtCopyGlob( nOrigSurf, nLayerId) @@ -2800,30 +2844,29 @@ local function CalcDowels( nOrigOutlineId, nOrigPrevOutlineId, bSashOrFrame, nBo EgtInvertSurf( nTestSurf2) else local sCtrIn2 = WIN_OFST .. GetProfileCtrIn( nOutlineId, nPrevOutlineId, nProfileId) -- controprofilo del pezzo short - nTestSurf2 = CreateProfileSurf( nOutlineId, nProfileId, sCtrIn2, 100, nLayerId) + nTestSurf2 = CreateProfileSurf( nOrigOutlineId, nProfileId, sCtrIn2, 100, nLayerId) end -- direzione per la traslazione dei dowels local vtMove = EgtIf( bSashOrFrame, - frDest:getVersX(), frDest:getVersX()) -- analizzo le singole file di dowels - for k = 1, 3 do + for k = 0, 3 do -- recupero i dowels sulla fila k-esima local vDowels = EgtGetNameInGroup( nProfileId, WIN_DOWEL .. 'Row' .. tostring(k)) - if #vDowels == 0 then - break - end - -- recupero il dowel nella posizione più problematica ( per le ante è quello più esterno, per il telaio quello più interno) - local nDowelRef = EgtIf( bSashOrFrame, vDowels[1], vDowels[#vDowels]) - -- calcolo correzione da applicare al frame affinchè i dowels non fuoriescano da un lato visibile ( esterno per ante ed interno per telaio) - local dMove = CalcDowelFrameCorrection( nOutlineId, nPrevOutlineId, nDowelRef, frOrig, frDest, nTestSurf, nTestSurfInverted, nTestSurf2, vtMove, nLayerId, sLenKey, sPrevLenKey) - local frDestDowel = Frame3d( frDest) - frDestDowel:move( dMove * vtMove) - for i = 1, #vDowels do - -- dowels per pezzo corrente ( short) - CreateDowel( vDowels[i], nLayerId, frOrig, frDestDowel, - frDestDowel:getVersZ(), nTestSurf, sLenKey, WIN_PRC_SIDETYPE.LEFT, nSolidId) - -- dowels per prezzo precedente ( full) - CreateDowel( vDowels[i], nPrevLayerId, frOrig, frDestDowel, frDestDowel:getVersZ(), nTestSurfInverted, sPrevLenKey, WIN_PRC_SIDETYPE.IN, nPrevSolidId) + if #vDowels > 0 then + -- recupero il dowel nella posizione più problematica ( per le ante è quello più esterno, per il telaio quello più interno) + local nDowelRef = EgtIf( bSashOrFrame, vDowels[1], vDowels[#vDowels]) + -- calcolo correzione da applicare al frame affinchè i dowels non fuoriescano da un lato visibile ( esterno per ante ed interno per telaio) + local dMove = CalcDowelFrameCorrection( nOutlineId, nPrevOutlineId, nDowelRef, frOrig, frDest, nTestSurf, nTestSurfInverted, nTestSurf2, vtMove, nLayerId, sLenKey, sPrevLenKey) + local frDestDowel = Frame3d( frDest) + frDestDowel:move( dMove * vtMove) + for i = 1, #vDowels do + -- dowels per pezzo corrente ( short) + CreateDowel( vDowels[i], nLayerId, frOrig, frDestDowel, - frDestDowel:getVersZ(), nTestSurf, sLenKey, WIN_PRC_SIDETYPE.LEFT, nSolidId) + -- dowels per prezzo precedente ( full) + CreateDowel( vDowels[i], nPrevLayerId, frOrig, frDestDowel, frDestDowel:getVersZ(), nTestSurfInverted, sPrevLenKey, WIN_PRC_SIDETYPE.IN, nPrevSolidId) + end end end @@ -2875,10 +2918,12 @@ local function CalcSplitDowels( nSplitId, vOutlines, bStartOrEnd) local ptRef = EgtIf( bStartOrEnd, EgtSP( nSplitId), EgtEP( nSplitId)) - for i = 1, #vOutlines do - + -- se il bottom è soglia va ignorato + local nStartIdx = EgtIf( EgtGetInfo( vOutlines[1], WIN_THRESHOLD, 'b'), 2, 1) + for i = nStartIdx, #vOutlines do + -- recupero il pezzo associato e il suo outline di riferimento - local nPartId = FindAssociatedPart( vOutlines[i]) + local nPartId = FindAssociatedPart( vOutlines[i], true) local nOutlineId = EgtGetInfo( nPartId, WIN_REF_OUTLINE, 'i') local nProfileType = GetOutlineProfileType( nOutlineId, true) @@ -3006,7 +3051,7 @@ local function CalculateAreaDowels( nAreaId) local nOutlineLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_OUTLINE) if nAreaType == WIN_AREATYPES.FRAME or nAreaType == WIN_AREATYPES.SASH then -- verifico se presente bottomrail - local nBottomRails = EgtGetInfo( nOutlineLayerId, WIN_BOTTOMRAIL, 'i') or 0 + local nBottomRails = EgtGetInfo( nAreaId, WIN_BOTTOMRAIL, 'i') or 0 -- aggiungo le spine sui pezzi dell'area local nOutline = EgtGetFirstInGroup( nOutlineLayerId) local nPrevOutline = EgtGetLastInGroup( nOutlineLayerId) @@ -3116,7 +3161,7 @@ end local function CreateStripFromOutline( nAreaId, nOutlineId) -- recupero il pezzo associato ( prendendo quello di bottomrail se esiste) - local nPartId = FindAssociatedPart( nOutlineId) + local nPartId = FindAssociatedPart( nOutlineId, true) -- recupero layer per solido e per profili di estrusione local nSolidLayerId = EgtGetFirstNameInGroup( nPartId, WIN_SOLID) @@ -3125,8 +3170,8 @@ local function CreateStripFromOutline( nAreaId, nOutlineId) local vPrevOutlineId, vNextOutlineId = GetPrevNextOutline( WIN_PRF.NULL, nOutlineId, nOutlineLayerId) -- recupero i pezzi precedente e successivo, prendendo eventualmente quelli di bottomrail - local nPrevPartId = FindAssociatedPart( vPrevOutlineId[1]) - local nNextPartId = FindAssociatedPart( vNextOutlineId[1]) + local nPrevPartId = FindAssociatedPart( vPrevOutlineId[1], true) + local nNextPartId = FindAssociatedPart( vNextOutlineId[1], true) -- recupero profilo e controprofili local nMainProfileLayerId = EgtGetFirstNameInGroup( nPartId, WIN_PROFILE) @@ -3357,6 +3402,12 @@ end -- funzione che calcola l'ingombro dei pezzi del telaio e i loro solidi local function CreatePartFromOutline( nAreaLayerId, sName, nOutlineId, nOutlineCrvNbr, nBottomRail) + -- se soglia ignoro + local bThreshold = EgtGetInfo( nOutlineId or GDB_ID.NULL, WIN_THRESHOLD, 'b') or false + if bThreshold then + return + end + -- creo pezzo local nPartId = EgtGroup( GDB_ID.ROOT) -- inserisco riferimento alla sua area @@ -3455,7 +3506,7 @@ local function CalculateAreaParts( nAreaId) CreatePartFromOutline( nAreaId, sName, vOutlines[i], i) -- se di tipo bottom verifico se ha bottomrail if EgtGetName( vOutlines[i]) == WIN_BOTTOM then - local nBottomRail = EgtGetInfo( nOutlineLayerId, WIN_BOTTOMRAIL, 'i') or 0 + local nBottomRail = EgtGetInfo( nAreaId, WIN_BOTTOMRAIL, 'i') or 0 for j = 1, nBottomRail do CreatePartFromOutline( nAreaId, sName, vOutlines[i], i, j) end @@ -4166,19 +4217,11 @@ local function DrawHinges( nOutlineId, nSolidLayerId) local dDimV = 70 local dFilletRad = 5 - -- recupero il pezzo del telaio su cui poggia - local nSouId = EgtGetInfo( nOutlineId, WIN_COPY, 'i') - local nParentAreaType = WIN_AREATYPES.SASH - while nParentAreaType ~= WIN_AREATYPES.FRAME do - nSouId = EgtGetInfo( nSouId, WIN_SOU, 'i') - local nParentArea = EgtGetParent( EgtGetParent( nSouId)) - nParentAreaType = EgtGetInfo( nParentArea, WIN_AREATYPE, 'i') - end - local nSouOutlineId = EgtGetInfo( nSouId, WIN_COPY, 'i') - local nPartId = EgtGetInfo( nSouOutlineId, WIN_REF_PART, 'i') - local nBaseOutlineId = EgtGetInfo( nOutlineId, WIN_COPY, 'i') local dDelta = ( EgtSP( nOutlineId) - EgtSP( nBaseOutlineId)) * Z_AX() + if dDelta < GEO.EPS_SMALL then + return + end local vtDir = EgtSV( nOutlineId) local vtDirIn = Vector3d( vtDir) vtDirIn:rotate( Z_AX(), -90) @@ -4217,7 +4260,7 @@ local function DrawHandle( nOutlineId, sHandleSide, dHandleH, nSolidLayerId) local dLen2 = 115 local dRadH = 12.5 local dFillet = 10 - local dOffset = 33 + local dExtraGapDelta = 15 local nPartId = EgtGetInfo( nOutlineId, WIN_REF_PART, 'i') local ptRef = EgtIf( sHandleSide == 'Sx', EgtSP( nOutlineId), EgtEP( nOutlineId)) @@ -4230,9 +4273,9 @@ local function DrawHandle( nOutlineId, sHandleSide, dHandleH, nSolidLayerId) local nProfileId = EgtGetFirstNameInGroup( nProfileLayId, EgtIf( sHandleSide == 'Sx', WIN_PRF_START, WIN_PRF_END)) local dGapHardware = EgtGetInfo( nProfileId, WIN_GAPDELTA, 'd') -- recupero di quanto spostare la maniglia rispetto all'outline - local nGeoLayId = EgtGetFirstNameInGroup( nPartId, WIN_GEO) - local nGeoOut = EgtGetFirstNameInGroup( nGeoLayId, WIN_OUT) - local dDeltaIn = dOffset - ( EgtSP( nOutlineId) - EgtSP( nGeoOut)) * vtDirIn + local nMainProfileId = EgtGetFirstNameInGroup( nProfileLayId, WIN_PRF_MAIN) + local dGapDelta = EgtGetInfo( nMainProfileId, WIN_GAPDELTA, 'd') + local dDeltaIn = dGapDelta + dExtraGapDelta -- punto su cui centrare la maniglia local ptC = ptRef + ( dHandleH + dGapHardware) * vtDir + dDeltaIn * vtDirIn @@ -4812,13 +4855,33 @@ end ---------------------------------------------------------------------------------- ----------------------------------- ACCESSORI ---------------------------------- ---------------------------------------------------------------------------------- +-- funzione che calcola e disegna la soglia +local function CalcThreshold( nOutlineId) + -- recupero il profilo della soglia + local nProfileGrp = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_PROFILE) + local nProfileLay = EgtGetFirstNameInGroup( nProfileGrp, WIN_FRAME) + local nProfileId = EgtGetFirstNameInGroup( nProfileLay, WIN_SASH_THRESHOLD) + + -- disegno + local nAuxGrp = GetAuxLayer() + local nStm = CreateProfileSurf( nOutlineId, nProfileId, WIN_THRESHOLD, 0, nAuxGrp) + EgtSetColor( nStm, Color3d( 128, 128, 128)) + EgtSetName( nStm, WIN_THRESHOLD) + + -- salvo info lunghezza + local nAreaGrp = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_AREA .. '*') + EgtSetInfo( nAreaGrp, WIN_THRESHOLD_LEN, EgtCurveLength( nOutlineId)) + +end + +--------------------------------------------------------------------- -- funzione che calcola e disegna il gocciolatoio local function CalcWaterdrip( nPartId, nOutlineId, nAreaId, bDraw) -- verifico presenza gocciolatoio local nProfileLayId = EgtGetFirstNameInGroup( nPartId, WIN_PROFILE) local nProfileId = EgtGetFirstNameInGroup( nProfileLayId, WIN_PRF_MAIN) - local nWaterdripId = EgtGetFirstNameInGroup( nProfileId, WIN_ALU) + local nWaterdripId = EgtGetFirstNameInGroup( nProfileId, WIN_WATERDRIP) if not nWaterdripId then return end @@ -4912,7 +4975,7 @@ local function CalcWaterdrip( nPartId, nOutlineId, nAreaId, bDraw) -- disegno if bDraw and s_bCalcSolid then -- estrudo la superficie - local nStm = CreateProfileSurf( nGuideId, nProfileId, WIN_ALU, 0, nSolidLayId) + local nStm = CreateProfileSurf( nGuideId, nProfileId, WIN_WATERDRIP, 0, nSolidLayId) EgtSetColor( nStm, Color3d( 128, 128, 128)) EgtSetName( nStm, WIN_WATERDRIP) end @@ -4938,13 +5001,21 @@ local function CalcGaskets( nAreaId, bDraw) local tParts = {} local vOutlines = {} for i = 1, #vOrigOutlines do - local nPartId = FindAssociatedPart( vOrigOutlines[i]) - local nProfileLayId = EgtGetFirstNameInGroup( nPartId, WIN_PROFILE) - local nMainProfileId = EgtGetFirstNameInGroup( nProfileLayId, WIN_PRF_MAIN) - local nFrameId = EgtGetFirstNameInGroup( nMainProfileId, WIN_SECTIONFRAME) - local frProfile = EgtFR( nFrameId, GDB_ID.ROOT) - tParts[i] = { nId = nPartId, nProfileId = nMainProfileId, frProfile = frProfile} - vOutlines[i] = EgtGetInfo( nPartId, WIN_REF_OUTLINE, 'i') + local bThreshold = EgtGetName( vOrigOutlines[i]) == WIN_BOTTOM and EgtGetInfo( vOrigOutlines[i], WIN_THRESHOLD, 'b') + if bThreshold then + -- gestione speciale per soglia che non ha pezzo associato + local nMainProfileId = GetOutlineProfileId( vOrigOutlines[i]) + tParts[i] = { nId = GDB_ID.NULL, nProfileId = nMainProfileId, frProfile = nil} + vOutlines[i] = vOrigOutlines[i] + else + local nPartId = FindAssociatedPart( vOrigOutlines[i], false) + local nProfileLayId = EgtGetFirstNameInGroup( nPartId, WIN_PROFILE) + local nMainProfileId = EgtGetFirstNameInGroup( nProfileLayId, WIN_PRF_MAIN) + local nFrameId = EgtGetFirstNameInGroup( nMainProfileId, WIN_SECTIONFRAME) + local frProfile = EgtFR( nFrameId, GDB_ID.ROOT) + tParts[i] = { nId = nPartId, nProfileId = nMainProfileId, frProfile = frProfile} + vOutlines[i] = EgtGetInfo( nPartId, WIN_REF_OUTLINE, 'i') + end end -- gruppo temporaneo per i conti @@ -5077,16 +5148,24 @@ function WinCalculate.AddAccessories( nAreaId, bDraw) local nAreaType = EgtGetInfo( nAreaId, WIN_AREATYPE, 'i') if nAreaType == WIN_AREATYPES.FRAME then - -- gocciolatoio local nOutlineLayId = EgtGetFirstNameInGroup( nAreaId, WIN_OUTLINE) + + -- accessori del pezzo inferiore: soglia e gocciolatioio local nBottomId = EgtGetFirstNameInGroup( nOutlineLayId, WIN_BOTTOM) - local nPartId = EgtGetInfo( nBottomId, WIN_REF_PART, 'i') - CalcWaterdrip( nPartId, nBottomId, nAreaId, bDraw) + local bThreshold = EgtGetInfo( nAreaId, WIN_THRESHOLD, 'b') or false + if bThreshold then + -- soglia + CalcThreshold( nBottomId) + else + -- gocciolatoio + local nPartId = EgtGetInfo( nBottomId, WIN_REF_PART, 'i') + CalcWaterdrip( nPartId, nBottomId, nAreaId, bDraw) + end - -- guarnizioni se definisce un french split + -- guarnizioni se definisce un french split o se definisce direttamente anta local nSplitId = EgtGetFirstNameInGroup( nAreaId, WIN_SPLIT) or GDB_ID.NULL local nSplitType = EgtGetInfo( nSplitId, WIN_SPLITTYPE, 'i') - if nSplitType == WIN_SPLITTYPES.FRENCH then + if nSplitId == GDB_ID.NULL or nSplitType == WIN_SPLITTYPES.FRENCH then CalcGaskets( nAreaId, bDraw) end -- TODO guarnizioni per gocciolatoio diff --git a/Designing/WinLib/WinCreate.lua b/Designing/WinLib/WinCreate.lua index 3d4959d..4080bf2 100644 --- a/Designing/WinLib/WinCreate.lua +++ b/Designing/WinLib/WinCreate.lua @@ -21,13 +21,14 @@ require( 'EgtBase') require( 'WinConst') -- funzioni - +---------------------------------------------------------------------------------- local function AddInfo( nId, sInfo, nVal) local vInfo = EgtGetInfo( nId, sInfo, 'vi') or {} table.insert( vInfo, nVal) EgtSetInfo( nId, sInfo, vInfo) end +---------------------------------------------------------------------------------- -- funzione che importa il profilo function WinCreate.ImportProfile( sProfilePath) -- verifico esistenza file @@ -584,11 +585,20 @@ end ---------------------------------------------------------------------------------- -- funzione che aggiunge uno zoccolo function WinCreate.AddBottomRail( nAreaId, nNbr) + local nAreaType = EgtGetInfo( nAreaId, WIN_AREATYPE, 'i') + if nAreaType == WIN_AREATYPES.FRAME or nAreaType == WIN_AREATYPES.SASH then + EgtSetInfo( nAreaId, WIN_BOTTOMRAIL, nNbr) + end +end + +---------------------------------------------------------------------------------- +---------------------------------- SOGLIA ------------------------------------ +---------------------------------------------------------------------------------- +-- funzione che aggiunge la soglia +function WinCreate.AddThreshold( nAreaId, sThresholdProfile) local nAreaType = EgtGetInfo( nAreaId, WIN_AREATYPE, 'i') if nAreaType == WIN_AREATYPES.FRAME then - -- recupero l'outline bottom - local nBaseOutlineLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_AREAOUTLINE) - EgtSetInfo( nBaseOutlineLayerId, WIN_BOTTOMRAIL, nNbr) + EgtSetInfo( nAreaId, WIN_THRESHOLD_PROFILE, sThresholdProfile) end end diff --git a/Designing/WinProject.lua b/Designing/WinProject.lua index e3e70ba..d2a93a6 100644 --- a/Designing/WinProject.lua +++ b/Designing/WinProject.lua @@ -55,46 +55,112 @@ local function CleanVariableList( sName) end end +---------------------------------------------------------------------------------- +local function SetProfilePath() + _G.sProfilePath = WDG.PROFILEPATH +end +_G.SetProfilePath = SetProfilePath + ---------------------------------------------------------------------------------- local function WinCreate_ImportProfile() - WinCreate.ImportProfile(WDG.PROFILE) + _G.sProfile = WDG.PROFILE + WinCreate.ImportProfile( WDG.PROFILE) + -- TODO da decommentare e sostituire alla riga sopra quando la modifica è nel programma + -- if _G.sProfilePath then + -- WinCreate.ImportProfile( _G.sProfilePath .. '\\' .. WDG.PROFILE .. '.nge') + -- end end _G.WinCreate_ImportProfile = WinCreate_ImportProfile +---------------------------------------------------------------------------------- +local function FindThresholds( nGrpId) + local tThresholds = {} + local tHash = {} + -- scorro tutti i profili del telaio + local nCurrId = EgtGetFirstInGroup( nGrpId) + while nCurrId do + -- verifico se di tipo bottom + local nBottomType = EgtGetInfo( nCurrId, WIN_BOTTOM, 'i') or WIN_THRESHOLD_TYPES.NULL + if nBottomType ~= WIN_THRESHOLD_TYPES.NULL then + -- recupero il nome + local vNames = EgtSplitString( EgtGetName( nCurrId), '_') + local sName = vNames[#vNames] + if not tHash[sName] then + table.insert( tThresholds, { nType = nBottomType, sName = sName}) + tHash[sName] = 1 + end + end + nCurrId = EgtGetNext( nCurrId) + end + return tThresholds +end + +local function GetProfileThresholdsList() + local tThresholds = {} + if _G.sProfile == WDG.PROFILE then + -- se profilo corrente + local nProfileGrp = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_PROFILE) + local nFrameGrp = EgtGetFirstNameInGroup( nProfileGrp, WIN_FRAME) + tThresholds = FindThresholds( nFrameGrp) + else + -- importo temporaneamente il profilo + local nLastId = EgtGetLastInGroup( GDB_ID.ROOT) + local bOk = EgtInsertFile( _G.sProfilePath .. '\\' .. WDG.PROFILE .. '.nge') + local nCurrId = EgtGetNext( nLastId or GDB_ID.NULL) or EgtGetFirstInGroup( GDB_ID.ROOT) + while nCurrId do + if EgtGetName( nCurrId) == WIN_FRAME then + tThresholds = FindThresholds( nCurrId) + end + -- passo al successivo e cancello il corrente + local nOldId = nCurrId + nCurrId = EgtGetNext( nCurrId) + EgtErase( nOldId) + end + end + WDG.THRESHOLDSLIST = tThresholds +end +_G.GetProfileThresholdsList = GetProfileThresholdsList + ---------------------------------------------------------------------------------- local function WinCreate_CreateFrame() - local JointList = GetVariableList('JOINT') - WDG.AREAID = WinCreate.CreateFrame(WDG.FRAMETYPE, JointList, WDG.WIDTH, WDG.HEIGHT, WDG.HEIGHT2) + local JointList = GetVariableList( 'JOINT') + WDG.AREAID = WinCreate.CreateFrame( WDG.FRAMETYPE, JointList, WDG.WIDTH, WDG.HEIGHT, WDG.HEIGHT2) CleanVariableList('JOINT') end _G.WinCreate_CreateFrame = WinCreate_CreateFrame ---------------------------------------------------------------------------------- local function WinCreate_AddSash() - local JointList = GetVariableList('JOINT') + local JointList = GetVariableList( 'JOINT') WDG.AREAID = WinCreate.AddSash( WDG.AREAID, {WDG.JOINTBL, WDG.JOINTBR, WDG.JOINTTR, WDG.JOINTTL, WDG.JOINTBL}, WDG.SASHTYPE, WDG.OPENINGTYPE) - CleanVariableList('JOINT') + CleanVariableList( 'JOINT') end _G.WinCreate_AddSash = WinCreate_AddSash ---------------------------------------------------------------------------------- local function WinCreate_AddHardware() - WinCreate.AddHardware(WDG.AREAID, WDG.FAVOURITE, WDG.HANDLE) + WinCreate.AddHardware( WDG.AREAID, WDG.FAVOURITE, WDG.HANDLE) end _G.WinCreate_AddHardware = WinCreate_AddHardware ---------------------------------------------------------------------------------- local function WinCreate_AddFill() - WDG.AREAID = WinCreate.AddFill(WDG.AREAID, WDG.FILLTYPE) + WDG.AREAID = WinCreate.AddFill( WDG.AREAID, WDG.FILLTYPE) end _G.WinCreate_AddFill = WinCreate_AddFill ---------------------------------------------------------------------------------- local function WinCreate_AddBottomRail() - WinCreate.AddBottomRail(WDG.AREAID, WDG.NBR) + WinCreate.AddBottomRail( WDG.AREAID, WDG.NBR) end _G.WinCreate_AddBottomRail = WinCreate_AddBottomRail +---------------------------------------------------------------------------------- +local function WinCreate_AddThreshold() + WinCreate.AddThreshold( WDG.AREAID, WDG.THRESHOLDPROFILE) +end +_G.WinCreate_AddThreshold = WinCreate_AddThreshold + ---------------------------------------------------------------------------------- local function WinCreate_AddSplits() local AreaIndex = 1 @@ -122,31 +188,31 @@ _G.WinCreate_AddSplits = WinCreate_AddSplits ---------------------------------------------------------------------------------- local function WinCalculate_SetCalcSolid() - WinCalculate.SetCalcSolid(WDG.VALUE) + WinCalculate.SetCalcSolid( WDG.VALUE) end _G.WinCalculate_SetCalcSolid = WinCalculate_SetCalcSolid ---------------------------------------------------------------------------------- local function WinCalculate_SetSimplifiedSolid() - WinCalculate.SetSimplifiedSolid(WDG.VALUE) + WinCalculate.SetSimplifiedSolid( WDG.VALUE) end _G.WinCalculate_SetSimplifiedSolid = WinCalculate_SetSimplifiedSolid ---------------------------------------------------------------------------------- local function WinCalculate_CreatePartFromArea() - WinCalculate.CreatePartFromArea(WDG.FRAMEID) + WinCalculate.CreatePartFromArea( WDG.FRAMEID) end _G.WinCalculate_CreatePartFromArea = WinCalculate_CreatePartFromArea ---------------------------------------------------------------------------------- local function WinCalculate_AddHardware() - WinCalculate.AddHardware(WDG.FRAMEID) + WinCalculate.AddHardware( WDG.FRAMEID) end _G.WinCalculate_AddHardware = WinCalculate_AddHardware ---------------------------------------------------------------------------------- local function WinCreate_GetHardwareOptionPath() - WDG.HWDOPTPATH = WinCalculate.AddHardwareForSash(WDG.AREAID, true) + WDG.HWDOPTPATH = WinCalculate.AddHardwareForSash( WDG.AREAID, true) end _G.WinCreate_GetHardwareOptionPath = WinCreate_GetHardwareOptionPath @@ -165,3 +231,11 @@ local function WinGetImage() EgtGetImage( SCE_SM.SH, EgtStdColor('WHITE'), EgtStdColor('WHITE'), 1920, 1080, WDG.FILE) end _G.WinGetImage = WinGetImage + +---------------------------------------------------------------------------------- +local function WinSetAuxGrpStatus() + -- recupero il gruppo aux della ferramenta e accessori e assegno stato + local nAuxGrp = EgtGetFistNameInGroup( GDB_ID.ROOT, WIN_AUX) or GDB_ID.NULL + EgtSetStatus( nAuxGrp, WDG.AUXSTATUS) +end +_G.WinSetAuxGrpStatus = WinSetAuxGrpStatus