From 580a7cbc172caacf987672853f283dbd0ae97adf Mon Sep 17 00:00:00 2001 From: DarioS Date: Mon, 10 May 2021 15:15:45 +0200 Subject: [PATCH] =?UTF-8?q?DataBeam=20:=20-=20in=20LapJoint=20estesa=20ges?= =?UTF-8?q?tione=20angoli=20asse=20virtuale=20per=20sega=20a=20catena=20(l?= =?UTF-8?q?a=20macchina=20pu=C3=B2=20fornire=20la=20funzione=20BD.GetChain?= =?UTF-8?q?SawBlockedAxis=20di=20calcolo)=20-=20in=20LapJoint=20modificata?= =?UTF-8?q?=20gestione=20U=20e=20L=20senza=20facce=20di=20terminazione=20p?= =?UTF-8?q?er=20frese=20grandi=20che=20non=20lavorano=20di=20testa.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/ProcessLapJoint.lua | 71 ++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 36 deletions(-) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 5004b91..9cb60ce 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -204,6 +204,19 @@ local function TestElleShape4( Proc) end end +--------------------------------------------------------------------- +local function GetChainSawBlockedAxis( nInd) + if BD.GetChainSawBlockedAxis then + return BD.GetChainSawBlockedAxis( nInd) + else + if nInd == 1 then + return EgtIf( BD.C_SIMM, 'A=90', 'A=0') + else + return EgtIf( BD.C_SIMM, 'A=0', 'A=90') + end + end +end + --------------------------------------------------------------------- local function VerifyChainSaw( Proc, dMinDim, dMaxDim, vtOrtho) local bUseChainSaw = false @@ -2174,7 +2187,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, EgtSetMachiningParam( MCH_MP.ENDADDLEN, EgtIf( bOpenEnd, 0, - dSawWidth / 2)) end -- imposto angolo 3° asse rot - EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, EgtIf( BD.C_SIMM, 'A=90', 'A=0')) + EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, GetChainSawBlockedAxis( 1)) -- imposto offset radiale local dOffs = ( i - 1) * dStep EgtSetMachiningParam( MCH_MP.OFFSR, dOffs) @@ -2195,7 +2208,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, EgtSetOperationMode( nMchFId, false) return false, sErr end - EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, EgtIf( BD.C_SIMM, 'A=0', 'A=90')) + EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, GetChainSawBlockedAxis( 2)) if BD.C_SIMM then if vtN:getY() > 0 then EgtSetMachiningParam( MCH_MP.INITANGS, 'C=180') @@ -2253,7 +2266,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, --else -- EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_RIGHT) end - EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, EgtIf( BD.C_SIMM, 'A=90', 'A=0')) + EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, GetChainSawBlockedAxis( 1)) -- imposto offset radiale local dOffs = ( i - 1) * dStep EgtSetMachiningParam( MCH_MP.OFFSR, dOffs) @@ -2276,7 +2289,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, EgtSetOperationMode( nMchFId, false) return false, sErr end - EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, EgtIf( BD.C_SIMM, 'A=0', 'A=90')) + EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, GetChainSawBlockedAxis( 2)) if BD.C_SIMM then local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nLundIdFace, GDB_ID.ROOT) if vtN:getY() > 0 then @@ -3139,7 +3152,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_BACK) end -- imposto angolo 3° asse rot - EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, EgtIf( BD.C_SIMM, 'A=90', 'A=0')) + EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, GetChainSawBlockedAxis( 1)) -- imposto offset radiale local dOffs = ( i - 1) * dStep EgtSetMachiningParam( MCH_MP.OFFSR, dOffs) @@ -3159,7 +3172,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa EgtSetOperationMode( nMchFId, false) return false, sErr end - EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, EgtIf( BD.C_SIMM, 'A=0', 'A=90')) + EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, GetChainSawBlockedAxis( 2)) if BD.C_SIMM then local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nLundIdFace, GDB_ID.ROOT) if vtN:getY() > 0 then @@ -3469,25 +3482,16 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa -- abilitazione lavorazione da sotto local bMillUp = ( BD.DOWN_HEAD and vtN:getZ() > -0.259) local bMillDown = ( BD.DOWN_HEAD and vtN:getZ() < 0.342) - -- settaggio voluto da Alessandro - local sMchFind = EgtIf( bSinglePart, 'Pocket', 'OpenPocket') + -- settaggio voluto da Alessandro/Fabio (per fare angoli con fresa piccola) + sMchFind = 'Pocket' + if ( Proc.Fct == 1) or ( Proc.Fct == 2 and bIsL) or ( Proc.Fct == 3 and bIsU) then sMchFind = 'OpenPocket' end sMchFindBackUp = sMchFind local nUseRoughTool = EgtIf( bSinglePart, 0, 1) - -- fino a che nelle svuotature non si può decidere il punto di inizio faccio delle valutazioni - -- se ho passi multipli controllo il numero delle facce - if not bSinglePart then - -- se ho 3 o più facce allora re-imposto il tipo di svuotatura - if ( Proc.Fct == 3 and bIsU) or Proc.Fct > 3 then - sMchFind = 'Pocket' - end - end local dDiam = min( dH, dV) local dDiamMax local nUseRT - -- 04/08/2020 su richiesta di Fabio Squaratti, se settato parametro uso truciolatore (parametro Q), non si devono prendere altre frese, - -- piuttosto si da errore con il truciolatore. - -- Sicuramente questa opzione si scontra facilmente con altre interpretazioni dello stasso parametro Q - -- per tornare comportamento precedente settare bNewCheck = false + -- 04/08/2020 Se settato parametro uso truciolatore (parametro Q), non si devono prendere altre frese, si da errore (Fabio) + -- Questa opzione si scontra facilmente con altre interpretazioni dello stasso parametro Q (per tornare indietro bNewCheck = false) local bNewCheck = true -- se processo 20 e non sto usando il truciolatore if bNewCheck and Proc.Prc == 20 and nUseRoughTool == 0 then @@ -3498,8 +3502,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa nUseRoughTool = 1 end end - -- 03/12/2020 aggiunto controllo su feature 30 - -- se processo 30 e non sto usando il truciolatore + -- 03/12/2020 aggiunto controllo su feature 30 senza uso truciolatore if bNewCheck and Proc.Prc == 30 and nUseRoughTool == 0 then -- verifico se forzato uso truciolatore nUseRT = EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') @@ -3508,19 +3511,16 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa nUseRoughTool = 1 end end - -- verifico dalla forma se non posso prendere utensile grande - if ( Proc.Fct == 3 and bIsU and bSinglePart) or ( Proc.Fct == 2 and bIsL) or Proc.Fct == 1 then - sMchFindBackUp = sMchFind - --ottengo un diametro utensile opportuno - dDiam, sMchFind, nUseRoughTool, dDiamMax = CheckToolDiamByFaces( Proc, nFacInd, bMillDown, dH, dV, bIsU, bIsL, ( dFacElev + dCollSic), nUseRoughTool) - if not dDiam then - sMchFind = sMchFindBackUp - --if nUseRoughTool == 0 then - -- sMchFind = 'OpenPocket' - --end - dDiam = min( dH, dV) - end - end + -- verifico dalla forma se posso prendere utensile grande + --if ( Proc.Fct == 3 and bIsU and bSinglePart) or ( Proc.Fct == 2 and bIsL) or Proc.Fct == 1 then + -- sMchFindBackUp = sMchFind + -- --ottengo un diametro utensile opportuno + -- dDiam, sMchFind, nUseRoughTool, dDiamMax = CheckToolDiamByFaces( Proc, nFacInd, bMillDown, dH, dV, bIsU, bIsL, ( dFacElev + dCollSic), nUseRoughTool) + -- if not dDiam then + -- sMchFind = sMchFindBackUp + -- dDiam = min( dH, dV) + -- end + --end -- se processo 20 e non sto usando il truciolatore if Proc.Prc == 20 and nUseRoughTool == 0 then if nUseRT and nUseRT ~= 0 then @@ -3531,7 +3531,6 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa end end end - --EgtOutLog( 'Mortise Find Diam =' .. EgtNumToString( dDiam)) -- se da sotto, imposto massima lunghezza secondo la direzione local dMaxTotLen if bMillDown and BD.GetBottomToolMaxTotLen then