DataBeam :
- in Long2Cut tolta da scelta milling tipo Long2CutDown controllo max diametro fresa.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
-- ProcessLongDoubleCut.lua by Egaltech s.r.l. 2022/02/15
|
||||
-- ProcessLongDoubleCut.lua by Egaltech s.r.l. 2022/03/20
|
||||
-- Gestione calcolo doppio taglio longitudinale per Travi
|
||||
-- 2021/05/18 Possibile taglio con lama anche di fianco su macchina con testa da sotto.
|
||||
-- 2021/06/29 Corretta gestione caso equivalente a due smussi.
|
||||
@@ -6,6 +6,7 @@
|
||||
-- 2021/11/08 Se con lama e flag BD.USE_LONGCUT si lavora in direzione contraria allo standard.
|
||||
-- 2022/02/08 Sistemate lunghezze fresature quando due sole.
|
||||
-- 2022/02/15 Sistemati commenti.
|
||||
-- 2022/03/20 Tolta da scelta milling tipo Long2CutDown controllo max diametro fresa.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessLong2Cut = {}
|
||||
@@ -372,10 +373,6 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
local sErr = 'Error, impossible use blade on too negative face'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
-- elseif bUseBlade and not bCanUseBlade then
|
||||
-- local sErr = 'Error, impossible use blade'
|
||||
-- EgtOutLog( sErr)
|
||||
-- return false, sErr
|
||||
elseif bUseBlade and BD.DOWN_HEAD and not bCanUseBlade and not bCanUseUnderBlade then
|
||||
local sErr = 'Error, impossible use blade'
|
||||
EgtOutLog( sErr)
|
||||
@@ -675,15 +672,6 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
dSal, dEal = dEal, dSal
|
||||
end
|
||||
if bCanUseBlade and bCanUseUnderBlade then
|
||||
-- if bCanUseBlade and nSide == -1 then
|
||||
-- EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
-- else
|
||||
-- EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
-- EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||
-- dSal, dEal = dEal, dSal
|
||||
-- end
|
||||
-- -- imposto uso della faccia
|
||||
-- EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( k == 1, nFaceUse2, nFaceUse))
|
||||
if bCanUseBlade and nSide == -1 then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
-- imposto uso della faccia
|
||||
@@ -864,6 +852,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- se non è sotto e non uso fresa di fianco: lavorazione Long2Cut
|
||||
elseif ( ( nSide ~= -1 or BD.DOWN_HEAD) or ( nSide == -1 and BD.DOWN_HEAD)) and nUseMillOnSide == 0 then
|
||||
-- determino la massima elevazione
|
||||
@@ -1124,6 +1113,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- altrimenti lavorazione di fianco : Long2CutSide o Long2CutDown
|
||||
else
|
||||
-- da Analisi con Fabio Squaratti 15/09/2020
|
||||
@@ -1134,26 +1124,27 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
-- se nExtendMach = 2 la lavorazione viene estesa ma arretra per non segnare il pezzo successivo (se non ha facce limite)
|
||||
local nExtendMach
|
||||
-- recupero la lavorazione
|
||||
local sMilling
|
||||
local sMillingDn
|
||||
local sPrefix
|
||||
local sPrefixDn
|
||||
local sMchType, sMchTypeDn
|
||||
local sMilling, sMillingDn
|
||||
local sPrefix, sPrefixDn
|
||||
if nSide ~= - 1 then
|
||||
sMilling = ML.FindMilling( 'Long2CutSide')
|
||||
sMchType = 'Long2CutSide'
|
||||
sMilling = ML.FindMilling( sMchType)
|
||||
sPrefix = 'L2CS_'
|
||||
nExtendMach = nUseMillOnSide
|
||||
if nUseMillOnSide == 2 then
|
||||
bRemoveToolRadius = true
|
||||
-- nExtendMach = 0 -- arretro la lavorazione del raggio utensile (se non ha facce limite)
|
||||
end
|
||||
-- se testa da sotto
|
||||
if nSide ~= 1 and BD.DOWN_HEAD then
|
||||
sMillingDn = ML.FindMilling( 'Long2CutSide_H2')
|
||||
sMchTypeDn = 'Long2CutSide_H2'
|
||||
sMillingDn = ML.FindMilling( sMchTypeDn)
|
||||
sPrefixDn = 'L2CSH2_'
|
||||
end
|
||||
-- lavorazione da sotto
|
||||
else
|
||||
sMilling = ML.FindMilling( 'Long2CutDown', nil, nil, EgtIf( nUseMillOnSide > 0, nil, 50))
|
||||
else
|
||||
sMchType = 'Long2CutDown'
|
||||
sMilling = ML.FindMilling( sMchType)
|
||||
sPrefix = 'L2CD_'
|
||||
nExtendMach = 1
|
||||
if nUseMillOnSide ~= 1 then
|
||||
@@ -1161,17 +1152,18 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
end
|
||||
-- se testa da sotto
|
||||
if BD.DOWN_HEAD then
|
||||
sMillingDn = ML.FindMilling( 'Long2CutDown_H2')
|
||||
sMchTypeDn = 'Long2CutDown_H2'
|
||||
sMillingDn = ML.FindMilling( sMchTypeDn)
|
||||
sPrefixDn = 'L2CDH2_'
|
||||
end
|
||||
end
|
||||
if not sMilling then
|
||||
local sErr = 'Error : Long2CutSide or Long2CutDown not found in library'
|
||||
if not sMilling and ( nSide == 1 or not BD.DOWN_HEAD) then
|
||||
local sErr = 'Error : milling '..sMchType..' not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
if nSide ~= 1 and BD.DOWN_HEAD and not sMillingDn then
|
||||
local sErr = 'Error : Long2CutSide_H2 or Long2CutDown_H2 not found in library'
|
||||
if not sMilling and not sMillingDn then
|
||||
local sErr = 'Error : milling '..sMchType..' and '..sMchTypeDn..' not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
@@ -1398,7 +1390,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
if BD.DOWN_HEAD and nSide ~= 1 then
|
||||
local ptC3 = EgtSurfTmFacetCenter( Proc.Id, tFaceLong[vOrd[i]], GDB_ID.ROOT)
|
||||
local ptDir = ptC3 - ptM ; ptDir:normalize()
|
||||
-- se concave e dal versore Z della faccia (> -20°) o convesso e versore Z ( > -30°) decido se eseguire la lavoraione con la testa d a sopra o da sotto
|
||||
-- se concave e dal versore Z della faccia (> -20°) o convesso e versore Z ( > -30°) decido se eseguire la lavoraione con la testa da sopra o da sotto
|
||||
if ( not bConvex and vtN[vOrd[i]]:getZ() > -0.9397 and ptDir:getZ() > 0) or
|
||||
( bConvex and vtN[vOrd[i]]:getZ() > -0.866 and ptDir:getZ() > 0) then
|
||||
sNameF = sPrefix .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( nM)
|
||||
@@ -1445,7 +1437,6 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
if vtN[vOrd[i]]:getZ() > 0.866 then
|
||||
vFaceUse2 = BL.GetNearestParalOpposite( vtN[EgtIf(vOrd[i] == 1, 1, 2)], vtN[EgtIf(vOrd[i] == 1, 2, 1)])
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, vFaceUse2)
|
||||
-- EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_TOP)
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dEal)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dSal)
|
||||
else
|
||||
@@ -1466,7 +1457,6 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
local vFaceUse2
|
||||
-- se da sopra
|
||||
if nSide == 1 then
|
||||
-- vFaceUse2 = BL.GetNearestParalOpposite( vtN[EgtIf(vOrd[i] == 1, 2, 1)])
|
||||
vFaceUse2 = BL.GetNearestParalOpposite( vtN[EgtIf(vOrd[i] == 1, 2, 1)], vtN[EgtIf(vOrd[i] == 1, 1, 2)])
|
||||
-- altrimenti è di fianco
|
||||
else
|
||||
@@ -1492,7 +1482,6 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
end
|
||||
else
|
||||
-- lascio lo stesso le lavorazioni anche se viene intercettato l'errore
|
||||
-- local vFaceUse2 = BL.GetNearestParalOpposite( vtN[EgtIf(vOrd[i] == 1, 2, 1)])
|
||||
local vFaceUse2 = BL.GetNearestParalOpposite( vtN[EgtIf(vOrd[i] == 1, 2, 1)], vtN[EgtIf(vOrd[i] == 1, 1, 2)])
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, vFaceUse2)
|
||||
if vtN[vOrd[i]]:getZ() < 0 then
|
||||
@@ -1553,7 +1542,6 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
dDepth2 = vWidth[vOrd[i]] + dAgg - dDepth
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth - dExtraElev)
|
||||
end
|
||||
-- EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||
-- eseguo
|
||||
if not EgtApplyMachining( true, false) then
|
||||
-- se feature orientata su faccia da sotto e concave provo a cambiare l'attacco
|
||||
|
||||
Reference in New Issue
Block a user