diff --git a/LuaLibs/MachiningLib.lua b/LuaLibs/MachiningLib.lua index 8d1bc16..b4faff5 100644 --- a/LuaLibs/MachiningLib.lua +++ b/LuaLibs/MachiningLib.lua @@ -3,6 +3,7 @@ -- 2022/05/07 ES Profonde modifiche per scelta ottimale lavorazioni in macchine con più teste. -- 2022/07/27 Aggiunta la gestione del tipo di foratura "AngleDrill" per fori molto inclinati -- 2022/11/02 Modificata scelta utensile ottimizzata. Ora se c'è un utensile più grande disponibile si dà preferenza a quello. +-- 2022/11/25 Per FindMilling implementata la possibilità di escludere la testa H3 dalla ricerca utensile. -- Tabella per definizione modulo local MachiningLib = {} @@ -108,8 +109,9 @@ local function SetCurrMachiningAndTool( sMachName) local sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD) local nHead = tonumber( sHead:sub( 2, #sHead)) local bH2 = ( nHead >= 21 and nHead <= 29) + local bH3 = ( nHead >= 31 and nHead <= 39) local bFixed = ( vFixedHeads[nHead]) - return bActive, sTool, bH2, bFixed + return bActive, sTool, bH2, bFixed, bH3 end --------------------------------------------------------------------- @@ -222,7 +224,7 @@ function ReturnParams( MachiningType, MachiningName, sType, ToolParams) end --------------------------------------------------------------------- -local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead) +local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead, bExcludeH3) if bTopHead == nil and bDownHead == nil then bTopHead = true bDownHead = false @@ -273,8 +275,8 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead) _, sMachiningType = EgtEndsWith( Machining.Type, '_H2') end -- recupero dati utensile - local bToolActive, sToolName, bH2, bFixed = SetCurrMachiningAndTool( Machining.Name) - if Machining.On and sMachiningType == sType and bToolActive then + local bToolActive, sToolName, bH2, bFixed, bH3 = SetCurrMachiningAndTool( Machining.Name) + if Machining.On and sMachiningType == sType and bToolActive and ( not bH3 or bH3 == not bExcludeH3) then local bOk, ToolParams = VerifyTool( MachiningType, sType, Params, bH2) if bOk then if MachineHeadUse == ONE_HEAD then @@ -384,8 +386,8 @@ function MachiningLib.FindAngleDrilling( dDiam, dDepth, bTopHead, bDownHead) end --------------------------------------------------------------------- -function MachiningLib.FindMilling( sType, dDepth, sTuuidMstr, dMaxDiam, dMaxTotLen, bTopHead, bDownHead) - return FindMachining( MCH_MY.MILLING, sType, { Depth = dDepth, TuuidMstr = sTuuidMstr, MaxDiam = dMaxDiam, MaxTotLen = dMaxTotLen}, bTopHead, bDownHead) +function MachiningLib.FindMilling( sType, dDepth, sTuuidMstr, dMaxDiam, dMaxTotLen, bTopHead, bDownHead, bExcludeH3) + return FindMachining( MCH_MY.MILLING, sType, { Depth = dDepth, TuuidMstr = sTuuidMstr, MaxDiam = dMaxDiam, MaxTotLen = dMaxTotLen}, bTopHead, bDownHead, bExcludeH3) end --------------------------------------------------------------------- diff --git a/LuaLibs/ProcessLongCut.lua b/LuaLibs/ProcessLongCut.lua index d47bc00..f72e26b 100644 --- a/LuaLibs/ProcessLongCut.lua +++ b/LuaLibs/ProcessLongCut.lua @@ -860,7 +860,8 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus -- recupero la lavorazione local bDownHead = ( nSide == - 1) sMchType = EgtIf( bDownHead, 'Long2Cut_H2', 'Long2Cut') - local sMilling = ML.FindMilling( sMchType, dElev, nil, nil, nil, not bDownHead, bDownHead) + local bExcludeH3 = bLarghAsFace and abs( nSide) ~= 1 + local sMilling = ML.FindMilling( sMchType, dElev, nil, nil, nil, not bDownHead, bDownHead, bExcludeH3) if not sMilling then local sErr = 'Error : milling '..sMchType..' not found in library' EgtOutLog( sErr)