DataBeam :

- aggiunta gestione extracorse in simulazione cieca
- aggiunta configurazione per lista lavorazioni
- migliorata gestione lughezza minima barre in Process
- migliorie varie.
This commit is contained in:
Dario Sassi
2019-07-24 17:34:48 +00:00
parent 35782ae142
commit 7e3c951901
9 changed files with 112 additions and 115 deletions
+57 -81
View File
@@ -1,4 +1,4 @@
-- ProcessLongCut.lua by Egaltech s.r.l. 2019/02/15
-- ProcessLongCut.lua by Egaltech s.r.l. 2019/07/22
-- Gestione calcolo taglio longitudinale per Travi
-- Tabella per definizione modulo
@@ -83,62 +83,32 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId)
if ( bLimXmin and vtN:getY() > 0) or ( bLimXmax and vtN:getY()< 0) then
dEndDist = dToolDiam / 2
end
-- se va fatta in 3 o più parti
-- determino numero di parti
local nC = ceil( ( dLen - 2 * BD.LONGCUT_ENDLEN) / BD.LONGCUT_MAXLEN)
local dC = ( dLen - 2 * BD.LONGCUT_ENDLEN) / nC
local dAccDist = BD.LONGCUT_ENDLEN
if nC > 0 then
local dC = ( dLen - 2 * BD.LONGCUT_ENDLEN) / nC
nC = nC + 2
-- si percorre il lato basso della faccia
local nM = 0
for i = 1, nC do
-- ciclo sulle passate
local nO = 1
local dStep = 0
if dWidth + 2 * BD.CUT_EXTRA > dToolDiam then
nO = ceil(( dWidth + 2 * BD.CUT_EXTRA) / dToolDiam)
if nO > 1 then
dStep = ( dWidth + 2 * BD.CUT_EXTRA - dToolDiam) / ( nO - 1)
end
end
for k = nO, 1, -1 do
-- inserisco le parti di lavorazione
nM = nM + 1
local sNameF = 'L2C_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( nM)
local nMchFId = EgtAddMachining( sNameF, sMilling)
if not nMchFId then
local sErr = 'Error adding machining ' .. sNameF .. '-' .. sMilling
EgtOutLog( sErr)
return false, sErr
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ Proc.Id, 0}})
-- limito opportunamente la lavorazione
local dSal = EgtIf( i == 1, -dStartDist, - BD.LONGCUT_ENDLEN - ( i - 2) * dC)
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
local dEal = EgtIf( i == nC, -dEndDist, - BD.LONGCUT_ENDLEN - ( nC - i - 1) * dC)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
-- imposto offset radiale (nullo se concavo)
if k >1 then
EgtSetMachiningParam( MCH_MP.OFFSR, ( k - 1) * dStep)
else
EgtSetMachiningParam( MCH_MP.OFFSR, - BD.CUT_EXTRA)
end
-- eseguo
if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchFId, false)
return false, sErr
end
end
end
-- altrimenti una o due parti
else
nC = EgtIf( dLen > BD.LONGCUT_ENDLEN, 2, 1)
local dAccDist = EgtIf( nC == 2, dLen / 2, 0)
-- si percorre il lato basso della faccia
for i = 1, nC do
dAccDist = EgtIf( nC == 2, dLen / 2, 0)
end
-- si percorre il lato basso della faccia
local nM = 0
for i = 1, nC do
-- ciclo sulle passate
local nO = 1
local dStep = 0
if dWidth + 2 * BD.CUT_EXTRA > dToolDiam then
nO = ceil(( dWidth + 2 * BD.CUT_EXTRA) / dToolDiam)
if nO > 1 then
dStep = ( dWidth + 2 * BD.CUT_EXTRA - dToolDiam) / ( nO - 1)
end
end
for k = nO, 1, -1 do
-- inserisco le parti di lavorazione
local sNameF = 'L2C_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
nM = nM + 1
local sNameF = 'L2C_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( nM)
local nMchFId = EgtAddMachining( sNameF, sMilling)
if not nMchFId then
local sErr = 'Error adding machining ' .. sNameF .. '-' .. sMilling
@@ -148,39 +118,16 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId)
-- aggiungo geometria
EgtSetMachiningGeometry( {{ Proc.Id, 0}})
-- limito opportunamente la lavorazione
local dSal = EgtIf( i == 1, -dStartDist, - dAccDist)
local dSal = EgtIf( i == 1, -dStartDist, - dAccDist - ( i - 2) * dC)
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
local dEal = EgtIf( i == nC, -dEndDist, - dAccDist)
local dEal = EgtIf( i == nC, -dEndDist, - dAccDist - ( nC - i - 1) * dC)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
-- eseguo
if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchFId, false)
return false, sErr
-- imposto offset radiale (nullo se concavo)
if k >1 then
EgtSetMachiningParam( MCH_MP.OFFSR, ( k - 1) * dStep)
else
EgtSetMachiningParam( MCH_MP.OFFSR, - BD.CUT_EXTRA)
end
end
-- se ci sono le facce limitanti
for i = 1, Proc.Fct - 1 do
-- inserisco la lavorazione
local sNameF = 'L2C_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( i)
local nMchFId = EgtAddMachining( sNameF, sMilling)
if not nMchFId then
local sErr = 'Error adding machining ' .. sNameF .. '-' .. sMilling
EgtOutLog( sErr)
return false, sErr
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ Proc.Id, i}})
-- lato di lavoro e inversione
EgtSetMachiningParam( MCH_MP.INVERT, true)
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
-- uso della faccia
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_DOWN)
-- attacco e uscita
EgtSetMachiningParam( MCH_MP.LIPERP, 0)
EgtSetMachiningParam( MCH_MP.LITANG, dToolDiam / 2 + 30)
EgtSetMachiningParam( MCH_MP.LOPERP, 0)
EgtSetMachiningParam( MCH_MP.LOTANG, dToolDiam / 2 + 30)
-- eseguo
if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
@@ -189,6 +136,35 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId)
end
end
end
-- se ci sono le facce limitanti
for i = 1, Proc.Fct - 1 do
-- inserisco la lavorazione
local sNameF = 'L2C_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( i)
local nMchFId = EgtAddMachining( sNameF, sMilling)
if not nMchFId then
local sErr = 'Error adding machining ' .. sNameF .. '-' .. sMilling
EgtOutLog( sErr)
return false, sErr
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ Proc.Id, i}})
-- lato di lavoro e inversione
EgtSetMachiningParam( MCH_MP.INVERT, true)
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
-- uso della faccia
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_DOWN)
-- attacco e uscita
EgtSetMachiningParam( MCH_MP.LIPERP, 0)
EgtSetMachiningParam( MCH_MP.LITANG, dToolDiam / 2 + 30)
EgtSetMachiningParam( MCH_MP.LOPERP, 0)
EgtSetMachiningParam( MCH_MP.LOTANG, dToolDiam / 2 + 30)
-- eseguo
if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchFId, false)
return false, sErr
end
end
return true
end