diff --git a/LuaLibs/WMachiningLib.lua b/LuaLibs/WMachiningLib.lua index 812dd73..acce115 100644 --- a/LuaLibs/WMachiningLib.lua +++ b/LuaLibs/WMachiningLib.lua @@ -6,6 +6,7 @@ -- 2023/06/07 Alla funzione AddMachining aggiunta la scrittura di alcune info alle lavorazioni. -- 2023/07/13 In FindMilling, FindPocketing aggiunta la possibilità di limitare la ricerca lavorazioni alla sola testa specificata. -- 2023/10/18 In SetCurrMachiningAndTool sostituito controllo di utensile attivo con controllo utensile nel setup corrente. +-- 2023/10/30 In FindPocketing aggiunto parametro per poter escludere le frese che non lavorano di testa. -- Tabella per definizione modulo local WMachiningLib = {} @@ -103,7 +104,7 @@ function WMachiningLib.FindNailing( nType) end --------------------------------------------------------------------- -function WMachiningLib.FindPocketing( sType, dMaxDiam, dDepth, nTool_ID, sHead) +function WMachiningLib.FindPocketing( sType, dMaxDiam, dDepth, nTool_ID, sHead, bExcludeNoTipFeed) for i = 1, #Pocketings do local Pocketing = Pocketings[i] if Pocketing.On and Pocketing.Type == sType and SetCurrMachiningAndTool( Pocketing.Name) then @@ -112,11 +113,13 @@ function WMachiningLib.FindPocketing( sType, dMaxDiam, dDepth, nTool_ID, sHead) local dTMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), EgtTdbGetCurrToolMaxDepth()) local nMyTool_ID = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'Tool_ID', 'i') local sMyHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD) + local bHasTipFeed = ( EgtTdbGetCurrToolParam( MCH_TP.TIPFEED) ~= 0) if nMchType == MCH_MY.POCKETING and ( not dMaxDiam or dTDiam < dMaxDiam + GEO.EPS_SMALL) and ( not dDepth or dTMaxDepth > dDepth - GEO.EPS_SMALL) and ( not nTool_ID or nTool_ID == 0 or nTool_ID == nMyTool_ID) and - ( not sHead or sHead == sMyHead) then + ( not sHead or sHead == sMyHead) and + ( not bExcludeNoTipFeed or bHasTipFeed) then return Pocketing.Name, dTDiam, dTMaxDepth end end @@ -211,7 +214,7 @@ function WMachiningLib.IsToolDoubleOk( sToolMasterName, sToolDoubleName) local dTMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, dTMaxMat, EgtTdbGetCurrToolMaxDepth()) local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) local dTDiamTh = EgtTdbGetCurrToolThDiam() or 0 - local bTipFeed = EgtTdbGetCurrToolParam( MCH_TP.TIPFEED) > 0 + local bHasTipFeed = EgtTdbGetCurrToolParam( MCH_TP.TIPFEED) ~= 0 local dTMaxDepthOnSide = EgtIf( bIsBlade, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), min( EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDEDEPTH', 'd') or 999, 0.5 * ( dTDiam - dTDiamTh))) local bIsPrimaryHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD) == 'H1' -- dimensioni utensile double @@ -221,7 +224,7 @@ function WMachiningLib.IsToolDoubleOk( sToolMasterName, sToolDoubleName) local dTMaxDepthDouble = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, dTMaxMatDouble, EgtTdbGetCurrToolMaxDepth()) local dTDiamDouble = EgtTdbGetCurrToolParam( MCH_TP.DIAM) local dTDiamThDouble = EgtTdbGetCurrToolThDiam() or 0 - local bTipFeedDouble = EgtTdbGetCurrToolParam( MCH_TP.TIPFEED) > 0 + local bHasTipFeedDouble = EgtTdbGetCurrToolParam( MCH_TP.TIPFEED) ~= 0 local dTMaxDepthOnSideDouble = EgtIf( bIsBladeDouble, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), min( EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDEDEPTH', 'd') or 999, 0.5 * ( dTDiamDouble - dTDiamThDouble))) -- controllo che siano uguali bIsToolDoubleOk = bIsPrimaryHead and @@ -230,7 +233,7 @@ function WMachiningLib.IsToolDoubleOk( sToolMasterName, sToolDoubleName) ( dTMaxDepthDouble > dTMaxDepth - 100 * GEO.EPS_SMALL) and ( abs( dTDiam - dTDiamDouble) < 100 * GEO.EPS_SMALL) and ( abs( dTDiamTh - dTDiamThDouble) < 100 * GEO.EPS_SMALL) and - ( bTipFeed == bTipFeedDouble) and + ( bHasTipFeed == bHasTipFeedDouble) and ( abs( dTMaxDepthOnSide - dTMaxDepthOnSideDouble) < GEO.EPS_SMALL) and EgtFindToolInCurrSetup( sToolDoubleName) return bIsToolDoubleOk diff --git a/LuaLibs/WProcessLapJoint.lua b/LuaLibs/WProcessLapJoint.lua index a8cd712..748fee0 100644 --- a/LuaLibs/WProcessLapJoint.lua +++ b/LuaLibs/WProcessLapJoint.lua @@ -30,6 +30,7 @@ -- 2023/09/21 Modifica controllo lavorabilità con tre facce tipo tunnel ma non ortogonali tra loro. -- 2023/09/21 In MakeByMill modificato SCC per correggere caso con lama su testa fresa. -- 2023/10/02 Aggiunta segnalazione lavorazione tipo Side non trovata. +-- 2023/10/30 In VerifyPocket, per tasche in doppio forzata ricerca fresa che possa lavorare di testa. -- Tabella per definizione modulo local WPL = {} @@ -2214,7 +2215,7 @@ local function VerifyPocket( Proc, dMaxDiameter, dElev, nRawId, dH, dV) -- se doppio cerco una lavorazione adatta if Proc.Double and Proc.Double == 2 then local sPocketingBackup = sPocketing - sPocketing = WM.FindPocketing( 'Pocket', dMaxDiameter, EgtIf( bUseDElevToFindPocketing, dElev, nil), nil, 'H1') + sPocketing = WM.FindPocketing( 'Pocket', dMaxDiameter, EgtIf( bUseDElevToFindPocketing, dElev, nil), nil, 'H1', true) if not WM.IsMachiningOkForDouble( sPocketing) then Proc.Double = 0 sPocketing = sPocketingBackup @@ -2249,7 +2250,7 @@ local function VerifyPocket( Proc, dMaxDiameter, dElev, nRawId, dH, dV) -- se doppio cerco una lavorazione adatta if Proc.Double and Proc.Double == 2 then local sPocketingBackup = sPocketing - sPocketing = WM.FindPocketing( 'Pocket', dMaxDiameter, EgtIf( bUseDElevToFindPocketing, dElev, nil), nil, 'H1') + sPocketing = WM.FindPocketing( 'Pocket', dMaxDiameter, EgtIf( bUseDElevToFindPocketing, dElev, nil), nil, 'H1', true) if not WM.IsMachiningOkForDouble( sPocketing) then Proc.Double = 0 sPocketing = sPocketingBackup diff --git a/LuaLibs/WallExec.lua b/LuaLibs/WallExec.lua index bfb369c..fecc960 100644 --- a/LuaLibs/WallExec.lua +++ b/LuaLibs/WallExec.lua @@ -5,6 +5,7 @@ -- 2023/06/27 Aggiunte origini TN e BN. -- 2023/07/04 Se c'è funzione di macchina WD.GetOrigCorner si lascia scegliere posizione default a questa impostando 0 se non c'è 'REFPOS'. -- 2023/10/16 Aggiunta gestione Aree vietate (LockOut) per chiodature. +-- 2023/10/30 In SetMirroredFeatures permesso il doppio per groove con specchiata non sul fianco se settate per essere lavorate come pocket. -- Tabella per definizione modulo local WallExec = {} @@ -796,7 +797,7 @@ local function SetMirroredFeatures( vProc, b3Raw) end end -- corrispondenza nella posizione delle feature. Se di fianco il lato master è sempre quello verso l'operatore, se sopra nessun vincolo - local bIsMirrorSideOk = ( bLapVsTop and ProcMirror.AffectedFaces.Back and bIsFeatureOnEdge and bIsMirrorFeatureOnEdge ) or + local bIsMirrorSideOk = ( bLapVsTop and ProcMirror.AffectedFaces.Back and bIsFeatureOnEdge and ( bIsMirrorFeatureOnEdge or nDoubleType == 1)) or Proc.TopologyLongName == 'Groove-Through-RightAngles-Parallel-3' and Proc.AffectedFaces.Top and ProcMirror.AffectedFaces.Top or Proc.TopologyLongName == 'Groove-Blind-RightAngles-Parallel-4' and Proc.AffectedFaces.Top and Proc.AffectedFaces.Left and ProcMirror.AffectedFaces.Top and ProcMirror.AffectedFaces.Left or Proc.TopologyLongName == 'Groove-Blind-RightAngles-Parallel-4' and Proc.AffectedFaces.Top and Proc.AffectedFaces.Right and ProcMirror.AffectedFaces.Top and ProcMirror.AffectedFaces.Right or