From 5cd73a03a866ee91e9348e4cef577df27f73837f Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Fri, 12 Jun 2020 16:27:32 +0000 Subject: [PATCH] DataBeam : - aggiunto ricalcolo pezzi se cambiata configurazione macchina TS3 - nei tagli migliorato controllo direzione ingresso lama - nei tagli longitudinali singoli corretto controllo elevazione con massimo affondamento utensile. --- BatchProcess.lua | 14 +++++++++++--- LuaLibs/ProcessCut.lua | 6 +++--- LuaLibs/ProcessLongCut.lua | 8 ++++---- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/BatchProcess.lua b/BatchProcess.lua index 8963e43..4ccecba 100644 --- a/BatchProcess.lua +++ b/BatchProcess.lua @@ -135,9 +135,6 @@ if BEAM.FLAG > 10 then return end --- *** Segnalazione avvio *** -EgtOutLog( '*** Beam BatchProcess Start ***', 1) - -- Carico le librerie _G.package.loaded.BeamExec = nil local BE = require( 'BeamExec') @@ -164,6 +161,10 @@ if bBtl and string.find( sTitle, 'Bar_', 1, true) and EgtExistsFile( sNgeFile) t if nDiff == 0 then bToProcess = false end + -- se cambiata configurazione macchina da ultima elaborazione, devo riprocessare + if EgtCompareFilesLastWriteTime( sOriFile, sMachDir .. '\\Beam\\TS3Data.lua') == -1 then + bToProcess = true + end end -- Inizializzo contatori errori e avvisi @@ -172,6 +173,7 @@ local nWarnCnt = 0 -- Se da elaborare if bToProcess then + EgtOutLog( ' +++ Processing Parts >>>') -- Se Btl, lo importo if bBtl then -- cancello eventuale vecchio progetto omonimo @@ -383,6 +385,7 @@ if bToProcess then -- Altrimenti carico il progetto salvato e dichiaro nessun errore else + EgtOutLog( ' +++ Loading Project already processed >>>') -- Carico il progetto giĆ  fatto EgtOpenFile( sNgeFile) -- Dichiaro nessun errore @@ -417,6 +420,7 @@ end -- *** Eseguo simulazione in cieco *** if ( BEAM.FLAG == 3 or BEAM.FLAG == 4) then + EgtOutLog( ' +++ Simulating with collision check >>>') local bSimOk, nErr, sErr = EgtSimulate() if not bSimOk then if nErr == MCH_SHE.INIT then @@ -454,6 +458,7 @@ end -- *** Genero programma CN *** ( se richiesto) if BEAM.FLAG == 0 or BEAM.FLAG == 4 then + EgtOutLog( ' +++ Generating NC part program >>>') if not EgtGenerate( '', 'EgtCAM5 - ' .. sNgeFile) then BEAM.ERR = 20 local _, sName, _ = EgtSplitPath( BEAM.FILE) @@ -466,6 +471,7 @@ end -- *** Eseguo stima tempi *** if not EgtEstimate( '', 'EgtCAM5 - ' .. sNgeFile) then + EgtOutLog( ' +++ Estimating T&L >>>') BEAM.ERR = 21 local _, sName, _ = EgtSplitPath( BEAM.FILE) BEAM.MSG = 'Error estimating production time : ' .. sName @@ -491,3 +497,5 @@ end -- Scrittura tempo totale stimato di lavorazione WriteTimeToLogFile( Ttot) + +EgtOutLog( ' +++ BatchProcess completed') diff --git a/LuaLibs/ProcessCut.lua b/LuaLibs/ProcessCut.lua index f678fe4..89fa8fd 100644 --- a/LuaLibs/ProcessCut.lua +++ b/LuaLibs/ProcessCut.lua @@ -1,4 +1,4 @@ --- ProcessCut.lua by Egaltech s.r.l. 2020/06/02 +-- ProcessCut.lua by Egaltech s.r.l. 2020/06/11 -- Gestione calcolo singoli tagli di lama per Travi -- Tabella per definizione modulo @@ -282,9 +282,9 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom) vtOrthoO = -Z_AX() elseif bHorizCut then vtOrthoO = Z_AX() - elseif Proc.Head and abs( vtN:getY()) > 0.02 and vtN:getZ() > -0.174 and dCutH < dMaxDepth + 10 * GEO.EPS_SMALL then + elseif Proc.Head and abs( vtN:getY()) > 0.259 and vtN:getZ() > -0.174 and dCutH < dMaxDepth + 10 * GEO.EPS_SMALL then vtOrthoO = X_AX() - elseif Proc.Tail and abs( vtN:getY()) > 0.02 and vtN:getZ() > -0.174 and dCutH < dMaxDepth + 10 * GEO.EPS_SMALL then + elseif Proc.Tail and abs( vtN:getY()) > 0.259 and vtN:getZ() > -0.174 and dCutH < dMaxDepth + 10 * GEO.EPS_SMALL then vtOrthoO = -X_AX() elseif vtN:getY() > -0.02 then vtOrthoO = Y_AX() diff --git a/LuaLibs/ProcessLongCut.lua b/LuaLibs/ProcessLongCut.lua index 59e2d0f..53eff2c 100644 --- a/LuaLibs/ProcessLongCut.lua +++ b/LuaLibs/ProcessLongCut.lua @@ -1,4 +1,4 @@ --- ProcessLongCut.lua by Egaltech s.r.l. 2020/04/18 +-- ProcessLongCut.lua by Egaltech s.r.l. 2020/06/11 -- Gestione calcolo taglio longitudinale per Travi -- Tabella per definizione modulo @@ -391,10 +391,10 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId) -- imposto uso della faccia EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse) -- verifico massimo affondamento rispetto ad elevazione - if dElev > dMaxDepth - BD.COLL_SIC then - sWarn = 'Warning in LongCut : depth (' .. EgtNumToString( dElev, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth - BD.COLL_SIC, 1) .. ')' + if dElev > dMaxDepth + 10 * GEO.EPS_SMALL then + sWarn = 'Warning in LongCut : depth (' .. EgtNumToString( dElev, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth, 1) .. ')' end - local dDepth = min( 0, dMaxDepth - BD.COLL_SIC - dElev ) + local dDepth = min( 0, dMaxDepth - dElev ) EgtSetMachiningParam( MCH_MP.DEPTH, dDepth) -- eseguo if not EgtApplyMachining( true, false) then