DataBeam :
- aggiunta gestione smussi su tutte le profilature orizzontali per macchine con testa da sotto.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
-- ProcessProfFront.lua by Egaltech s.r.l. 2021/03/28
|
||||
-- ProcessProfFront.lua by Egaltech s.r.l. 2021/05/03
|
||||
-- Gestione calcolo profilo frontale per Travi
|
||||
-- 2021/05/03 Aggiunta gestione smusso da sopra e sotto per macchina con testa da sotto.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessProfFront = {}
|
||||
@@ -106,7 +107,7 @@ local function VerifyCham( Proc, AuxId, nRawId, bMakeVertCham, sDephtCham, sOnly
|
||||
nChamfer = nChamfer + 1
|
||||
-- altrimenti se non ho l'affondamento esco
|
||||
else
|
||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' no chamfer depth'
|
||||
local sErr = 'Error : no chamfer depth'
|
||||
EgtOutLog( sErr)
|
||||
return -1, dDepth, sErr
|
||||
end
|
||||
@@ -118,28 +119,36 @@ local function VerifyCham( Proc, AuxId, nRawId, bMakeVertCham, sDephtCham, sOnly
|
||||
if abs( vtExtr:getZ()) > 0.1 then
|
||||
if not bMakeVertCham then
|
||||
if nChamfer == 2 then -- se devo fare solo smusso, genero errore
|
||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' not horizontale chamfer'
|
||||
local sErr = 'Error : not horizontale chamfer'
|
||||
EgtOutLog( sErr)
|
||||
return -1, dDepth, sErr
|
||||
else
|
||||
local sWarn = 'Warning on process ' .. tostring( Proc.Id) .. ' skipped not horizontale chamfer'
|
||||
local sWarn = 'Warning : skipped not horizontale chamfer'
|
||||
EgtOutLog( sWarn)
|
||||
return 0, dDepth
|
||||
end
|
||||
end
|
||||
end
|
||||
-- recupero la lavorazione
|
||||
local sMilling
|
||||
local sMilling, sMilling2
|
||||
if nChamfer > 0 then
|
||||
sMilling = ML.FindMilling( 'Mark')
|
||||
if not sMilling then
|
||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' chamfer not found in library'
|
||||
local sErr = 'Error : chamfer not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return -1, 0, sErr
|
||||
end
|
||||
if BD.DOWN_HEAD and abs( vtExtr:getZ()) > 0.9 then
|
||||
sMilling2 = ML.FindMilling( 'Mark_H2')
|
||||
if not sMilling2 then
|
||||
local sErr = 'Error : chamfer2 not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return -1, 0, sErr
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return nChamfer, dDepth, sMilling
|
||||
return nChamfer, dDepth, sMilling, sMilling2
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -151,7 +160,7 @@ function ProcessProfFront.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
local Ls = EgtGetFirstNameInGroup( nPartId, 'Box')
|
||||
local b3Solid = EgtGetBBoxGlob( Ls or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
if not b3Solid then
|
||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' part box not found'
|
||||
local sErr = 'Error : part box not found'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
@@ -159,7 +168,7 @@ function ProcessProfFront.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i')
|
||||
if AuxId then AuxId = AuxId + Proc.Id end
|
||||
if not AuxId or ( EgtGetType( AuxId) & GDB_FY.GEO_CURVE) == 0 then
|
||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' missing profile geometry'
|
||||
local sErr = 'Error : missing profile geometry'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
@@ -192,13 +201,14 @@ function ProcessProfFront.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- recupero gruppo per geometria addizionale
|
||||
local nAddGrpId = BL.GetAddGroup( nPartId)
|
||||
if not nAddGrpId then
|
||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' missing AddGroup'
|
||||
local sErr = 'Error : missing AddGroup'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- verifico se sono presenti i parametri Q per la profondità smusso e
|
||||
-- per eseguire in esclusiva solo lo smusso
|
||||
local nChamfer, dDepthCham, sChamfer = VerifyCham( Proc, AuxId, nRawId, false, sDepthChamferMill, sPreemptiveChamfer)
|
||||
local bMakeVertCham = BD.DOWN_HEAD
|
||||
local nChamfer, dDepthCham, sChamfer = VerifyCham( Proc, AuxId, nRawId, bMakeVertCham, sDepthChamferMill, sPreemptiveChamfer)
|
||||
-- se non posso lavorare la feature perché condizionata dall'esecuzione del solo chamfer
|
||||
-- genero errore e non faccio nulla
|
||||
if nChamfer < 0 then
|
||||
@@ -244,6 +254,7 @@ function ProcessProfFront.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
-- altrimenti lavorazione dal davanti o dal dietro
|
||||
else
|
||||
bDoubleCham = BD.DOWN_HEAD
|
||||
-- se fresa verso il basso, la porto verso l'alto
|
||||
if vtExtr:getZ() < 0 then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
@@ -278,9 +289,10 @@ function ProcessProfFront.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
if bDoubleCham then
|
||||
-- inserisco la lavorazione
|
||||
local sName = 'ChamB_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchId = EgtAddMachining( sName, sChamfer)
|
||||
local sMachining2 = EgtIf( BD.DOWN_HEAD and sChamfer2, sChamfer2, sChamfer)
|
||||
local nMchId = EgtAddMachining( sName, sMachining2)
|
||||
if not nMchId then
|
||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sChamfer
|
||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sMachining2
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
@@ -318,7 +330,7 @@ function ProcessProfFront.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- recupero la lavorazione
|
||||
local sMilling = ML.FindMilling( 'Prof')
|
||||
if not sMilling then
|
||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' milling not found in library'
|
||||
local sErr = 'Error : milling not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user