DataBeam :

- allungati grezzi di pezzi corti da View di B&W
- migliorato ordinamento di feature lunghe rispetto alle standard
- nei fori si premia il più possibile ricerca punta con adeguato affondamento
- migliorata gestione lame sui tagli longitudinali con teste da sotto
- in profilo di testa cambered (3/4-103-X) estesa gestione di eventuale testa da sotto.
This commit is contained in:
DarioS
2021-09-19 17:06:49 +02:00
parent 2386a280b9
commit 6942aac9e2
5 changed files with 451 additions and 159 deletions
+38 -56
View File
@@ -1,7 +1,8 @@
-- ProcessDrill.lua by Egaltech s.r.l. 2021/05/03
-- ProcessDrill.lua by Egaltech s.r.l. 2021/09/19
-- Gestione calcolo forature per Travi
-- 2021/04/14 DS Corretta gestione Invert con testa da sotto. Migliorato calcolo ingombro portautensile.
-- 2021/05/03 DS Su macchina con testa da sotto aggiunta possibilità di fare fori verticali metà sopra e l'altra sotto.
-- 2021/09/19 DS Si premia il più possibile ricerca punta con adeguato affondamento.
-- Tabella per definizione modulo
local ProcessDrill = {}
@@ -111,9 +112,6 @@ function ProcessDrill.Split( Proc, b3Raw)
if not bTrySplit then
return false
end
-- recupero la lavorazione
local sDrilling, _, dMaxMat = ML.FindDrilling( dDiam, 0, bDrillDown)
if not sDrilling then dMaxMat = 0 end
-- restituisco se va fatto in doppio (solo fori orizzontali)
local bHoriz = ( abs( vtExtr:getZ()) < abs( BD.DRILL_VZ_MIN) and
( abs( vtExtr:getY()) * b3Raw:getDimZ() > abs( vtExtr:getZ()) * b3Raw:getDimY() or Proc.Fce == 5 or Proc.Fce == 6))
@@ -191,12 +189,12 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
EgtOutLog( sErr)
return false, sErr
end
-- se il foro può non essere passante (bOpen vale false) inverto
-- se il foro è cieco all'inizio, lo inverto
if Proc.Fcs == 0 then bToInvert = true end
if bToInvert then vtExtr = - vtExtr end
-- se foro è splittato ed è la parte opposta, inverto
if Proc.Flg == -2 then bToInvert = true end
-- profondità geometria foro
-- profondità geometrica del foro
local dDepth = dLen
local dDepth2 = dLen
if Proc.Flg == 2 or Proc.Flg == -2 then
@@ -205,37 +203,28 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
local dCheckDepth = dDepth
local dCheckDepth2 = dDepth2
local nErrorCode = 0
-- se troppo inclinata sulla X o Y va troppo dietro o Z va in negativo o se il foro è splittato,
-- annullo il valore della profondità nella ricerca utensile
if abs(vtExtr:getX()) > 0.707 or vtExtr:getY() > 0.5 or vtExtr:getZ() < BD.DRILL_VZ_MIN or abs(Proc.Flg) == 2 then
dCheckDepth = nil
dCheckDepth2 = nil
end
-- abilitazione foratura da sotto
local bDrillDown = ( BD.DOWN_HEAD and ( Proc.Down or vtExtr:getZ() < -0.1 or vtExtr:getZ() < 0.259))
local bDrillUp = ( BD.DOWN_HEAD and vtExtr:getZ() > -0.259)
-- primo gruppo di controlli con lunghezza utensile calcolata
-- primo gruppo di controlli con lunghezza utensile pari a metà foro se passante
-- recupero la lavorazione
local sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth, bDrillDown)
if not sDrilling then
-- se ho passato altezza di taglio utensile allora rifaccio la ricerca senza passare altezza utensile
if dCheckDepth then
sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, 0, bDrillDown)
if sDrilling then dCheckDepth = nil end
end
if not sDrilling and bDrillUp then
sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth)
if not sDrilling and dCheckDepth then
sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, 0)
if sDrilling then dCheckDepth = nil end
end
end
if not sDrilling then
nErrorCode = 1
end
if not sDrilling and bDrillUp then
sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth)
end
-- se esiste la lavorazione e la lunghezza utensile massima supera il valore limite del BeamData e la componente Z supera i 10 gradi
-- allora ricerco un utensile senza lunghezza massima
if not sDrilling and dCheckDepth then
sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, 0, bDrillDown)
if sDrilling then dCheckDepth = nil end
end
if not sDrilling and bDrillUp and dCheckDepth then
sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, 0)
if sDrilling then dCheckDepth = nil end
end
if not sDrilling then
nErrorCode = 1
end
-- se trovata la lavorazione e la lunghezza massima utensile supera il valore limite del BeamData e inclinato più di 10 gradi da Z
-- allora ricerco un utensile senza imporre minima capacità di taglio
if nErrorCode == 0 and dMaxToolLength > ( BD.MAX_TOOL_LEN_FOR_HOR_MACH or 300) and abs( vtExtr:getZ()) < ( BD.DRILL_VZ_MIN_LONG_TOOL or cos(10)) then
-- se non ho passato altezza di taglio utensile allora la lunghezza utensile non è idonea per il taglio
if not dCheckDepth then
@@ -248,37 +237,32 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
end
if not sDrilling then
nErrorCode = 1
end
-- ultimo controllo sulla lunghezza utensile
if dMaxToolLength > ( BD.MAX_TOOL_LEN_FOR_HOR_MACH or 300) and abs( vtExtr:getZ()) < ( BD.DRILL_VZ_MIN_LONG_TOOL or cos(10)) then
elseif dMaxToolLength > ( BD.MAX_TOOL_LEN_FOR_HOR_MACH or 300) and abs( vtExtr:getZ()) < ( BD.DRILL_VZ_MIN_LONG_TOOL or cos(10)) then
nErrorCode = 2
end
end
end
-- secondo gruppo di controlli con lunghezza utensile calcolata
-- secondo gruppo di controlli con lunghezza richiesta pari all'intero foro
-- recupero la lavorazione
local sDrilling2, sType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2
if dDepth2 > dDepth + BD.DRILL_OVERLAP then
sDrilling2, sType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2 = ML.FindDrilling( dDiam, dCheckDepth2, bDrillDown)
if not sDrilling2 then
-- se ho passato altezza di taglio utensile allora rifaccio la ricerca senza passare altezza utensile
if dCheckDepth2 then
sDrilling2, sType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2 = ML.FindDrilling( dDiam, 0, bDrillDown)
if sDrilling2 then dCheckDepth2 = nil end
end
if not sDrilling2 and bDrillUp then
sDrilling2, sType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2 = ML.FindDrilling( dDiam, dCheckDepth2)
if not sDrilling2 and dCheckDepth2 then
sDrilling2, sType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2 = ML.FindDrilling( dDiam, 0)
if sDrilling2 then dCheckDepth2 = nil end
end
end
if not sDrilling2 then
nErrorCode = 1
end
if not sDrilling2 and bDrillUp then
sDrilling2, sType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2 = ML.FindDrilling( dDiam, dCheckDepth2)
end
-- se esiste la lavorazione e la lunghezza utensile massima supera il valore limite del BeamData e la componente Z supera i 10 gradi
-- allora ricerco un utensile senza lunghezza massima
if not sDrilling2 and dCheckDepth2 then
sDrilling2, sType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2 = ML.FindDrilling( dDiam, 0, bDrillDown)
if sDrilling2 then dCheckDepth2 = nil end
end
if not sDrilling2 and bDrillUp and dCheckDepth2 then
sDrilling2, sType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2 = ML.FindDrilling( dDiam, 0)
if sDrilling2 then dCheckDepth2 = nil end
end
if not sDrilling2 then
nErrorCode = 1
end
-- se trovata la lavorazione e la lunghezza massima utensile supera il valore limite del BeamData e inclinato più di 10 gradi da Z
-- allora ricerco un utensile senza imporre minima capacità di taglio
if nErrorCode == 0 and dMaxToolLength2 > ( BD.MAX_TOOL_LEN_FOR_HOR_MACH or 300) and abs( vtExtr:getZ()) < ( BD.DRILL_VZ_MIN_LONG_TOOL or cos(10)) then
-- se non ho passato altezza di taglio utensile allora la lunghezza utensile non è idonea per il taglio
if not dCheckDepth2 then
@@ -291,9 +275,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
end
if not sDrilling2 then
nErrorCode = 1
end
-- ultimo controllo sulla lunghezza utensile
if dMaxToolLength2 > ( BD.MAX_TOOL_LEN_FOR_HOR_MACH or 300) and abs( vtExtr:getZ()) < ( BD.DRILL_VZ_MIN_LONG_TOOL or cos(10)) then
elseif dMaxToolLength2 > ( BD.MAX_TOOL_LEN_FOR_HOR_MACH or 300) and abs( vtExtr:getZ()) < ( BD.DRILL_VZ_MIN_LONG_TOOL or cos(10)) then
nErrorCode = 2
end
end