piccola modifica per bypassare il check precedente che azzera MaxDepth

This commit is contained in:
luca.mazzoleni
2022-07-05 18:40:16 +02:00
parent 9e3aadd2a6
commit b83f427a55
+8 -49
View File
@@ -319,6 +319,8 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
-- se foro non su testa o coda e inclinato
local bInMid = false
local bInvertFcse = ( bToInvert and Proc.Flg ~= -2)
-- tengo via il valore originale di MaxDepth per poter eventualmente bypassare i check successivi
local dMaxDepthOri = dMaxDepth
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())
@@ -392,53 +394,23 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
nSCC = MCH_SCC.NONE
end
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-----------------------------------------
-- aggiusto l'affondamento
-- local sMyWarn
-- local dMaxElev = dDepth
-- local dToolAddLength = 0
-- -- se c'è un taglio precedente di testa o coda posso impostare MaxElev per allungare il percorso
-- -- considero solo i fori "entranti" in testa o coda
-- if ( Proc.MachineAfterHeadCutId and vtExtr:getX() > 0) or ( Proc.MachineAfterTailCutId and vtExtr:getX() < 0) then
-- local ptCen = EgtCP( AuxId, GDB_RT.GLOB)
-- local bIntersectionOk, _, vDistance = EgtLineSurfTmInters( ptCen, -vtExtr, Proc.MachineAfterHeadCutId or Proc.MachineAfterTailCutId, GDB_RT.GLOB)
-- dHoleToCutDistance = vDistance[1]
-- -- il segno della distanza data dalla funzione di intersezione mi indica dove sia la geometria del foro
-- if bIntersectionOk then
-- if dHoleToCutDistance > 0 then
-- dMaxElev = dLen - dHoleToCutDistance
-- elseif dHoleToCutDistance < 0 then
-- dMaxElev = -dHoleToCutDistance
-- end
-- dToolAddLength = dLen - dMaxElev
-- end
-- end
-- if dDepth - dToolAddLength > dMaxDepth + 10 * GEO.EPS_SMALL then
-- sMyWarn = 'Warning in drill : depth (' .. EgtNumToString( dDepth - dToolAddLength, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth, 1) .. ')'
-- if dMaxDepth == 0 or dToolAddLength == 0 then
-- dDepth = dMaxDepth
-- dMaxElev = dDepth
-- elseif abs( dMaxElev - dDepth) > GEO.EPS_SMALL then
-- dDepth = dLen
-- end
-- EgtOutLog( sMyWarn)
-- end
------------------------------------------
-- aggiusto affondamento e MaxElev
local dMaxElev = dDepth
local sMyWarn
if dDepth > dMaxDepth + 10 * GEO.EPS_SMALL then
-- se c'è un taglio precedente di testa o coda posso impostare MaxElev per allungare il percorso
-- considero solo i fori "entranti" in testa o coda
if (( Proc.MachineAfterHeadCutId and vtExtr:getX() > 0) or ( Proc.MachineAfterTailCutId and vtExtr:getX() < 0)) and dMaxDepth ~= 0 then
if (( Proc.MachineAfterHeadCutId and vtExtr:getX() > 0) or ( Proc.MachineAfterTailCutId and vtExtr:getX() < 0)) then
local ptCen = EgtCP( AuxId, GDB_RT.GLOB)
local bIntersectionOk, _, vDistance = EgtLineSurfTmInters( ptCen, -vtExtr, Proc.MachineAfterHeadCutId or Proc.MachineAfterTailCutId, GDB_RT.GLOB)
dHoleToCutDistance = vDistance[1]
-- setto MaxElev
-- il segno della distanza data dalla funzione di intersezione mi indica dove sia la geometria del foro
if bIntersectionOk then
-- se MaxDepth era stato settato a 0 per disattivare la lavorazione gli riassegno il valore originale
if dMaxDepth == 0 then
dMaxDepth = dMaxDepthOri
end
if dHoleToCutDistance > 0 then
dMaxElev = dLen - dHoleToCutDistance
elseif dHoleToCutDistance < 0 then
@@ -450,6 +422,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
sMyWarn = 'Warning in drill : depth (' .. EgtNumToString( dDepth - dToolAddLength, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth, 1) .. ')'
dDepth = dLen
else
-- se non lavoro la massima lunghezza disponibile devo correggere MaxElev
dMaxElev = dMaxElev - dLen + dDepth
end
-- se per qualche motivo fallisce l'intersezione torno al caso standard
@@ -468,20 +441,6 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
EgtOutLog( sMyWarn)
end
end
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill
local sUserNotes = 'VMRS=0;'