DataBeam :

- aggiunta gestione marcature e testi da sotto per macchine con testa da sotto
- aggiunta gestione smussi su profilatura caudata orizzontale per macchine con testa da sotto.
This commit is contained in:
DarioS
2021-05-03 20:40:21 +02:00
parent 4a4d95d437
commit a6dd7f69c8
4 changed files with 52 additions and 23 deletions
+21 -9
View File
@@ -1,5 +1,6 @@
-- ProcessProfCamb.lua by Egaltech s.r.l. 2021/03/28
-- ProcessProfCamb.lua by Egaltech s.r.l. 2021/05/03
-- Gestione calcolo profilo caudato per Travi
-- 2021/05/03 Aggiunta gestione smusso da sopra e sotto per macchina con testa da sotto.
-- Tabella per definizione modulo
local ProcessProfCamb = {}
@@ -155,28 +156,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 horizontal 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 horizontal 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.99 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
---------------------------------------------------------------------
@@ -227,7 +236,8 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
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, sChamfer2 = 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
@@ -331,6 +341,7 @@ function ProcessProfCamb.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)
@@ -365,9 +376,10 @@ function ProcessProfCamb.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