From 63a3cfe698fe5b6e4e6ace19f34775ed181d521a Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Mon, 15 May 2023 13:31:33 +0200 Subject: [PATCH] =?UTF-8?q?primo=20implemento=20ciclo=20priorit=C3=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/WallExec.lua | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/LuaLibs/WallExec.lua b/LuaLibs/WallExec.lua index 839fb75..c296188 100644 --- a/LuaLibs/WallExec.lua +++ b/LuaLibs/WallExec.lua @@ -535,7 +535,7 @@ local function SortMach( nPhase, PrevMch, nPartId, nType, StartNames, bExistName end ------------------------------------------------------------------------------------------------------------- -local function SortMachinings( nPhase, PrevMch, nPartId) +local function SortMachinings( nPhase, PrevMch, nPartId, bOnlyPriority) -- Chiodature PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Nail_'}, true, nil, nil, nil, true) -- Tagli con sega a catena che sono rifiniture di spigoli @@ -641,6 +641,19 @@ function WallExec.ProcessFeatures() -- riordino le lavorazioni tra tutti i pezzi local nPhase = 1 local PrevMch = EgtGetPhaseDisposition( nPhase) + + local vPriority = {} + local nOperId = EgtGetNextOperation( PrevMch) + local nCurrentPriorityId = 1 + while nOperId do + local nPriority = EgtGetInfo( nOperId or GDB_ID.NULL, 'PRIORITY', 'i') + if nPriority and nPriority ~= 0 then vPriority[nCurrentPriorityId] = nPriority end + nCurrentPriorityId = nCurrentPriorityId + 1 + end + for i = 1, #vPriority do + PrevMch = SortMachinings( nPhase, PrevMch, nil, vPriority[i]) + end + SortMachinings( nPhase, PrevMch) -- Aggiornamento finale di tutto EgtSetCurrPhase( 1)