From 82d9d4dfde6406405816bfd7cd36400fd98d879f Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Wed, 25 Oct 2023 16:55:10 +0200 Subject: [PATCH] Commenti e migliorie messaggi warning --- LuaLibs/ProcessLapJoint.lua | 13 +++++++------ LuaLibs/ProcessLongDoubleCut.lua | 22 +++++++++++++--------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index a47b5eb..f5c41ff 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -79,6 +79,7 @@ -- 2023/09/27 In MakeMoreFaces e Classify refactoring della gestione scanalatura chiusa. -- 2023/09/27 In MakeLongMoreFaces aggiunto Topology.Classify alla Proc creata. -- 2023/10/03 In MakePocket aggiunto messaggio in caso si rovini il pezzo successivo. +-- 2023/10/25 In LapJoint 2 facce longitudinali faccio di lama solo se taglio completamente. Altrimenti fresa. -- Tabella per definizione modulo local ProcessLapJoint = {} @@ -5743,13 +5744,13 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) -- leggo i parametri Q per utilizzare la fresa di fianco e/o lama local nUseSideTool = EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') or 0 local bUseBlade = EgtGetInfo( Proc.Id, Q_ANTISPLINT_TYPE, 'i') == 1 - local bOK, sMyWarn = Long2Cut.Make( Proc, nPhase, nRawId, nPartId, bUseBlade, nUseSideTool) + local bOk, sMyWarn = Long2Cut.Make( Proc, nPhase, nRawId, nPartId, bUseBlade, nUseSideTool) -- se non sono riuscito a farlo di lama, riprovo con la fresa - if not bOK and bUseBlade then + if not bOk and bUseBlade then bUseBlade = false return Long2Cut.Make( Proc, nPhase, nRawId, nPartId, bUseBlade, nUseSideTool) else - return bOK, sMyWarn + return bOk, sMyWarn end -- prima faccia terminale elseif b3Fac1:getDimX() < 1 and abs( vtN2:getX()) < GEO.EPS_SMALL then @@ -5834,13 +5835,13 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) if Proc.Box:getDimX() > 0.8 * b3Solid:getDimX() and abs( b3Fac1:getDimX() - b3Fac2:getDimX()) < 50 and abs( b3Fac1:getCenter():getX() - b3Fac2:getCenter():getX()) < 50 then local nUseSideTool = EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') or 0 - local bOK, sMyWarn = Long2Cut.Make( Proc, nPhase, nRawId, nPartId, bUseBlade, nUseSideTool) + local bOk, sMyWarn = Long2Cut.Make( Proc, nPhase, nRawId, nPartId, bUseBlade, nUseSideTool) -- se non sono riuscito a farlo di lama, riprovo con la fresa - if not bOK and bUseBlade then + if not bOk and bUseBlade then bUseBlade = false return Long2Cut.Make( Proc, nPhase, nRawId, nPartId, bUseBlade, nUseSideTool) else - return bOK, sMyWarn + return bOk, sMyWarn end -- altrimenti else diff --git a/LuaLibs/ProcessLongDoubleCut.lua b/LuaLibs/ProcessLongDoubleCut.lua index 4811607..a07c9cf 100644 --- a/LuaLibs/ProcessLongDoubleCut.lua +++ b/LuaLibs/ProcessLongDoubleCut.lua @@ -19,6 +19,7 @@ -- 2023/03/23 Correzione per caso con doppia lama da sotto. -- 2023/06/07 Sistemazione SCC per macchina TURN -- 2023/10/24 Migliorata spezzatura taglio passante con due spezzoni +-- 2023/10/25 Se effettivamente un taglio longitudinale e lama non taglia completamente, limito la lavorazione. Altrimenti esco. -- Tabella per definizione modulo local ProcessLong2Cut = {} @@ -817,6 +818,18 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster end -- altrimenti concavo else + -- se effettivamente un taglio longitudinale e lama non taglia completamente, limito la lavorazione. Altrimenti esco. + for k = 1, #vOrd do + if vWidth[vOrd[k]] + BD.CUT_SIC > dMaxDepth then + if not( ProcessLong2Cut.Identify( Proc)) then + return false + else + local sWarn2 = 'Warning in ' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. ' : elevation (' .. EgtNumToString( vWidth[vOrd[k]], 1) .. ') bigger than max saw depth (' .. EgtNumToString( dMaxDepth, 1) .. ')' + if not sWarn then sWarn = '' end + sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2) + end + end + end -- si percorrono i lati alto e basso della faccia for i = 1, nC do -- Posizione braccio portatesta @@ -859,15 +872,6 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster local dLioPerp if j == 1 then -- il primo taglio lo faccio completo se angolo interno maggiore di 90 - -- se devo limitare la lavorazione, verifico che sia effettivamente un taglio longitudinale, altrimenti ritorno errore - if not( ProcessLong2Cut.Identify( Proc)) then - for i = 1, #vOrd do - if vWidth[vOrd[i]] + BD.CUT_SIC > dMaxDepth then - return false - end - end - end - local dMinOffsBigFace = max( vWidth[vOrd[j]] - dMaxDepth, 0) -- se la faccia è più grande del massimo materiale lama, allora limito lavorazione if dMinOffsBigFace > 0 then