3dPrinting :

- gestita interruzione degli script.
This commit is contained in:
SaraP
2023-02-16 10:27:46 +01:00
parent 31f27d66c1
commit 3a1dcbb822
6 changed files with 76 additions and 252 deletions
+7 -3
View File
@@ -69,8 +69,8 @@ function RunMachParamFromSWCalc.Exec()
local dStrand = EgtGetInfo( nPartId, KEY_STRAND, 'd')
local dStrandCount = EgtGetInfo( nPartId, KEY_SHELLS_NBR, 'd')
-- recupero numero di strati per progress
local nLastLayerId = EgtGetLastNameInGroup( nPartId, SLICE_LAYER .. '*')
local nLayerQty = EgtGetInfo( nLastLayerId, KEY_SLICE_NBR, 'i')
local nLastLayerId = EgtGetLastNameInGroup( nPartId, SLICE_LAYER .. '*') or GDB_ID.NULL
local nLayerQty = EgtGetInfo( nLastLayerId, KEY_SLICE_NBR, 'i') or 0
-- ciclo sui layer
local nLayerIndex = 1
local nLayerId = EgtGetFirstNameInGroup( nPartId, SLICE_LAYER .. nLayerIndex) or EgtGetFirstNameInGroup( nPartId, "__" .. SLICE_LAYER .. nLayerIndex)
@@ -210,7 +210,11 @@ function RunMachParamFromSWCalc.Exec()
EgtSetInfo( nLayerResultId, KEY_MF, dMF)
EgtSetInfo( nLayerResultId, KEY_TOTAREA, dTotLayerArea)
-- aggiorno interfaccia
EgtProcessEvents( 500 + ( nLayerIndex / nLayerQty * 100), 0)
if EgtProcessEvents( 500 + ( nLayerIndex / nLayerQty * 100), 0) == 1 then
EgtEmptyGroup( nResultLayerId)
return
end
nLayerIndex = nLayerIndex + 1
nLayerId = EgtGetFirstNameInGroup( nPartId, SLICE_LAYER .. nLayerIndex) or EgtGetFirstNameInGroup( nPartId, "__" .. SLICE_LAYER .. nLayerIndex)
end