- negli outline con priorità da btl aggiunta la rimozione sfridi per la lavorazione successiva

This commit is contained in:
luca.mazzoleni
2023-06-07 18:28:12 +02:00
parent f6caf21581
commit de9fa79f8a
10 changed files with 67 additions and 38 deletions
+30 -3
View File
@@ -1,6 +1,7 @@
-- WallExec.lua by Egaltech s.r.l. 2023/03/06
-- Libreria esecuzione lavorazioni per Pareti
-- 2023/05/25 Aggiunto ordinamento in base a prioritò da btl.
-- 2023/05/25 Aggiunto ordinamento in base a priorità da btl.
-- 2023/06/07 Nel caso di outline con priorità aggiunta la rimozione degli sfridi nella lavorazione successiva.
-- Tabella per definizione modulo
local WallExec = {}
@@ -180,7 +181,8 @@ function WallExec.CollectFeatures( PartId, b3Raw)
Proc.CutId = nCutId
Proc.TaskId = nTaskId
Proc.Box = EgtGetBBoxGlob( ProcId, GDB_BB.STANDARD)
if Proc.Box and not Proc.Box:isEmpty() then
Proc.IsOutline = ( Proc.Prc == 251 or Proc.Prc == 252)
if Proc.Box and not Proc.Box:isEmpty() then
table.insert( vProc, Proc)
-- se foro
if Drill.Identify( Proc) then
@@ -584,6 +586,27 @@ local function SortMachinings( nPhase, PrevMch, nPartId, nPriority)
return PrevMch
end
-------------------------------------------------------------------------------------------------------------
-- setto la rimozione sfridi dopo le lavorazioni di outline
function InsertScrapRemoval( nPhase)
local nCurrentOperationId = EgtGetNextOperation( EgtGetPhaseDisposition( nPhase))
local nActiveMachiningId = EgtGetCurrMachining()
while nCurrentOperationId do
local bIsCurrentOperationOutline = ( EgtGetInfo( nCurrentOperationId or GDB_ID.NULL, 'ISOUTLINE', 'b' ) == true)
local bIsCurrentOperationWithPriority = ( EgtGetInfo( nCurrentOperationId or GDB_ID.NULL, 'PRIORITY', 'i' ) > 0)
local nNextOperationId = EgtGetNextOperation (nCurrentOperationId)
local bIsNextOperationOutline = ( EgtGetInfo( nNextOperationId or GDB_ID.NULL, 'ISOUTLINE', 'b' ) == true)
if bIsCurrentOperationOutline and bIsCurrentOperationWithPriority and nNextOperationId and not bIsNextOperationOutline then
EgtSetCurrMachining( nNextOperationId)
local sMachiningNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
sMachiningNotes = sMachiningNotes .. 'ScrapRemove=1;'
EgtSetMachiningParam( MCH_MP.USERNOTES, sMachiningNotes)
end
nCurrentOperationId = EgtGetNextOperation( nCurrentOperationId)
end
EgtSetCurrMachining( nActiveMachiningId)
end
-------------------------------------------------------------------------------------------------------------
function WallExec.ProcessFeatures()
-- errori e stato
@@ -676,9 +699,13 @@ function WallExec.ProcessFeatures()
end
end
end
-- ordinamento standard
SortMachinings( nPhase, PrevMch)
-- Aggiornamento finale di tutto
if nGetPriorityFromBtl > 0 then
InsertScrapRemoval( nPhase)
end
EgtSetCurrPhase( 1)
EgtApplyAllMachinings()
-- altrimenti macchina travi