diff --git a/LuaLibs/MachiningLib.lua b/LuaLibs/MachiningLib.lua index f2b58f6..cfce39b 100644 --- a/LuaLibs/MachiningLib.lua +++ b/LuaLibs/MachiningLib.lua @@ -170,7 +170,7 @@ function VerifyTool( Machining, MachiningType, Params, bH2) return VerifyDrillPocket( Machining, Params.Diam, Params.Depth, bH2) end elseif MachiningType == MCH_MY.SAWING then - return true, { H2 = bH2} + return ( not Params.Depth or Machining.Tool.MaxMat > Params.Depth - GEO.EPS_SMALL), { H2 = bH2} elseif MachiningType == MCH_MY.MILLING then return VerifyMill( Machining, Params.Depth, Params.TuuidMstr, Params.MaxDiam, Params.MaxTotLen, bH2) elseif MachiningType == MCH_MY.POCKETING then @@ -450,8 +450,8 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead, end --------------------------------------------------------------------- -function MachiningLib.FindCutting( sType, bTopHead, bDownHead) - return FindMachining( MCH_MY.SAWING, sType, nil, bTopHead, bDownHead) +function MachiningLib.FindCutting( sType, bTopHead, bDownHead, dDepth, sSortingCriterion) + return FindMachining( MCH_MY.SAWING, sType, { Depth = dDepth}, bTopHead, bDownHead, nil, nil, sSortingCriterion) end --------------------------------------------------------------------- diff --git a/LuaLibs/ProcessHeadCut.lua b/LuaLibs/ProcessHeadCut.lua index 96f20a7..51873a5 100644 --- a/LuaLibs/ProcessHeadCut.lua +++ b/LuaLibs/ProcessHeadCut.lua @@ -365,7 +365,7 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut -- eventuali informazioni sul tipo di finitura local nQ05 = EgtGetInfo( nOriId or GDB_ID.NULL, 'Q05', 'i') or 0 -- recupero la lavorazione - local sCutting = ML.FindCutting( 'HeadSide') + local sCutting = ML.FindCutting( 'HeadSide', nil, nil, nil, 'Longest') if not sCutting then local sErr = 'Error : cutting not found in library' EgtOutLog( sErr) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index d362ae0..f4d1b89 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -5268,7 +5268,7 @@ function SawPlusChain.Saw.CalculateMachiningParameters( Proc, FaceToMachine, Edg end -- ricerca lavorazione - Cutting.Name = ML.FindCutting( 'HeadSide', true, false) + Cutting.Name = ML.FindCutting( 'HeadSide', true, false, EdgeToMachine.Elevation) if not Cutting.Name then Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - saw blade not found' Cutting.CanApply = false diff --git a/LuaLibs/ProcessSplit.lua b/LuaLibs/ProcessSplit.lua index ff3a78d..4ee97e2 100644 --- a/LuaLibs/ProcessSplit.lua +++ b/LuaLibs/ProcessSplit.lua @@ -573,7 +573,7 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt if not bOkc then return bOkc, sErrC end end -- recupero la lavorazione - local sCutting = ML.FindCutting( 'TailSide') + local sCutting = ML.FindCutting( 'TailSide', nil, nil, nil, 'Longest') if not sCutting then local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' cutting not found in library' EgtOutLog( sErr)