- Gestione Aggregati con forature multiple
- Aggiunto nuovo tipo di lavorazione: MultiDrill - Aggiunto parametro USE_MULTI_DRILL da mettere nel BeamData per abilitare la gestione
This commit is contained in:
+21
-12
@@ -320,7 +320,7 @@ end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Applicazione della lavorazione
|
||||
function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId, bUseMultiDrill)
|
||||
-- default per costanti
|
||||
BD.DRILL_VX_MAX_ANGLEDRILL = ( BD.DRILL_VX_MAX_ANGLEDRILL or 0.928)
|
||||
-- ingombro del pezzo
|
||||
@@ -393,9 +393,9 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
end
|
||||
-- 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, bDrillUp, bDrillDown, bExcludeH2, bDrillAngTrasm, Proc.IsPredrill)
|
||||
local sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth, bDrillUp, bDrillDown, bExcludeH2, bDrillAngTrasm, Proc.IsPredrill, bUseMultiDrill)
|
||||
if not sDrilling and dCheckDepth then
|
||||
sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, 0, bDrillUp, bDrillDown, bExcludeH2, bDrillAngTrasm, Proc.IsPredrill)
|
||||
sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, 0, bDrillUp, bDrillDown, bExcludeH2, bDrillAngTrasm, Proc.IsPredrill, bUseMultiDrill)
|
||||
if sDrilling then dCheckDepth = nil end
|
||||
end
|
||||
if not sDrilling then
|
||||
@@ -560,7 +560,10 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
return false, sErr
|
||||
end
|
||||
-- aggiungo geometria
|
||||
if Proc.OtherGeometries and #Proc.OtherGeometries > 0 then
|
||||
if Proc.SkippedGeometries and #Proc.SkippedGeometries > 0 then
|
||||
EgtSetMachiningGeometry( Proc.SkippedGeometries)
|
||||
Proc.SkippedGeometries = nil
|
||||
elseif Proc.OtherGeometries and #Proc.OtherGeometries > 0 then
|
||||
local HolesGeometries = {}
|
||||
-- aggiungo foro principale
|
||||
table.insert( HolesGeometries, { AuxId, -1})
|
||||
@@ -576,14 +579,14 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
end
|
||||
-- eventuale inversione
|
||||
if sType == 'Drill' or sType == 'Drill_H2' or sType == 'Drill_AT' or sType == 'AngleDrill' or sType == 'Predrill' then
|
||||
if sType == 'Drill' or sType == 'MultiDrill' or sType == 'Drill_H2' or sType == 'Drill_AT' or sType == 'AngleDrill' or sType == 'Predrill' then
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, bToInvert)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, bToInvert)
|
||||
end
|
||||
-- imposto posizione braccio porta testa
|
||||
local nSCC = MCH_SCC.NONE
|
||||
if bDrillAngTrasm then
|
||||
if bDrillAngTrasm or bUseMultiDrill then
|
||||
nSCC = MCH_SCC.ADIR_NEAR
|
||||
elseif not BD.C_SIMM and not BD.TURN then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
@@ -643,7 +646,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
-- eseguo
|
||||
local bOk = ML.ApplyMachining( true, false)
|
||||
if not bOk and bDownDrill and bOpen and abs( Proc.Flg) == 1 then
|
||||
if sType == 'Drill' or sType == 'Drill_H2' or sType == 'AngleDrill' then
|
||||
if sType == 'Drill' or sType == 'MultiDrill' or sType == 'Drill_H2' or sType == 'AngleDrill' then
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
@@ -651,10 +654,16 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
bOk = ML.ApplyMachining( true, false)
|
||||
end
|
||||
|
||||
-- TODO gestione foratura multipla
|
||||
-- in caso di foratura multipla, bisogna farsi restituire le geometrie non lavorate e lavorarle poi singolarmente.
|
||||
-- Restituire come AddedIds della LapJoint
|
||||
-- local AddedIds = ..........
|
||||
-- in caso di fori raggruppati, mi faccio restituire gli eventuali fori saltati
|
||||
local SkippedGeometries = {}
|
||||
SkippedGeometries = EgtGetMachiningSkippedGeometry()
|
||||
if #SkippedGeometries > 0 and bUseMultiDrill then
|
||||
if #SkippedGeometries == #Proc.OtherGeometries + 1 then
|
||||
EgtRemoveOperation( nMchId)
|
||||
end
|
||||
Proc.SkippedGeometries = SkippedGeometries
|
||||
ProcessDrill.Make( Proc, nPhase, nRawId, nPartId, false)
|
||||
end
|
||||
|
||||
if not bOk then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
@@ -670,7 +679,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
end
|
||||
end
|
||||
|
||||
return true, sMyWarn, nil, AddedIds
|
||||
return true, sMyWarn
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user