From d59039eae0f6876671c8532976d786a84f2c7000 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Mon, 18 May 2026 12:28:36 +0200 Subject: [PATCH] - in NestProcess correzioni in PrintDiagnosticReport --- NestProcess.lua | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/NestProcess.lua b/NestProcess.lua index 178cd7a..91df45c 100644 --- a/NestProcess.lua +++ b/NestProcess.lua @@ -99,10 +99,19 @@ function RawInventory:PrintDiagnosticReport() local dTotalScrap = 0 local dTotalUsableRemnants = 0 + -- si contano i pezzi davvero nestati + local nActualNestedParts = 0 + for i = 1, #JobPool do + if JobPool[i].bNested then + nActualNestedParts = nActualNestedParts + 1 + end + end + local nUnnestedParts = #JobPool - nActualNestedParts + for i = 1, nBeamsUsed do local Beam = self.ActiveBeams[i] dTotalStockLength = dTotalStockLength + Beam.dTotalLength - + -- Classificazione del residuo rimasto in fondo alla barra if Beam.dResidualLength >= CONFIG.MIN_USABLE_REMNANT then dTotalUsableRemnants = dTotalUsableRemnants + Beam.dResidualLength @@ -133,7 +142,16 @@ function RawInventory:PrintDiagnosticReport() EgtOutLog("==========================================================") EgtOutLog(" EGALWARE NESTING ENGINE DIAGNOSTIC ") EgtOutLog("==========================================================") - EgtOutLog(string.format("Total Parts Nested : %d", #JobPool)) + EgtOutLog(string.format("Total Parts Demanded : %d", #JobPool)) + EgtOutLog(string.format("Parts Successfully Nested: %d", nActualNestedParts)) + + -- Se ci sono pezzi rimasti fuori, spariamo un alert visibile nel log + if nUnnestedParts > 0 then + EgtOutLog(string.format("WARNING: Unnested Parts : %d <<<<<< MATERIAL SHORTAGE!", nUnnestedParts)) + else + EgtOutLog("All Parts Nested : YES (Commessa completata)") + end + EgtOutLog(string.format("Total Bars Used : %d", nBeamsUsed)) EgtOutLog(string.format("Total Material Cut : %.2f mm", dTotalPartLength)) EgtOutLog("----------------------------------------------------------")