DataBeam :

- migliorie a lavorazione in doppio di Profili Convesso e Concavo
- aggiunta lavorazione in doppio a Profilo Cambered.
This commit is contained in:
Dario Sassi
2019-04-08 14:39:45 +00:00
parent 04059c20ac
commit 0ce22a934c
3 changed files with 65 additions and 40 deletions
+49 -4
View File
@@ -1,4 +1,4 @@
-- ProcessProfCamb.lua by Egaltech s.r.l. 2019/04/01
-- ProcessProfCamb.lua by Egaltech s.r.l. 2019/04/08
-- Gestione calcolo profilo caudato per Travi
-- Tabella per definizione modulo
@@ -87,7 +87,7 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
return false, sErr
end
-- recupero i dati della curva e del profilo
local dDepth = abs( EgtCurveThickness( AuxId))
local dProfDepth = abs( EgtCurveThickness( AuxId))
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
local nLastFacet = EgtSurfTmFacetCount( Proc.Id) - 1 -- ultima faccia
local nRefFacet = nLastFacet - 1 -- penultima faccia
@@ -129,6 +129,17 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
EgtOutLog( sErr)
return false, sErr
end
-- Recupero i dati dell'utensile
local dToolMaxDepth = 0
if EgtMdbSetCurrMachining( sMilling) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dToolMaxDepth = EgtTdbGetCurrToolMaxDepth()
end
end
-- verifico se necessario lavorare in doppio
local bDouble = ( nSide ~= 0 and dProfDepth > dToolMaxDepth)
local dDepth = min( dToolMaxDepth, dProfDepth / 2 + BD.MILL_OVERLAP)
-- inserisco la lavorazione
local sName = 'Prof_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchId = EgtAddMachining( sName, sMilling)
@@ -139,8 +150,8 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ AuxId, -1}})
-- se lavorazione da sopra
if vtN:getZ() > 0.1 then
-- se lavorazione da sopra o da sotto
if nSide ~= 0 then
-- se lavorazione a destra di fronte o sinistra da dietro, inverto
if ( vtNF:getX() > 0 and vtExtr:getY() < -0.1) or
( vtNF:getX() < 0 and vtExtr:getY() > 0.1) then
@@ -161,6 +172,10 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
EgtSetMachiningParam( MCH_MP.INVERT, true)
end
end
-- se in doppio, imposto l'affondamento
if bDouble then
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
end
-- posizione braccio porta testa
EgtSetMachiningParam( MCH_MP.SCC, EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM))
-- eseguo
@@ -169,6 +184,36 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
EgtSetOperationMode( nMchId, false)
return false, sErr
end
-- se lavorazione da due parti, aggiungo la seconda
if bDouble then
-- inserisco la lavorazione
local sName = 'ProfB_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchId = EgtAddMachining( sName, sMilling)
if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
EgtOutLog( sErr)
return false, sErr
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ AuxId, -1}})
-- sempre lavorazione da sopra o da sotto
-- se lavorazione a destra di fronte o sinistra da dietro, inverto
if ( vtNF:getX() > 0 and vtExtr:getY() > 0.1) or
( vtNF:getX() < 0 and vtExtr:getY() < -0.1) then
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
EgtSetMachiningParam( MCH_MP.INVERT, true)
end
-- imposto l'affondamento
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
-- posizione braccio porta testa
EgtSetMachiningParam( MCH_MP.SCC, EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM))
-- eseguo
if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchId, false)
return false, sErr
end
end
-- se non da sotto, inserisco lavorazione finitura angolo
if nSide ~= -1 then
sName = 'ProfV_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))