DataBeam :

- modifiche per macchina PF1250.
This commit is contained in:
Dario Sassi
2020-11-09 08:48:28 +00:00
parent 1adb136219
commit 15649573c4
13 changed files with 374 additions and 86 deletions
+36 -19
View File
@@ -1,4 +1,4 @@
-- ProcessLongDoubleCut.lua by Egaltech s.r.l. 2020/10/27
-- ProcessLongDoubleCut.lua by Egaltech s.r.l. 2020/11/08
-- Gestione calcolo doppio taglio longitudinale per Travi
-- Tabella per definizione modulo
@@ -108,7 +108,7 @@ function ProcessLong2Cut.GetLongFacesCount( Proc)
end
---------------------------------------------------------------------
local function MakeSideFace( nId, nFac, nSide, sMilling, dToolDiam)
local function MakeSideFace( nId, nFac, nSide, sMilling, dToolDiam, nL2CSide)
-- inserisco la lavorazione
local sNameF = 'L2C_' .. ( EgtGetName( nId) or tostring( nId)) .. '_' .. tostring( nFac)
local nMchFId = EgtAddMachining( sNameF, sMilling)
@@ -132,6 +132,10 @@ local function MakeSideFace( nId, nFac, nSide, sMilling, dToolDiam)
EgtSetMachiningParam( MCH_MP.LITANG, dToolDiam / 2 + 30)
EgtSetMachiningParam( MCH_MP.LOPERP, 0)
EgtSetMachiningParam( MCH_MP.LOTANG, dToolDiam / 2 + 30)
-- se faccia di fianco e testa da sotto, aumento la sicurezza
if nL2CSide == 0 and BD.DOWN_HEAD then
EgtSetMachiningParam( MCH_MP.STARTPOS, 80)
end
-- eseguo
if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
@@ -146,7 +150,7 @@ local function MakeByPocketing( Proc, nPhase, nRawId, nPartId, nFacInd, dFacElev
-- cerco la svuotatura opportuna
local sPocketing = ML.FindPocketing( 'OpenPocket', Proc.Box:getDimX())
if not sPocketing then
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' pocketing not found in library'
local sErr = 'Error : OpenPocket not found in library'
EgtOutLog( sErr)
return false, sErr
end
@@ -177,7 +181,7 @@ local function MakeByPocketing( Proc, nPhase, nRawId, nPartId, nFacInd, dFacElev
if dFacElev > dMaxDepth + 10 * GEO.EPS_SMALL then
EgtSetMachiningParam( MCH_MP.DEPTH, dMaxDepth - dFacElev)
dFacElev = dMaxDepth
sWarn = 'Warning in process ' .. tostring( Proc.Id) .. ' : elevation bigger than max tool depth'
sWarn = 'Warning : elevation bigger than max tool depth'
EgtOutLog( sWarn)
end
-- imposto elevazione e dichiaro non si generano sfridi per VMill
@@ -232,7 +236,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
-- analisi del taglio
local vOrd = {}
local vFaceUse = {}
if nSide == 1 then
if nSide == 1 or ( nSide == -1 and BD.DOWN_HEAD) then
vOrd = EgtIf( ptC[1]:getY() < ptRef:getY(), { 1, 2}, { 2, 1})
vFaceUse = { BL.GetNearestOrthoOpposite( ptC[1] - ptM), BL.GetNearestOrthoOpposite( ptC[2] - ptM)}
elseif nSide == -1 then
@@ -261,7 +265,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
-- allora vince il Q3, cioè si utilizza la fresa di fianco ( per i tagli da sopra)
-- 2020/09/17 Fabio Squaratti: se lavorazione con fresa di fianco e se ci sono delle facce laterali, l'utensile deve arrivare
-- fino al punto più vicino della faccia laterale (prima l'arretramento era sempre del rggio utensile).
-- fino al punto più vicino della faccia laterale (prima l'arretramento era sempre del raggio utensile).
-- Questo viene fatto se Q03=1 o fresa da sotto
----------------------------------------------------------------------------------------------------------------------------------------
local bUseBlade = EgtGetInfo( Proc.Id, 'Q01', 'i') == 1
@@ -274,7 +278,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
-- recupero la lavorazione
local sCutting = ML.FindCutting( 'HeadSide')
if not sCutting then
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' sawing not found in library'
local sErr = 'Error : HeadSide not found in library'
EgtOutLog( sErr)
return false, sErr
end
@@ -292,8 +296,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
end
-- se la distanza dal pezzo successivo è inferiore della metà lama, do un warning
if dDistToNextPiece < dToolDiam/2 then
sWarn = 'Warning on saw cut : Cut machining can damage next piece'
EgtOutLog( sWarn .. ' (process ' .. tostring( Proc.Id) .. ')')
sWarn = 'Warning : Cut machining can damage next piece'
EgtOutLog( sWarn)
end
-- determino numero di parti
local dStartAccDist = BD.LONGCUT_ENDLEN
@@ -326,7 +330,10 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
-- si percorrono i lati alto e basso della faccia
for i = 1, nC do
-- Posizione braccio portatesta
local nSCC = EgtIf( ( BD.C_SIMM or i == 1 or i == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
local nSCC = MCH_SCC.NONE
if not BD.C_SIMM then
nSCC = EgtIf( ( i == 1 or i == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
end
-- ciclo sulle due facce
for j = 1, #vOrd do
-- determino se lavorazione da davanti o da dietro
@@ -383,7 +390,10 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
-- si percorrono i lati alto e basso della faccia
for i = 1, nC do
-- Posizione braccio portatesta
local nSCC = EgtIf( ( BD.C_SIMM or i == 1 or i == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
local nSCC = MCH_SCC.NONE
if not BD.C_SIMM then
nSCC = EgtIf( ( i == 1 or i == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
end
-- ciclo sulle due facce
for j = 1, #vOrd do
-- determino se lavorazione da davanti o da dietro
@@ -441,7 +451,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
end
end
-- se non è sotto e non uso fresa di fianco: lavorazione Long2Cut
elseif nSide ~= - 1 and nUseMillOnSide == 0 then
elseif ( nSide ~= - 1 or BD.DOWN_HEAD) and nUseMillOnSide == 0 then
-- determino la massima elevazione
local dElev = 0
local dFacElev1 = BL.GetFaceElevation( Proc.Id, tFaceLong[1], nPartId)
@@ -450,7 +460,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
-- recupero la lavorazione
local sMilling = ML.FindMilling( 'Long2Cut', dElev)
if not sMilling then
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' milling not found in library'
local sErr = 'Error : Long2Cut not found in library'
EgtOutLog( sErr)
return false, sErr
end
@@ -575,9 +585,12 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
local dSal = EgtIf( nPos == 1, - EgtIf( i == nIni, dStartDist, dEndDist), - EgtIf( i == nIni, dStartAccDist, dEndAccDist) - ( nPos - 2) * dC)
local dEal = EgtIf( nPos == nC, - EgtIf( i == nIni, dEndDist, dStartDist), - EgtIf( i == nIni, dEndAccDist, dStartAccDist) - ( nC - nPos - 1) * dC)
-- Posizione braccio portatesta
local nSCC = EgtIf( ( BD.C_SIMM or j == 1 or j == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
local nSCC = MCH_SCC.NONE
if not BD.C_SIMM then
nSCC = EgtIf( ( j == 1 or j == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
end
-- Verifico se da fare di fianco perchè normale troppo verso il basso (minore di -30deg)
local bSide = ( vtN[vOrd[i]]:getZ() < -0.5)
local bSide = ( vtN[vOrd[i]]:getZ() < -0.5 and not BD.DOWN_HEAD)
-- ciclo sulle passate
local nO = 1
local dStep = 0
@@ -623,6 +636,10 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
local dLioPerp = EgtIf( bSide, dToolDiam, dLargh - dOffsR + BD.CUT_SIC)
EgtSetMachiningParam( MCH_MP.LIPERP, dLioPerp)
EgtSetMachiningParam( MCH_MP.LOPERP, dLioPerp)
-- se faccia di fianco e testa da sotto, aumento la sicurezza
if nSide == 0 and BD.DOWN_HEAD then
EgtSetMachiningParam( MCH_MP.STARTPOS, 80)
end
-- eseguo
if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
@@ -632,11 +649,11 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
end
-- se facce principali convesse, eventuale lavorazione della faccia limitante l'inizio (a destra)
if bConvex and j == 1 and not bStartFixed then
MakeSideFace( Proc.Id, tFaceLong[vOrd[i]], 1, sMilling, dToolDiam)
MakeSideFace( Proc.Id, tFaceLong[vOrd[i]], 1, sMilling, dToolDiam, nSide)
end
-- se facce principali convesse, eventuale lavorazione della faccia limitante la fine (a sinistra)
if bConvex and j == nC and not bEndFixed then
MakeSideFace( Proc.Id, tFaceLong[vOrd[i]], -1, sMilling, dToolDiam)
MakeSideFace( Proc.Id, tFaceLong[vOrd[i]], -1, sMilling, dToolDiam, nSide)
end
end
end
@@ -670,7 +687,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
end
end
if not sMilling then
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' milling not found in library'
local sErr = 'Error : Long2CutSide or Long2CutDown not found in library'
EgtOutLog( sErr)
return false, sErr
end
@@ -772,7 +789,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
local dSal = EgtIf( nPos == 1, - EgtIf( i == 1, dStartDist, dEndDist), - EgtIf( i == 1, dStartAccDist, dEndAccDist) - ( nPos - 2) * dC)
local dEal = EgtIf( nPos == nC, - EgtIf( i == 1, dEndDist, dStartDist), - EgtIf( i == 1, dEndAccDist, dStartAccDist) - ( nC - nPos - 1) * dC)
-- Posizione braccio portatesta
local nSCC = MCH_SCC.ADIR_XP
local nSCC = EgtIf( BD.C_SIMM, MCH_SCC.NONE, MCH_SCC.ADIR_XP)
-- inserisco le parti di lavorazione
nM = nM + 1
local sNameF = 'L2C_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( nM)