3dPrinting :

- modifiche per nuova interfaccia ( sincronizzazione con file in R).
This commit is contained in:
SaraP
2022-09-12 12:32:50 +02:00
parent bc85b6f7a8
commit 03ed942b2f
2 changed files with 23 additions and 3 deletions
+21 -3
View File
@@ -30,6 +30,10 @@ if not nResultLayerId then
nResultLayerId = EgtGroup( GDB_ID.ROOT)
EgtSetName( nResultLayerId, LAY_TFSCALC)
end
-- recupero Speed minima e massima dalla macchina
local sMachIni = EgtGetCurrMachineDir() .. '\\' .. EgtGetCurrMachineName() .. '.ini'
local dSMin = tonumber( EgtGetStringFromIni( SEC_3DPRINTING, KEY_SPEED_MIN, 0, sMachIni))
local dSMax = tonumber( EgtGetStringFromIni( SEC_3DPRINTING, KEY_SPEED_MAX, 50000, sMachIni))
-- massimo indice di layer calcolato
local nMaxIndex = 0
-- ciclo sui pezzi
@@ -54,7 +58,7 @@ while nPartId do
-- calcolo lunghezza totale del layer
local dTotLayerLength = 0
local dTotLayerArea = 0
local nCrvId = EgtGetFirstGroupInGroup( nLayerId)
local nCrvId = EgtGetFirstNameInGroup( nLayerId, CONTOUR_GRP .. '*')
while nCrvId do
local nToolPathId = EgtGetFirstNameInGroup( nCrvId, TOOLPATH_GRP)
-- sommo lunghezze percorsi
@@ -73,7 +77,7 @@ while nPartId do
local dOffset = EgtGetInfo( nPartId, KEY_OFFSET_SLICE, 'd')
dTotCrvArea = dTotCrvArea + ( dOffset * dOuterLength)
dTotLayerArea = dTotLayerArea + dTotCrvArea
nCrvId = EgtGetNext( nCrvId)
nCrvId = EgtGetNextName( nCrvId, CONTOUR_GRP .. '*')
end
-- recupero feed del layer
local dLayerFeed = 0
@@ -114,7 +118,21 @@ while nPartId do
-- calcolo la portata
local Vf = dLayerFeed * ( ( dStrand - dSliceStep) * dSliceStep + pi * pow( dSliceStep / 2, 2)) / 1000
-- calcolo speed
local dSpeed = ( 1 + MATERIAL.K ) * pow( Vf / MATERIAL.C1, 1 / MATERIAL.C2)
local dSpeed = ( 1 + MATERIAL.K) * pow( Vf / MATERIAL.C1, 1 / MATERIAL.C2)
-- verifico se speed esce da minimo e massimo della macchina
local bSpeedOk = true
if dSpeed < dSMin then
bSpeedOk = false
dSpeed = dSMin
end
if dSpeed > dSMax then
bSpeedOk = false
dSpeed = dSMax
end
if not bSpeedOk then
dLayerFeed = ( MATERIAL.C1 * pow( ( dSpeed / ( 1 + MATERIAL.K)), MATERIAL.C2)) * 1000 / ( ( dStrand - dSliceStep) * dSliceStep + pi * pow( dSliceStep / 2, 2))
dLayerTime = dTotLayerLength / dLayerFeed * 60
end
-- scrivo info feed e speed in group toolpath
nCrvId = EgtGetFirstNameInGroup( nLayerId, CONTOUR_GRP .. '*')
while nCrvId do