From ea64a9a3f4a1269cc0115f9ae34a578c18fd7dec Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Mon, 30 Jun 2025 17:39:18 +0200 Subject: [PATCH] =?UTF-8?q?In=20FindMachining,=20se=20c'=C3=A8=20un=20crit?= =?UTF-8?q?erio=20di=20selezione=20utensile,=20allora=20non=20si=20ottimiz?= =?UTF-8?q?zano=20le=20teste.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/MachiningLib.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/LuaLibs/MachiningLib.lua b/LuaLibs/MachiningLib.lua index 098bf49..167e9cb 100644 --- a/LuaLibs/MachiningLib.lua +++ b/LuaLibs/MachiningLib.lua @@ -331,6 +331,7 @@ end --------------------------------------------------------------------- local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion) + local bOptimizeHeads = BEAM and BEAM.BW and ( not sSortingCriterion or sSortingCriterion == '') if bTopHead == nil and bDownHead == nil then bTopHead = true bDownHead = false @@ -368,15 +369,15 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead, ForEnd = 1 ForStep = -1 end - if ( BEAM and BEAM.BW) or MachineHeadType == ONE_HEAD or MachineHeadType == TWO_EQUAL_HEADS or ( MachineHeadType == TWO_UP_DOWN_HEADS and not bDownHead) then + if bOptimizeHeads or MachineHeadType == ONE_HEAD or MachineHeadType == TWO_EQUAL_HEADS or ( MachineHeadType == TWO_UP_DOWN_HEADS and not bDownHead) then _, sType = EgtEndsWith( sType, '_H2') - elseif not ( BEAM and BEAM.BW) and MachineHeadType == TWO_UP_DOWN_HEADS and not bTopHead and bDownHead then + elseif not bOptimizeHeads and MachineHeadType == TWO_UP_DOWN_HEADS and not bTopHead and bDownHead then if not EgtEndsWith( sType, '_H2') then sType = sType .. '_H2' end end local MachineHeadUse = MachineHeadType - if not ( BEAM and BEAM.BW) and MachineHeadUse == TWO_EQUAL_HEADS then + if not bOptimizeHeads and MachineHeadUse == TWO_EQUAL_HEADS then MachineHeadUse = ONE_HEAD end if MachineHeadUse == TWO_UP_DOWN_HEADS and bTopHead and bDownHead then @@ -388,7 +389,7 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead, for i = ForStart, ForEnd, ForStep do local Machining = Machinings[i] local sMachiningType = Machining.Type - if ( BEAM and BEAM.BW) or MachineHeadUse == TWO_EQUAL_HEADS then + if bOptimizeHeads or MachineHeadUse == TWO_EQUAL_HEADS then _, sMachiningType = EgtEndsWith( Machining.Type, '_H2') end -- recupero dati utensile @@ -464,7 +465,7 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead, end end local bH2, sOrigType = EgtEndsWith( sType, '_H2') - if ( not BEAM or not BEAM.BW) and MachineHeadType == TWO_UP_DOWN_HEADS and bH2 and bTopHead then + if not bOptimizeHeads and MachineHeadType == TWO_UP_DOWN_HEADS and bH2 and bTopHead then return FindMachining( MachiningType, sOrigType, Params, true, false) end end