From 868161df0ba27ec3bca0aa85ff5c19fbb617ea89 Mon Sep 17 00:00:00 2001 From: DarioS Date: Fri, 26 May 2023 08:37:02 +0200 Subject: [PATCH] =?UTF-8?q?DataBeam=20:=20-=20correzione=20a=20foratura=20?= =?UTF-8?q?per=20fori=20annegati=20nel=20pezzo=20e=20quindi=20da=20non=20f?= =?UTF-8?q?are=20(quale=20=C3=A8=20il=20vero=20ingresso=20=3F)=20-=20ricon?= =?UTF-8?q?oscimento=20fori=20da=20sotto=20anche=20dalla=20faccia=20di=20i?= =?UTF-8?q?ngresso=20-=20in=20foratura=20se=20TURN=20aggiunta=20possibilit?= =?UTF-8?q?=C3=A0=20di=20forare=20da=20sotto=20-=20correzioni=20a=20Profil?= =?UTF-8?q?i=20Concavo=20e=20Convesso=20per=20TURN.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/ProcessDrill.lua | 14 +++++++---- LuaLibs/ProcessProfConcave.lua | 46 +++++++++++++++++++++++++++++----- LuaLibs/ProcessProfConvex.lua | 46 +++++++++++++++++++++++++++++----- Version.lua | 4 +-- 4 files changed, 91 insertions(+), 19 deletions(-) diff --git a/LuaLibs/ProcessDrill.lua b/LuaLibs/ProcessDrill.lua index 0a45da4..61f5964 100644 --- a/LuaLibs/ProcessDrill.lua +++ b/LuaLibs/ProcessDrill.lua @@ -156,6 +156,10 @@ function ProcessDrill.Classify( Proc, b3Raw) ptCen = ptCen + vtExtr * dLen end end + -- verifico se foro annegato nel pezzo e quindi non lavorabile + if Proc.Fcs == 0 and Proc.Fce == 0 then + return false, false, false + end -- verifico se troppo inclinato e quindi non lavorabile if not ( Proc.Fcs == 5 or Proc.Fcs == 6 or Proc.Fce == 5 or Proc.Fce == 6) and abs( vtExtr:getX()) > BD.DRILL_VX_MAX then return false, false, false @@ -237,7 +241,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) end local bOpen = ( Proc.Fcs ~= 0 and Proc.Fce ~= 0) -- verifico possibilità di foratura da sotto - local bDownDrill = ( BD.DOWN_HEAD and ML.FindDrilling( dDiam, nil, false, true)) + local bDownDrill = ( BD.TURN or ( BD.DOWN_HEAD and ML.FindDrilling( dDiam, nil, false, true))) -- verifico che il foro non sia fattibile solo da sotto local bToInvert = ( vtExtr:getZ() < BD.DRILL_VZ_MIN and not bDownDrill) if bToInvert and ( not bOpen or Proc.Flg ~= 1) then @@ -246,10 +250,10 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) return false, sErr end -- se non già richiesta inversione e invertibile - if not bToInvert and Proc.Flg == 1 and ( -vtExtr:getZ() >= BD.DRILL_VZ_MIN or bDownDrill) then - -- se il foro è cieco o troppo inclinato all'inizio, lo inverto - local _, CosB, _ = GetHoleStartData( ptCen, vtExtr, b3Solid) - if Proc.Fcs == 0 or ( CosB > BD.DRILL_VX_MAX and bOpen) then + if not bToInvert and Proc.Flg == 1 and -vtExtr:getZ() >= BD.DRILL_VZ_MIN then + -- se il foro è cieco o dalla faccia sotto o troppo inclinato all'inizio, lo inverto + local nFac, CosB, _ = GetHoleStartData( ptCen, vtExtr, b3Solid) + if Proc.Fcs == 0 or (( nFac == 2 or CosB > BD.DRILL_VX_MAX) and bOpen) then bToInvert = true end end diff --git a/LuaLibs/ProcessProfConcave.lua b/LuaLibs/ProcessProfConcave.lua index cac5e93..d7a6616 100644 --- a/LuaLibs/ProcessProfConcave.lua +++ b/LuaLibs/ProcessProfConcave.lua @@ -1,10 +1,11 @@ --- ProcessProfConcave.lua by Egaltech s.r.l. 2022/05/28 +-- ProcessProfConcave.lua by Egaltech s.r.l. 2023/05/25 -- Gestione calcolo profilo concavo per Travi -- 2021/05/03 Aggiunta gestione smusso da sopra e sotto per macchina con testa da sotto. -- 2021/06/28 Per macchine con testa sotto, smussi di lato con questa testa se non c'è lav.ne da sopra. -- 2022/02/02 Aggiunta funzione OnlyChamfer. -- 2022/05/24 Aggiunta fresatura da sotto su macchine con testa da sotto. -- 2022/05/28 Aggiunto calcolo svuotatura da modulo di libreria. +-- 2023/05/25 Sistemazione SCC per TURN. -- Tabella per definizione modulo local ProcessProfConcave = {} @@ -195,6 +196,25 @@ local function VerifyCham( Proc, AuxId, nRawId, bMakeVertCham, sDephtCham, sOnly return nChamfer, dDepth, sMilling, sMilling2 end +--------------------------------------------------------------------- +function GetSccForTurn( vtN, sType) + local nSCC + if abs( vtN:getZ()) > abs( vtN:getY()) then + if sType == 'V' then + nSCC = EgtIf( vtN:getZ() > 0, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_ZM) + else + nSCC = EgtIf( vtN:getZ() > 0, MCH_SCC.ADIR_ZP, MCH_SCC.ADIR_ZM) + end + else + if sType == 'V' then + nSCC = EgtIf( vtN:getY() > 0, MCH_SCC.ADIR_ZM, MCH_SCC.ADIR_ZP) + else + nSCC = EgtIf( vtN:getY() > 0, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM) + end + end + return nSCC +end + --------------------------------------------------------------------- -- Applicazione della lavorazione function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) @@ -490,7 +510,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) EgtSetMachiningParam( MCH_MP.DEPTH, dDepth) -- posizione braccio porta testa local nSCC = EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM) - if BD.TURN then nSCC = MCH_SCC.ADIR_ZP end + if BD.TURN then nSCC = GetSccForTurn( vtN) end EgtSetMachiningParam( MCH_MP.SCC, nSCC) -- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale local bFinish @@ -591,7 +611,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) end -- posizione braccio porta testa local nSCC = EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM) - if BD.TURN then nSCC = MCH_SCC.ADIR_ZP end + if BD.TURN then nSCC = GetSccForTurn( vtN) end EgtSetMachiningParam( MCH_MP.SCC, nSCC) -- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale local bFinish @@ -656,14 +676,25 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_BACK) else EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTUP_TOP) - EgtSetMachiningParam( MCH_MP.WORKSIDE, 1) + EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( (dToolMaxDepth/2), 1)) end EgtSetMachiningParam( MCH_MP.INVERT, false) EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH') EgtSetMachiningParam( MCH_MP.STEP, 0) EgtSetMachiningParam( MCH_MP.OFFSR, 0) - if BD.TURN then EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_ZP) end + if BD.TURN then + local nSCC = GetSccForTurn( vtN) + EgtSetMachiningParam( MCH_MP.SCC, nSCC) + -- modifico attacco e uscita per forzare risalita + EgtSetMachiningParam( MCH_MP.STARTADDLEN, dToolDiam / 2) + EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.TANGENT) + EgtSetMachiningParam( MCH_MP.LITANG, 20) + EgtSetMachiningParam( MCH_MP.LIPERP, 20) + EgtSetMachiningParam( MCH_MP.LIELEV, 20) + EgtSetMachiningParam( MCH_MP.ENDADDLEN, dToolDiam / 2) + EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.AS_LI) + end -- eseguo if not ML.ApplyMachining( true, false) then local _, sErr = EgtGetLastMachMgrError() @@ -697,7 +728,10 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) EgtSetMachiningParam( MCH_MP.STEP, 0) EgtSetMachiningParam( MCH_MP.OFFSR, 0) EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dWidth, 1)) - if BD.TURN then EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_ZP) end + if BD.TURN then + local nSCC = GetSccForTurn( vtN) + EgtSetMachiningParam( MCH_MP.SCC, nSCC) + end -- eseguo if not ML.ApplyMachining( true, false) then local _, sErr = EgtGetLastMachMgrError() diff --git a/LuaLibs/ProcessProfConvex.lua b/LuaLibs/ProcessProfConvex.lua index 80af9e2..2c7d072 100644 --- a/LuaLibs/ProcessProfConvex.lua +++ b/LuaLibs/ProcessProfConvex.lua @@ -1,10 +1,11 @@ --- ProcessProfConvex.lua by Egaltech s.r.l. 2022/05/28 +-- ProcessProfConvex.lua by Egaltech s.r.l. 2023/05/25 -- Gestione calcolo profilo convesso per Travi -- 2021/05/03 Aggiunta gestione smusso da sopra e sotto per macchina con testa da sotto. -- 2021/06/28 Per macchine con testa sotto, smussi di lato con questa testa se non c'è lav.ne da sopra. -- 2022/02/02 Aggiunta funzione OnlyChamfer. -- 2022/05/24 Aggiunta fresatura da sotto su macchine con testa da sotto. -- 2022/05/28 Aggiunto calcolo svuotatura da modulo di libreria. +-- 2023/05/25 Sistemazione SCC per TURN. -- Tabella per definizione modulo local ProcessProfConvex = {} @@ -195,6 +196,25 @@ local function VerifyCham( Proc, AuxId, nRawId, bMakeVertCham, sDephtCham, sOnly return nChamfer, dDepth, sMilling, sMilling2 end +--------------------------------------------------------------------- +function GetSccForTurn( vtN, sType) + local nSCC + if abs( vtN:getZ()) > abs( vtN:getY()) then + if sType == 'V' then + nSCC = EgtIf( vtN:getZ() > 0, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_ZM) + else + nSCC = EgtIf( vtN:getZ() > 0, MCH_SCC.ADIR_ZP, MCH_SCC.ADIR_ZM) + end + else + if sType == 'V' then + nSCC = EgtIf( vtN:getY() > 0, MCH_SCC.ADIR_ZM, MCH_SCC.ADIR_ZP) + else + nSCC = EgtIf( vtN:getY() > 0, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM) + end + end + return nSCC +end + --------------------------------------------------------------------- -- Applicazione della lavorazione function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) @@ -490,7 +510,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) EgtSetMachiningParam( MCH_MP.DEPTH, dDepth) -- posizione braccio porta testa local nSCC = EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM) - if BD.TURN then nSCC = MCH_SCC.ADIR_ZP end + if BD.TURN then nSCC = GetSccForTurn( vtN) end EgtSetMachiningParam( MCH_MP.SCC, nSCC) -- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale local bFinish @@ -591,7 +611,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) end -- posizione braccio porta testa local nSCC = EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM) - if BD.TURN then nSCC = MCH_SCC.ADIR_ZP end + if BD.TURN then nSCC = GetSccForTurn( vtN) end EgtSetMachiningParam( MCH_MP.SCC, nSCC) -- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale local bFinish @@ -656,14 +676,25 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_BACK) else EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTUP_TOP) - EgtSetMachiningParam( MCH_MP.WORKSIDE, 1) + EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( (dToolMaxDepth/2), 1)) end EgtSetMachiningParam( MCH_MP.INVERT, false) EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH') EgtSetMachiningParam( MCH_MP.STEP, 0) EgtSetMachiningParam( MCH_MP.OFFSR, 0) - if BD.TURN then EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_ZP) end + if BD.TURN then + local nSCC = GetSccForTurn( vtN, 'V') + EgtSetMachiningParam( MCH_MP.SCC, nSCC) + -- modifico attacco e uscita per forzare risalita + EgtSetMachiningParam( MCH_MP.STARTADDLEN, dToolDiam / 2) + EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.TANGENT) + EgtSetMachiningParam( MCH_MP.LITANG, 20) + EgtSetMachiningParam( MCH_MP.LIPERP, 20) + EgtSetMachiningParam( MCH_MP.LIELEV, 20) + EgtSetMachiningParam( MCH_MP.ENDADDLEN, dToolDiam / 2) + EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.AS_LI) + end -- eseguo if not ML.ApplyMachining( true, false) then local _, sErr = EgtGetLastMachMgrError() @@ -697,7 +728,10 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) EgtSetMachiningParam( MCH_MP.STEP, 0) EgtSetMachiningParam( MCH_MP.OFFSR, 0) EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dWidth, 1)) - if BD.TURN then EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_ZP) end + if BD.TURN then + local nSCC = GetSccForTurn( vtN) + EgtSetMachiningParam( MCH_MP.SCC, nSCC) + end -- eseguo if not ML.ApplyMachining( true, false) then local _, sErr = EgtGetLastMachMgrError() diff --git a/Version.lua b/Version.lua index abf9560..d76bca4 100644 --- a/Version.lua +++ b/Version.lua @@ -1,6 +1,6 @@ --- Version.lua by Egaltech s.r.l. 2023/05/18 +-- Version.lua by Egaltech s.r.l. 2023/05/26 -- Gestione della versione di Beam NAME = 'Beam' -VERSION = '2.5e4' +VERSION = '2.5e5' MIN_EXE = '2.5c1'