From 3764c583945e729763e4e41949ecfbdfca6897a2 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Tue, 1 Oct 2024 15:57:17 +0200 Subject: [PATCH] - in ProcessCut aggiunta Q07 per forzare uso fresa (si passa a LapJoint) - in LapJoint gestita feature in arrivo da Cut e piccole correzioni --- LuaLibs/ProcessCut.lua | 9 ++++++++- LuaLibs/ProcessLapJoint.lua | 37 ++++++++++++++++++++++--------------- 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/LuaLibs/ProcessCut.lua b/LuaLibs/ProcessCut.lua index 1120525..d275a64 100644 --- a/LuaLibs/ProcessCut.lua +++ b/LuaLibs/ProcessCut.lua @@ -46,7 +46,14 @@ local ML = require( 'MachiningLib') --------------------------------------------------------------------- -- Riconoscimento della feature function ProcessCut.Identify( Proc) - return ( ( Proc.Grp == 1 or Proc.Grp == 2) and Proc.Prc == 10) + -- se richiesto si forza fresatura + Proc.bForceMill = ( EgtGetInfo( Proc.Id, 'Q07', 'd') or 0) == 1 + + if Proc.bForceMill then + return false + else + return ( ( Proc.Grp == 1 or Proc.Grp == 2) and Proc.Prc == 10) + end end --------------------------------------------------------------------- diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index b4d835c..dc3d00b 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -155,18 +155,22 @@ local bTrySidePocketAtFirst = true --------------------------------------------------------------------- -- Riconoscimento della feature function ProcessLapJoint.Identify( Proc) - return ( (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 16) or - (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 17) or - (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 20) or - (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 25) or - (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 30) or - (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 32) or - (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 33) or - (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 34) or - (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 90) or - ( Proc.Grp == 4 and Proc.Prc == 37) or - ( Proc.Grp == 4 and Proc.Prc == 39) or - ( Proc.Grp == 4 and Proc.Prc == 120)) + if Proc.bForceMill then + return true + else + return ( (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 16) or + (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 17) or + (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 20) or + (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 25) or + (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 30) or + (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 32) or + (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 33) or + (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 34) or + (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 90) or + ( Proc.Grp == 4 and Proc.Prc == 37) or + ( Proc.Grp == 4 and Proc.Prc == 39) or + ( Proc.Grp == 4 and Proc.Prc == 120)) + end end --------------------------------------------------------------------- @@ -986,8 +990,11 @@ local function MakeOneFaceByMill( Proc, nPhase, nRawId, nPartId) EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( bUp, MCH_MILL_FU.ORTHO_RIGHT, MCH_MILL_FU.PARAL_RIGHT)) end -- imposto lato di correzione - EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) - if not bUp then EgtSetMachiningParam( MCH_MP.INVERT, true) end + EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) + if not bUp then + EgtSetMachiningParam( MCH_MP.INVERT, true) + EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) + end -- imposto posizione braccio porta testa if vtN:getY() < GEO.EPS_SMALL then EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YM) @@ -7241,7 +7248,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) -- in base al tipo di feature attribuisco il significato dei parametri Q AssignQIdent( Proc) -- se non forzate frese, uso la lama - local bUseBlade = EgtIf( Proc.Prc == 90, false, EgtGetInfo( Proc.Id, Q_USE_ROUGH_TOOL, 'i') ~= 1 and EgtGetInfo( Proc.Id, Q_USE_MILL, 'i') ~= 1) + local bUseBlade = EgtIf( Proc.Prc == 90 or Proc.bForceMill, false, EgtGetInfo( Proc.Id, Q_USE_ROUGH_TOOL, 'i') ~= 1 and EgtGetInfo( Proc.Id, Q_USE_MILL, 'i') ~= 1) local nForceUseBladeOnNotContinueFace -- se ho attivo la lama e ho la feature 30, verifico i parametri Q propri della feature if bUseBlade then