diff --git a/LuaLibs/ProcessFreeContour.lua b/LuaLibs/ProcessFreeContour.lua index 82ca02e..4485e98 100644 --- a/LuaLibs/ProcessFreeContour.lua +++ b/LuaLibs/ProcessFreeContour.lua @@ -3,6 +3,7 @@ -- 2022/08/23 Aggiunta la funzione MakeByMark per la gestione del caso P13=10 -- 2022/09/21 In MakeByMill aggiunto messaggio per elevazione non raggiunta. -- 2022/11/03 In MakeByMill migliorata gestione lavorazione con fresa su testa da sotto. +-- 2022/11/09 Aggiunta la gestione della chiamata della FreeContour da parte della SimpleScarf. -- Tabella per definizione modulo @@ -308,7 +309,8 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead) end local bStripOnSide = false if bCross then - if dDimStrip > 10 * GEO.EPS_SMALL and ( nStep > 1 or ( bDown and b3Aux:getDimX() > 0.5 * b3Raw:getDimX())) then + -- se chiamata da SimpleScarf il codolo è sempre attivo + if dDimStrip > 10 * GEO.EPS_SMALL and ( nStep > 1 or ( bDown and b3Aux:getDimX() > 0.5 * b3Raw:getDimX()) or Proc.Prc == 70) then -- devo lasciare un codolo dDepth = dDepth - dDimStrip bStripOnSide = true @@ -319,7 +321,8 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead) end local bIsDepthReduced = false -- se parametro beamdata forza codolo in centro e lavorazione orizzontale e se larghezza trave è sufficientemente larga - if BD.DIM_TO_CENTER_STRIP and BD.DIM_TO_CENTER_STRIP > 10 * GEO.EPS_SMALL and nStep > 1 and + -- se chiamata da SimpleScarf il codolo è sempre attivo + if BD.DIM_TO_CENTER_STRIP and BD.DIM_TO_CENTER_STRIP > 10 * GEO.EPS_SMALL and ( nStep > 1 or Proc.Prc == 70) and bCanDouble and b3Raw:getDimY() > BD.DIM_TO_CENTER_STRIP - 0.1 then nDouble = 2 dDepth = min( ( b3Raw:getDimY() - dDimStrip) * 0.5, dMaxDepth) @@ -354,7 +357,7 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead) local dEndAddSpec = 0 if Proc.Grp ~= 0 then dEndAddSpec = CalcSpecialAdd( AuxId, false, dToolDiam) end -- se devo inserire il chamfer - if nChamfer > 0 and Proc.Grp ~= 0 and dOriDepth > dDepthCham then + if nChamfer > 0 and Proc.Grp ~= 0 and dOriDepth > dDepthCham and Proc.Prc ~= 70 then local bDoubleCham = false local dExtra = 2 -- eseguo @@ -567,9 +570,9 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead) -- assegno lato di lavoro if Proc.Grp == 0 then EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.CENTER) - elseif ( Proc.Grp == 3 and not bToolInv) or ( Proc.Grp == 4 and bToolInv) then + elseif ( Proc.Grp == 3 and not bToolInv) or ( Proc.Grp == 4 and bToolInv) or ( Proc.Grp == 1 and bToolInv) or ( Proc.Grp == 2 and bToolInv) then EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) - elseif ( Proc.Grp == 3 and bToolInv) or ( Proc.Grp == 4 and not bToolInv) then + elseif ( Proc.Grp == 3 and bToolInv) or ( Proc.Grp == 4 and not bToolInv) or ( Proc.Grp == 1 and not bToolInv) or ( Proc.Grp == 2 and not bToolInv) then EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) end -- posizione braccio porta testa @@ -779,6 +782,11 @@ end --------------------------------------------------------------------- -- Applicazione della lavorazione function ProcessFreeContour.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) + -- riassegno Q nel caso la funzione sia richiamata da un'altra make + if Proc.Prc == 70 then + Q_DEPTH_CHAMFER = 'Q01' + Q_DIM_STRIP = 'Q02' + end -- recupero la tipologia local bPocket = ( EgtGetInfo( Proc.Id, 'PCKT', 'i') == 1) -- se svuotatura diff --git a/LuaLibs/ProcessSimpleScarf.lua b/LuaLibs/ProcessSimpleScarf.lua index 78ab84e..462f3c0 100644 --- a/LuaLibs/ProcessSimpleScarf.lua +++ b/LuaLibs/ProcessSimpleScarf.lua @@ -2,6 +2,7 @@ -- Gestione calcolo giunto Gerber per Travi -- 2022/06/10 Aggiunto il parametro dOvmTail per gestire sovramateriali in coda diversi da OVM_MID (sezioni alte e larghe) -- 2022/08/09 Ora se la feature ha meno di due facce viene richiamata la normale Cut. +-- 2022/11/09 Aggiunta gestione parametro Q04 per forzare utilizzo fresa di lato e lavorare come FreeContour. -- Tabella per definizione modulo local ProcessSimpleScarf = {} @@ -12,6 +13,7 @@ local BL = require( 'BeamLib') local Fbs = require( 'FacesBySaw') local DC = require( 'DiceCut') local Cut = require( 'ProcessCut') +local FreeContour = require( 'ProcessFreeContour') EgtOutLog( ' ProcessSimpleScarf started', 1) @@ -28,11 +30,13 @@ end --------------------------------------------------------------------- -- Classificazione della feature function ProcessSimpleScarf.Classify( Proc) + -- se forzato utilizzo fresa non ruoto la trave + local bForceSideMill = EgtGetInfo( Proc.Id, 'Q04', 'd') > 0 -- verifico le normali delle facce local nFacetCnt = EgtSurfTmFacetCount( Proc.Id) for i = 1, nFacetCnt do local vtN = EgtSurfTmFacetNormVersor( Proc.Id, i-1, GDB_ID.ROOT) - if vtN:getZ() < - 0.5 and Proc.Box:getDimX() / abs( vtN:getZ()) > BD.MAX_DIM_DICE then + if vtN:getZ() < - 0.5 and Proc.Box:getDimX() / abs( vtN:getZ()) > BD.MAX_DIM_DICE and not bForceSideMill then return true, true end end @@ -188,6 +192,12 @@ function ProcessSimpleScarf.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmT -- inserimento smussi local bOkc, sErrC = MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead) if not bOkc then return bOkc, sErrC end + -- se forzato utilizzo fresa richiamo la freecontour + local bForceSideMill = EgtGetInfo( Proc.Id, 'Q04', 'd') == 1 or EgtGetInfo( Proc.Id, 'Q04', 'd') == 2 or ( EgtGetInfo( Proc.Id, 'Q04', 'd') == 3 and vtN[vFaceOrd[3]]:getZ() < 0.1) + if bForceSideMill then + bOk, sErr = FreeContour.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) + return bOk, sErr + end -- recupero la lavorazione local sCutting = ML.FindCutting( 'HeadSide') if not sCutting then