diff --git a/LuaLibs/MachiningLib.lua b/LuaLibs/MachiningLib.lua index 96049df..88f14a8 100644 --- a/LuaLibs/MachiningLib.lua +++ b/LuaLibs/MachiningLib.lua @@ -173,17 +173,14 @@ function MachiningLib.FindBlade( Proc, ToolSearchParameters) local nBestToolIndex for i = 1, #TOOLS do - local bIsToolCompatible = true + local bIsToolCompatible = false - -- TODO non va bene - da sistemare!!!!! - if TOOLS[i].sFamily ~= 'SAWBLADE' then - bIsToolCompatible = false - end - - if ToolSearchParameters.bAllowTopHead and not ToolSearchParameters.bAllowBottomHead then - bIsToolCompatible = TOOLS[i].SetupInfo.bIsTopHead - elseif ToolSearchParameters.bAllowBottomHead and not ToolSearchParameters.bAllowTopHead then - bIsToolCompatible = TOOLS[i].SetupInfo.bIsBottomHead + if TOOLS[i].sFamily == 'SAWBLADE' then + if ToolSearchParameters.bAllowTopHead and not ToolSearchParameters.bAllowBottomHead then + bIsToolCompatible = TOOLS[i].SetupInfo.bIsTopHead + elseif ToolSearchParameters.bAllowBottomHead and not ToolSearchParameters.bAllowTopHead then + bIsToolCompatible = TOOLS[i].SetupInfo.bIsBottomHead + end end if bIsToolCompatible then @@ -230,12 +227,14 @@ function MachiningLib.FindChainSaw( Proc, ToolSearchParameters) local nBestToolIndex local dBestToolResidualDepth = 0 for i = 1, #TOOLS do - local bIsToolCompatible = true + local bIsToolCompatible = false - if ToolSearchParameters.bAllowTopHead and not ToolSearchParameters.bAllowBottomHead then - bIsToolCompatible = TOOLS[i].SetupInfo.bIsTopHead - elseif ToolSearchParameters.bAllowBottomHead and not ToolSearchParameters.bAllowTopHead then - bIsToolCompatible = TOOLS[i].SetupInfo.bIsBottomHead + if TOOLS[i].sFamily == 'MORTISE' then + if ToolSearchParameters.bAllowTopHead and not ToolSearchParameters.bAllowBottomHead then + bIsToolCompatible = TOOLS[i].SetupInfo.bIsTopHead + elseif ToolSearchParameters.bAllowBottomHead and not ToolSearchParameters.bAllowTopHead then + bIsToolCompatible = TOOLS[i].SetupInfo.bIsBottomHead + end end -- TODO nei confronti tra valori gestire tolleranze diff --git a/Strategies/STR0003/STR0003.lua b/Strategies/STR0003/STR0003.lua index dd45245..b5fd50b 100644 --- a/Strategies/STR0003/STR0003.lua +++ b/Strategies/STR0003/STR0003.lua @@ -82,49 +82,49 @@ local function CalculateLeadInOut( Machining, EdgeToMachine) local LeadIn = {} local LeadOut = {} - LeadIn.StartAddLength = 0 - LeadOut.EndAddLength = 0 + LeadIn.dStartAddLength = 0 + LeadOut.dEndAddLength = 0 if not bIsMortising then - LeadIn.Type = MCH_MILL_LI.LINEAR - LeadOut.Type = MCH_MILL_LI.LINEAR - LeadIn.TangentDistance = 0 - LeadOut.TangentDistance = 0 + LeadIn.nType = MCH_MILL_LI.LINEAR + LeadOut.nType = MCH_MILL_LI.LINEAR + LeadIn.dTangentDistance = 0 + LeadOut.dTangentDistance = 0 if EdgeToMachine.dElevation > -10 * GEO.EPS_SMALL then - LeadIn.PerpDistance = EdgeToMachine.dElevation + BeamData.CUT_SIC - LeadOut.PerpDistance = EdgeToMachine.dElevation + BeamData.CUT_SIC + LeadIn.dPerpDistance = EdgeToMachine.dElevation + BeamData.CUT_SIC + LeadOut.dPerpDistance = EdgeToMachine.dElevation + BeamData.CUT_SIC else - LeadIn.PerpDistance = BeamData.CUT_SIC - LeadOut.PerpDistance = BeamData.CUT_SIC + LeadIn.dPerpDistance = BeamData.CUT_SIC + LeadOut.dPerpDistance = BeamData.CUT_SIC end - LeadIn.Elevation = 0 - LeadOut.Elevation = 0 - LeadIn.CompLength = 0 - LeadOut.CompLength = 0 + LeadIn.dElevation = 0 + LeadOut.dElevation = 0 + LeadIn.dCompLength = 0 + LeadOut.dCompLength = 0 if Machining.bIsStartClosed and Machining.bIsEndClosed then - LeadIn.StartAddLength = -dAddLengthToReduce - LeadOut.EndAddLength = -dAddLengthToReduce + LeadIn.dStartAddLength = -dAddLengthToReduce + LeadOut.dEndAddLength = -dAddLengthToReduce elseif Machining.bIsStartClosed then - LeadIn.StartAddLength = -dAddLengthToReduce + LeadIn.dStartAddLength = -dAddLengthToReduce -- eventuale correzione per accorciamento maggiore di larghezza tasca - LeadOut.EndAddLength = max( -LeadIn.StartAddLength - EdgeToMachine.dLength + 10 * BeamData.CUT_EXTRA, BeamData.CUT_EXTRA) + LeadOut.dEndAddLength = max( -LeadIn.dStartAddLength - EdgeToMachine.dLength + 10 * BeamData.CUT_EXTRA, BeamData.CUT_EXTRA) elseif Machining.bIsEndClosed then - LeadOut.EndAddLength = -dAddLengthToReduce + LeadOut.dEndAddLength = -dAddLengthToReduce -- eventuale correzione per accorciamento maggiore di larghezza tasca - LeadIn.StartAddLength = max( -LeadOut.EndAddLength - EdgeToMachine.dLength + 10 * BeamData.CUT_EXTRA, BeamData.CUT_EXTRA) + LeadIn.dStartAddLength = max( -LeadOut.dEndAddLength - EdgeToMachine.dLength + 10 * BeamData.CUT_EXTRA, BeamData.CUT_EXTRA) else - LeadIn.StartAddLength = BeamData.CUT_EXTRA - LeadOut.EndAddLength = BeamData.CUT_EXTRA + LeadIn.dStartAddLength = BeamData.CUT_EXTRA + LeadOut.dEndAddLength = BeamData.CUT_EXTRA end else if Machining.bIsStartClosed then - LeadIn.StartAddLength = -dAddLengthToReduce + LeadIn.dStartAddLength = -dAddLengthToReduce else - LeadIn.StartAddLength = BeamData.CUT_EXTRA + LeadIn.dStartAddLength = BeamData.CUT_EXTRA end if Machining.bIsEndClosed then - LeadOut.EndAddLength = -dAddLengthToReduce + LeadOut.dEndAddLength = -dAddLengthToReduce else - LeadOut.EndAddLength = BeamData.CUT_EXTRA + LeadOut.dEndAddLength = BeamData.CUT_EXTRA end end @@ -322,7 +322,7 @@ function Blade.CalculateMachiningParameters( Proc, FaceToMachine, EdgeToMachine) Cutting.dRadialOffset = EdgeToMachine.dElevation end else - Cutting.dDepthToMachine = TOOLS[Cutting.nToolIndex].MaxDepth - 1 + Cutting.dDepthToMachine = TOOLS[Cutting.nToolIndex].dMaxDepth - 1 if EdgeToMachine.dElevation > -10 * GEO.EPS_SMALL then Cutting.dRadialOffset = EdgeToMachine.dElevation - Cutting.dDepthToMachine else