diff --git a/LuaLibs/ProcessDtMortise.lua b/LuaLibs/ProcessDtMortise.lua index d641fe4..703d84c 100644 --- a/LuaLibs/ProcessDtMortise.lua +++ b/LuaLibs/ProcessDtMortise.lua @@ -1,8 +1,9 @@ --- ProcessDtMortise.lua by Egaltech s.r.l. 2021/06/28 +-- ProcessDtMortise.lua by Egaltech s.r.l. 2021/07/20 -- Gestione calcolo mortase a coda di rondine per Travi -- 2021/04/08 Aggiunto controllo massimo materiale lavorabile dalla fresa. -- 2021/04/08 Miglioria scelta lavorazione in presenza di testa da sotto. -- 2021/06/28 Aggiunta gestione attacco e uscita con pocket. +-- 2021/07/20 Aggiunta gestione rinvio angolare su FAST. -- Tabella per definizione modulo local ProcessDtMortise = {} @@ -63,7 +64,13 @@ function ProcessDtMortise.Classify( Proc) AuxId = AuxId + Proc.Id local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) -- verifico se la mortasa è lavorabile solo da sotto - local bDown = ( vtExtr:getZ() < - 0.1) + local bDown = ( vtExtr:getZ() < -0.1) + -- se da sotto e presente rinvio angolare verifico se c'è opportuna lavorazione + if bDown and BD.ANG_TRASM then + if ML.FindMilling( 'DtMortise_AT') then + bDown = false + end + end return true, bDown end @@ -131,9 +138,9 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) -- recupero i dati della curva local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) local ptBC = EgtGP( AuxId, GDB_RT.GLOB) - -- verifico che la mortasa non sia orientata verso il basso (-5 deg) o che ci sia una testa da sotto - local bFaceDown = ( vtExtr:getZ() < - 0.1) - if bFaceDown and not BD.DOWN_HEAD then + -- verifico che la mortasa non sia orientata verso il basso (-5 deg) o che ci sia una testa da sotto o un rinvio angolare + local bFaceDown = ( vtExtr:getZ() < -0.1) + if bFaceDown and not BD.DOWN_HEAD and not BD.ANG_TRASM then local sErr = 'Machining from bottom impossible : Error on DtMortise ' .. tostring( Proc.Id) EgtOutLog( sErr) return false, sErr @@ -180,9 +187,15 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) -- abilitazione lavorazione da sotto local bMillUp = ( BD.DOWN_HEAD and vtExtr:getZ() > -0.259) local bMillDown = ( BD.DOWN_HEAD and vtExtr:getZ() < 0.174) + local bMillAngTrasm = ( BD.ANG_TRASM and vtExtr:getZ() < -0.1) -- recupero la lavorazione local sMillType = 'DtMortise' - local sMchExt = EgtIf( bMillDown, '_H2', '') + local sMchExt = '' + if bMillDown then + sMchExt = '_H2' + elseif bMillAngTrasm then + sMchExt = '_AT' + end -- recupero la lavorazione : prima ricerca per sola tipologia local sMilling = ML.FindMilling( sMillType..sMchExt) if not sMilling and bMillUp then @@ -243,11 +256,15 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) end -- recupero la lavorazione local sPocketing - if Proc.Prc ~= 53 then - sPocketing = ML.FindPocketing( 'Mortise'..sMchExt, dToolDiam) + sPocketing = ML.FindPocketing( 'Mortise'..sMchExt, dToolDiam) + if not sPocketing and bMillUp then + sPocketing = ML.FindPocketing( 'Mortise', dToolDiam) end if not sPocketing then sPocketing = ML.FindPocketing( 'Pocket'..sMchExt, dToolDiam) + if not sPocketing and bMillUp then + sPocketing = ML.FindPocketing( 'Pocket', dToolDiam) + end end if not sPocketing then local sErr = 'Error : Mortise or Pocket not found in library' diff --git a/LuaLibs/ProcessMortise.lua b/LuaLibs/ProcessMortise.lua index 8ca553b..dd8eb63 100644 --- a/LuaLibs/ProcessMortise.lua +++ b/LuaLibs/ProcessMortise.lua @@ -1,5 +1,6 @@ --- ProcessMortise.lua by Egaltech s.r.l. 2020/11/08 +-- ProcessMortise.lua by Egaltech s.r.l. 2021/07/20 -- Gestione calcolo mortase per Travi +-- 2021/07/20 Aggiunta gestione rinvio angolare su FAST. -- Tabella per definizione modulo local ProcessMortise = {} @@ -57,6 +58,12 @@ function ProcessMortise.Classify( Proc) -- verifico se la mortasa è lavorabile solo da sotto bDown = ( vtN:getZ() < - 0.1) end + -- se da sotto e presente rinvio angolare verifico se c'è opportuna lavorazione + if bDown and BD.ANG_TRASM then + if ML.FindPocketing( 'Mortise_AT') then + bDown = false + end + end return true, bDown end @@ -164,8 +171,8 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) EgtOutLog( 'ptC=' .. tostring( ptC) ..' vtN=' .. tostring( vtN), 3) -- Se mortasa chiusa if not bOpenBtm then - -- verifico che la mortasa non sia orientata verso il basso (limite -5 deg) - if vtN:getZ() < -0.1 and not BD.DOWN_HEAD then + -- verifico che la mortasa non sia orientata verso il basso (limite -5 deg) o che ci sia una testa da sotto o un rinvio angolare + if vtN:getZ() < -0.1 and not BD.DOWN_HEAD and not BD.ANG_TRASM then local sErr = 'Error : Mortise from bottom impossible' EgtOutLog( sErr) return false, sErr @@ -214,14 +221,31 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) end -- determino larghezza della mortasa if dL < dW then dL, dW = dW, dL end + -- abilitazione lavorazione da sotto + local bPockUp = ( BD.DOWN_HEAD and vtExtr:getZ() > -0.259) + local bPockDown = ( BD.DOWN_HEAD and vtExtr:getZ() < 0.174) + local bPockAngTrasm = ( BD.ANG_TRASM and vtExtr:getZ() < -0.1) -- recupero la lavorazione - local sMchExt = EgtIf( BD.DOWN_HEAD and vtN:getZ() < 0.1, '_H2', '') + local sPockType = 'Mortise' + local sMchExt = '' + if bPockDown then + sMchExt = '_H2' + elseif bPockAngTrasm then + sMchExt = '_AT' + end local sPocketing if Proc.Prc ~= 53 then - sPocketing = ML.FindPocketing( 'Mortise'..sMchExt, dW) + sPocketing = ML.FindPocketing( sPockType..sMchExt, dW) + if not sPocketing and bPockUp then + sPocketing = ML.FindPocketing( sPockType, dW) + end end if not sPocketing then - sPocketing = ML.FindPocketing( 'Pocket'..sMchExt, dW) + sPockType = 'Pocket' + sPocketing = ML.FindPocketing( sPockType..sMchExt, dW) + if not sPocketing and bPockUp then + sPocketing = ML.FindPocketing( sPockType, dW) + end end if not sPocketing then local sErr = 'Error : Mortise or Pocket not found in library' @@ -258,19 +282,17 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) -- sistemo la direzione di lavoro EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bCW, true, false)) -- imposto posizione braccio porta testa - if vtN:getY() < GEO.EPS_SMALL then - if bRevertSide then - EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YP) + local nSCC = MCH_SCC.NONE + if bPockAngTrasm then + nSCC = MCH_SCC.ADIR_NEAR + elseif not BD.C_SIMM then + if vtN:getY() < GEO.EPS_SMALL then + nSCC = EgtIf( bRevertSide, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM) else - EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YM) - end - else - if bRevertSide then - EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YM) - else - EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YP) + nSCC = EgtIf( bRevertSide, MCH_SCC.ADIR_YM, MCH_SCC.ADIR_YP) end end + EgtSetMachiningParam( MCH_MP.SCC, nSCC) local sWarn local nDepthMin -- se la mortasa è passante e non è forzata a un solo lato, riduco l'affondamento a metà profondità