DataWindow :

- in WinGetSectionsTotalLenghts ora non viene più restituita la lunghezza totale per sezione ma la lista di lunghezze associate alla sezione.
This commit is contained in:
SaraP
2025-08-07 15:44:40 +02:00
parent 275dd114c9
commit 97dd2074df
+4 -4
View File
@@ -270,7 +270,7 @@ _G.WinSetAuxGrpStatus = WinSetAuxGrpStatus
----------------------------------------------------------------------------------
local function WinGetSectionsTotalLenghts()
WDG.SECTIONS_LENGTHS = {} -- array con le sezioni
-- ogni sezione è una tabella con le seguenti chiavi : w = spessore, h = altezza, l = lunghezza totale dei tronchetti con quella sezione
-- ogni sezione è una tabella con le seguenti chiavi : w = spessore, h = altezza, l = array con le lunghezze dei pezzi di tale sezione
-- scorro tutti i pezzi
local nPartId = EgtGetFirstPart()
while nPartId do
@@ -286,13 +286,13 @@ local function WinGetSectionsTotalLenghts()
-- verfico se devo aggiornare sezione già presente o se devo aggiungerla
local bFound = false
for i = 1, #WDG.SECTIONS_LENGTHS do
if ( abs( WDG.SECTIONS_LENGTHS[i].w - dWidth) < GEO.EPS_SMALL and abs( WDG.SECTIONS_LENGTHS[i].h - dHeight) < GEO.EPS_SMALL) then
if ( abs( WDG.SECTIONS_LENGTHS[i].W - dWidth) < GEO.EPS_SMALL and abs( WDG.SECTIONS_LENGTHS[i].H - dHeight) < GEO.EPS_SMALL) then
bFound = true
WDG.SECTIONS_LENGTHS[i].l = WDG.SECTIONS_LENGTHS[i].l + dLen
table.insert( WDG.SECTIONS_LENGTHS[i].L, dLen)
end
end
if not bFound then
table.insert( WDG.SECTIONS_LENGTHS, { W = dWidth, H = dHeight, L = dLen})
table.insert( WDG.SECTIONS_LENGTHS, { W = dWidth, H = dHeight, L = {dLen}})
end
end
end