DataBeam :
- prime modifiche per lavorazione profili.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
-- ProcessProfConcave.lua by Egaltech s.r.l. 2019/04/08
|
||||
-- ProcessProfConcave.lua by Egaltech s.r.l. 2020/02/04
|
||||
-- Gestione calcolo profilo caudato per Travi
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
@@ -42,6 +42,44 @@ local function GetSawCutData( AuxId, vtN)
|
||||
return ptStart, vtNP
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function ModifySideAndInvertAndLead( Proc, bHead, dToolDiam)
|
||||
|
||||
-- confronto il punto iniziale e finale della lavorazione con il box della feature
|
||||
-- e se è vicino alla parte esterna della trave inverto la lavorazione
|
||||
ptSP = EgtGetMachiningStartPoint()
|
||||
ptEp = EgtGetMachiningEndPoint()
|
||||
local nMachMode = EgtMdbGetCurrMachiningParam( MCH_MP.STEPTYPE)
|
||||
if nMachMode == 1 and ptSP and ptEp then
|
||||
if abs( EgtIf( bHead, Proc.Box:getMax():getX(), Proc.Box:getMin():getX()) - ptSP:getX()) <
|
||||
abs( EgtIf( bHead, Proc.Box:getMax():getX(), Proc.Box:getMin():getX()) - ptEp:getX()) then
|
||||
-- ottengo il lato lavoro e lo inverto
|
||||
local nSideWork = EgtMdbGetCurrMachiningParam( MCH_MP.WORKSIDE)
|
||||
if nSideWork > 0 then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( nSideWork == MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT))
|
||||
end
|
||||
-- ottengo l'inversione e setto il contrario
|
||||
local bInvertMode = EgtMdbGetCurrMachiningParam( MCH_MP.INVERT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, not bInvertMode)
|
||||
-- modifico attacco e uscita
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, -(dToolDiam/2))
|
||||
EgtSetMachiningParam( MCH_MP.LITANG, (dToolDiam/2)+0.5)
|
||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, 0)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, (dToolDiam/3*2))
|
||||
-- riapplico la lavorazione
|
||||
EgtApplyMachining()
|
||||
else
|
||||
-- modifico attacco e uscita
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, -(dToolDiam/2))
|
||||
EgtSetMachiningParam( MCH_MP.LITANG, (dToolDiam/2)+0.5)
|
||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, 0)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, (dToolDiam/3*2))
|
||||
-- riapplico la lavorazione
|
||||
EgtApplyMachining()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Applicazione della lavorazione
|
||||
function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
@@ -111,10 +149,12 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
-- Recupero i dati dell'utensile
|
||||
local dToolMaxDepth = 0
|
||||
local dToolDiam = 0
|
||||
if EgtMdbSetCurrMachining( sMilling) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dToolMaxDepth = EgtTdbGetCurrToolMaxDepth()
|
||||
dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||
end
|
||||
end
|
||||
-- verifico se necessario lavorare in doppio
|
||||
@@ -158,14 +198,16 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
-- posizione braccio porta testa
|
||||
EgtSetMachiningParam( MCH_MP.SCC, EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM))
|
||||
-- imposto parametri di attacco e uscita
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, 5)
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, 5)
|
||||
-- eseguo
|
||||
if not EgtApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
return false, sErr
|
||||
else
|
||||
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
||||
-- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco
|
||||
-- e uscita
|
||||
ModifySideAndInvertAndLead( Proc, bHead, dToolDiam)
|
||||
end
|
||||
-- se lavorazione da due parti, aggiungo la seconda
|
||||
if bDouble then
|
||||
@@ -190,14 +232,16 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||
-- posizione braccio porta testa
|
||||
EgtSetMachiningParam( MCH_MP.SCC, EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM))
|
||||
-- imposto parametri di attacco e uscita
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, 5)
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, 5)
|
||||
-- eseguo
|
||||
if not EgtApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
return false, sErr
|
||||
else
|
||||
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
||||
-- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco
|
||||
-- e uscita
|
||||
ModifySideAndInvertAndLead( Proc, bHead, dToolDiam)
|
||||
end
|
||||
end
|
||||
-- eventuale finitura faccia finale (ortogonale alla trave)
|
||||
|
||||
Reference in New Issue
Block a user