- correzioni a MultiDrill
This commit is contained in:
+25
-14
@@ -464,16 +464,18 @@ function WPD.Make( Proc, nRawId, b3Raw, bUseMultiDrill, DrillingsToAvoid)
|
||||
elseif bUseMultiDrill then
|
||||
if Proc.SkippedGeometries and #Proc.SkippedGeometries > 0 then
|
||||
EgtSetMachiningGeometry( Proc.SkippedGeometries)
|
||||
elseif Proc.OtherGeometries and #Proc.OtherGeometries > 0 then
|
||||
else
|
||||
local HolesGeometries = {}
|
||||
-- aggiungo foro principale
|
||||
table.insert( HolesGeometries, { AuxId, -1})
|
||||
-- aggiungo altre geometrie connesse
|
||||
for i = 1, #Proc.OtherGeometries do
|
||||
-- recupero geometria da lavorare
|
||||
local OtherAuxId = Proc.OtherGeometries[i].Id + EgtGetInfo( Proc.OtherGeometries[i].Id, 'AUXID', 'i')
|
||||
local Geometry = { OtherAuxId, -1}
|
||||
table.insert( HolesGeometries, Geometry)
|
||||
-- aggiungo eventuali altre geometrie connesse
|
||||
if Proc.OtherGeometries and #Proc.OtherGeometries > 0 then
|
||||
for i = 1, #Proc.OtherGeometries do
|
||||
-- recupero geometria da lavorare
|
||||
local OtherAuxId = Proc.OtherGeometries[i].Id + EgtGetInfo( Proc.OtherGeometries[i].Id, 'AUXID', 'i')
|
||||
local Geometry = { OtherAuxId, -1}
|
||||
table.insert( HolesGeometries, Geometry)
|
||||
end
|
||||
end
|
||||
EgtSetMachiningGeometry( HolesGeometries)
|
||||
end
|
||||
@@ -581,7 +583,8 @@ function WPD.Make( Proc, nRawId, b3Raw, bUseMultiDrill, DrillingsToAvoid)
|
||||
SkippedGeometries = EgtGetMachiningSkippedGeometry()
|
||||
if bUseMultiDrill and SkippedGeometries and #SkippedGeometries > 0 then
|
||||
if ( Proc.SkippedGeometries and ( #SkippedGeometries == #Proc.SkippedGeometries))
|
||||
or ( #SkippedGeometries == #Proc.OtherGeometries + 1) then
|
||||
or ( Proc.OtherGeometries and ( #SkippedGeometries == #Proc.OtherGeometries + 1))
|
||||
or ( not Proc.OtherGeometries and #SkippedGeometries == 1) then
|
||||
EgtRemoveOperation( nMchId)
|
||||
end
|
||||
Proc.SkippedGeometries = SkippedGeometries
|
||||
@@ -591,16 +594,24 @@ function WPD.Make( Proc, nRawId, b3Raw, bUseMultiDrill, DrillingsToAvoid)
|
||||
-- non trovata lavorazione, si prova con le lavorazioni singole
|
||||
if not bOk then
|
||||
for i = #Proc.SkippedGeometries, 1, -1 do
|
||||
for j = 1, #Proc.OtherGeometries do
|
||||
local AuxIdOtherGeometry = EgtGetInfo( Proc.OtherGeometries[j].Id, 'AUXID', 'i') or 0
|
||||
if AuxIdOtherGeometry then AuxIdOtherGeometry = AuxIdOtherGeometry + Proc.OtherGeometries[j].Id end
|
||||
if Proc.OtherGeometries then
|
||||
for j = 1, #Proc.OtherGeometries do
|
||||
local AuxIdOtherGeometry = EgtGetInfo( Proc.OtherGeometries[j].Id, 'AUXID', 'i') or 0
|
||||
if AuxIdOtherGeometry then AuxIdOtherGeometry = AuxIdOtherGeometry + Proc.OtherGeometries[j].Id end
|
||||
if Proc.SkippedGeometries[i][1] == AuxIdOtherGeometry then
|
||||
bOk = WPD.Make( Proc.OtherGeometries[j], nRawId, b3Raw, false)
|
||||
break
|
||||
end
|
||||
end
|
||||
-- se nelle altre geometrie non è stato trovato, potrebbe essere la principale
|
||||
local AuxIdProc = EgtGetInfo( Proc.Id, 'AUXID', 'i') or 0
|
||||
if AuxIdProc then AuxIdProc = AuxIdProc + Proc.Id end
|
||||
if Proc.SkippedGeometries[i][1] == AuxIdOtherGeometry then
|
||||
bOk = WPD.Make( Proc.OtherGeometries[j], nRawId, b3Raw, false)
|
||||
elseif Proc.SkippedGeometries[i][1] == AuxIdProc then
|
||||
if Proc.SkippedGeometries[i][1] == AuxIdProc then
|
||||
bOk = WPD.Make( Proc, nRawId, b3Raw, false)
|
||||
end
|
||||
-- se non ci sono altre geometrie quella da fare è sicuramente la Proc principale
|
||||
else
|
||||
bOk = WPD.Make( Proc, nRawId, b3Raw, false)
|
||||
end
|
||||
if bOk then
|
||||
table.remove( Proc.SkippedGeometries, i)
|
||||
|
||||
Reference in New Issue
Block a user