DataBeam :
- piccole modifiche ai fori per testa da sotto - correzione ai LapJoint per tagli con sega a catena passanti (variabili non inizializzate) - in forature corretta gestione Invert con testa da sotto e migliorato calcolo ingombro portautensile - in mortase a coda di rondine migliorata scelta lavorazione in presenza di testa da sotto - in lapjoint correzioni ribasso a U con testa da sotto - a FindMilling e FindPocketing aggiunto parametro opzionale dMaxTotLen - in LapJoint aggiunta gestione massima lunghezza fresa da sotto su svuotature.
This commit is contained in:
+39
-18
@@ -1,5 +1,6 @@
|
||||
-- ProcessDrill.lua by Egaltech s.r.l. 2021/03/20
|
||||
-- ProcessDrill.lua by Egaltech s.r.l. 2021/04/14
|
||||
-- Gestione calcolo forature per Travi
|
||||
-- 2021/04/14 DS Corretta gestione Invert con testa da sotto. Migliorato calcolo ingombro portautensile.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessDrill = {}
|
||||
@@ -212,22 +213,21 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
dCheckDepth2 = nil
|
||||
end
|
||||
-- abilitazione foratura da sotto
|
||||
--local bDrillDown = ( BD.DOWN_HEAD and ( Proc.Down or vtExtr:getZ() < -0.1 or vtExtr:getY() > 0 or EgtExistsInfo( Proc.Id, 'MAIN')) and not EgtExistsInfo( Proc.Id, 'DOU'))
|
||||
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)
|
||||
local bDrillDown = ( BD.DOWN_HEAD and ( Proc.Down or vtExtr:getZ() < -0.1 or ( vtExtr:getZ() < 0.259 and vtExtr:getY() > 0)))
|
||||
-- primo gruppo di controlli con lunghezza utensile calcolata
|
||||
-- recupero la lavorazione
|
||||
local sDrilling, nType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth, bDrillDown)
|
||||
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, nType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, 0, bDrillDown)
|
||||
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, nType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth)
|
||||
if dCheckDepth then
|
||||
sDrilling, nType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, 0)
|
||||
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
|
||||
@@ -243,7 +243,10 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
nErrorCode = 2
|
||||
-- rifaccio ricerca lavorazione senza specificare la profondità (dovrebbe trovare l'utensile più corto)
|
||||
else
|
||||
sDrilling, nType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, 0, bDrillDown)
|
||||
sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, 0, bDrillDown)
|
||||
if not sDrilling and bDrillUp then
|
||||
sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, 0)
|
||||
end
|
||||
if not sDrilling then
|
||||
nErrorCode = 1
|
||||
end
|
||||
@@ -255,14 +258,21 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
end
|
||||
-- secondo gruppo di controlli con lunghezza utensile calcolata
|
||||
-- recupero la lavorazione
|
||||
local sDrilling2, nType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2
|
||||
local sDrilling2, sType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2
|
||||
if dDepth2 > dDepth + BD.DRILL_OVERLAP then
|
||||
sDrilling2, nType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2 = ML.FindDrilling( dDiam, dCheckDepth2, bDrillDown)
|
||||
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
|
||||
dCheckDepth2 = nil
|
||||
sDrilling2, nType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2 = ML.FindDrilling( dDiam, 0, bDrillDown)
|
||||
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
|
||||
@@ -276,7 +286,10 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
nErrorCode = 2
|
||||
-- rifaccio ricerca lavorazione senza specificare la profondità (dovrebbe trovare l'utensile più corto)
|
||||
else
|
||||
sDrilling2, nType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2 = ML.FindDrilling( dDiam, 0, bDrillDown)
|
||||
sDrilling2, sType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2 = ML.FindDrilling( dDiam, 0, bDrillDown)
|
||||
if not sDrilling2 and bDrillUp then
|
||||
sDrilling2, sType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2 = ML.FindDrilling( dDiam, 0)
|
||||
end
|
||||
if not sDrilling2 then
|
||||
nErrorCode = 1
|
||||
end
|
||||
@@ -304,7 +317,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
---------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
elseif nErrorCode == 0 and not bToInvert and bCommonCompare and abs(vtExtr:getY()) > 0.866 and Proc.Flg == 2 and dMaxToolLength2 > BD.MAX_TOOL_LEN_BACK_HOR_MACH then
|
||||
sDrilling = sDrilling2
|
||||
nType = nType2
|
||||
sType = sType2
|
||||
dMaxDepth = dMaxDepth2
|
||||
dToolDiam = dToolDiam2
|
||||
dDiamTh = dDiamTh2
|
||||
@@ -332,8 +345,10 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
local dSubL3 = 0
|
||||
local dDeltaRad = ( Proc.Diam - dToolDiam) / 2
|
||||
-- se foro non su testa o coda e inclinato, limito il massimo affondamento
|
||||
local bInMid = false
|
||||
local bInvertFcse = ( bToInvert and Proc.Flg ~= -2)
|
||||
if ( not bInvertFcse and Proc.Fcs ~= 5 and Proc.Fcs ~= 6) or ( bInvertFcse and Proc.Fce ~= 5 and Proc.Fce ~= 6) then
|
||||
bInMid = true
|
||||
local CosB = abs( vtExtr:getX())
|
||||
if CosB < BD.DRILL_VX_MAX then
|
||||
local TgA = CosB / sqrt( 1 - CosB * CosB)
|
||||
@@ -345,6 +360,9 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
-- se foro davanti o dietro e inclinato, limito il massimo affondamento
|
||||
if dMaxDepth > 0 and abs( vtExtr:getY()) > abs( vtExtr:getZ()) then
|
||||
local CosB = abs( vtExtr:getZ())
|
||||
if bInMid then
|
||||
CosB = sqrt( vtExtr:getZ() * vtExtr:getZ() + vtExtr:getX() * vtExtr:getX())
|
||||
end
|
||||
if CosB < BD.DRILL_VX_MAX then
|
||||
local TgA = CosB / sqrt( 1 - CosB * CosB)
|
||||
dSubL2 = ( dDiamTh / 2 + dDeltaRad + 2) * TgA
|
||||
@@ -355,6 +373,9 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
-- se foro sopra o sotto e inclinato, limito il massimo affondamento
|
||||
if dMaxDepth > 0 and abs( vtExtr:getZ()) > abs( vtExtr:getY()) then
|
||||
local CosB = abs( vtExtr:getY())
|
||||
if bInMid then
|
||||
CosB = sqrt( vtExtr:getY() * vtExtr:getY() + vtExtr:getX() * vtExtr:getX())
|
||||
end
|
||||
if CosB < BD.DRILL_VX_MAX then
|
||||
local TgA = CosB / sqrt( 1 - CosB * CosB)
|
||||
dSubL3 = ( dDiamTh / 2 + dDeltaRad + 2) * TgA
|
||||
@@ -377,7 +398,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- eventuale inversione
|
||||
if nType == 'Drill' then
|
||||
if sType == 'Drill' or sType == 'Drill_H2' then
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, bToInvert)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, bToInvert)
|
||||
@@ -410,7 +431,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill
|
||||
local sUserNotes = 'VMRS=0;'
|
||||
-- se foratura
|
||||
if nType == 'Drill' then
|
||||
if sType == 'Drill' or sType == 'Drill_H2' then
|
||||
-- aggiungo alle note massima elevazione (coincide con affondamento)
|
||||
sUserNotes = sUserNotes .. 'MaxElev=' .. EgtNumToString( dDepth, 1) .. ';'
|
||||
-- se foro passante, aggiungo questa qualifica alle note
|
||||
@@ -428,7 +449,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
-- eseguo
|
||||
local bOk = EgtApplyMachining( true, false)
|
||||
if not bOk and BD.DOWN_HEAD then
|
||||
if nType == 'Drill' then
|
||||
if sType == 'Drill' or sType == 'Drill_H2' then
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
|
||||
Reference in New Issue
Block a user