diff --git a/BatchProcess.lua b/BatchProcess.lua index 0d2567c..6901abf 100644 --- a/BatchProcess.lua +++ b/BatchProcess.lua @@ -1,4 +1,4 @@ --- BatchProcess.lua by Egaltech s.r.l. 2019/10/04 +-- BatchProcess.lua by Egaltech s.r.l. 2019/10/07 -- Gestione calcolo batch disposizione e lavorazioni per Travi -- 2019/07/11 Aggiunta gestione stato rotazione di feature per TS3. -- 2019/07/16 Aggiunta gestione modalità oltre 10 per impostazione macchina e uscita. @@ -6,6 +6,7 @@ -- 2019/07/24 Aggiunta gestione extra-corse. -- 2019/08/29 Aggiunta possibilità di processare file NGE. -- 2019/10/04 Migliorato log dei parametri ricevuti. +-- 2019/10/07 Aggiunta gestione Flag 4 = Check+Generate. -- Intestazioni require( 'EgtBase') @@ -21,7 +22,7 @@ EgtEnableDebug( false) -- Flag abilitazione controllo collisione local bVerifyCollision = true --- Log dati di generazione +-- Log dati in input local sFlag = '' if BEAM.FLAG == 0 then sFlag = 'GENERATE' @@ -31,6 +32,12 @@ elseif BEAM.FLAG == 2 then sFlag = 'SIMULATE' elseif BEAM.FLAG == 3 then sFlag = 'CHECK' +elseif BEAM.FLAG == 4 then + sFlag = 'CHECK+GENERATE' +elseif BEAM.FLAG == 11 then + sFlag = 'TOOLS' +elseif BEAM.FLAG == 12 then + sFlag = 'JOBS' else sFlag = 'FLAG='..tostring( BEAM.FLAG) end @@ -328,31 +335,8 @@ elseif nWarnCnt > 0 then PostWarnView( 19, sOutput) end --- Genero programma CN, se richiesto -if BEAM.FLAG == 0 then - if not EgtGenerate( '', 'EgtCAM5 - ' .. sNgeFile) then - BEAM.ERR = 20 - BEAM.MSG = 'Error generating NC part program : ' .. sName - WriteErrToLogFile( BEAM.ERR, BEAM.MSG) - PostErrView( BEAM.ERR, BEAM.MSG) - return - end -end - --- Eseguo stima tempi -if not EgtEstimate( '', 'EgtCAM5 - ' .. sNgeFile) then - BEAM.ERR = 21 - BEAM.MSG = 'Error estimating production time : ' .. sName - WriteErrToLogFile( BEAM.ERR, BEAM.MSG) - PostErrView( BEAM.ERR, BEAM.MSG) - return -end -local Ttot = EgtGetInfo( EgtGetCurrMachGroup(), 'Ttot') -local sTime = 'Total Time = ' .. EgtNumToString( Ttot, 1) -EgtOutLog( sTime) - -- Se verifica, eseguo simulazione in cieco -if BEAM.FLAG == 3 and bVerifyCollision then +if ( BEAM.FLAG == 3 or BEAM.FLAG == 4) and bVerifyCollision then local bSimOk, nErr, sErr = EgtSimulate() if not bSimOk then if nErr == MCH_SHE.COLLISION then @@ -385,6 +369,29 @@ if BEAM.FLAG == 3 and bVerifyCollision then end end +-- Genero programma CN, se richiesto +if BEAM.FLAG == 0 or BEAM.FLAG == 4 then + if not EgtGenerate( '', 'EgtCAM5 - ' .. sNgeFile) then + BEAM.ERR = 20 + BEAM.MSG = 'Error generating NC part program : ' .. sName + WriteErrToLogFile( BEAM.ERR, BEAM.MSG) + PostErrView( BEAM.ERR, BEAM.MSG) + return + end +end + +-- Eseguo stima tempi +if not EgtEstimate( '', 'EgtCAM5 - ' .. sNgeFile) then + BEAM.ERR = 21 + BEAM.MSG = 'Error estimating production time : ' .. sName + WriteErrToLogFile( BEAM.ERR, BEAM.MSG) + PostErrView( BEAM.ERR, BEAM.MSG) + return +end +local Ttot = EgtGetInfo( EgtGetCurrMachGroup(), 'Ttot') +local sTime = 'Total Time = ' .. EgtNumToString( Ttot, 1) +EgtOutLog( sTime) + -- Imposto la vista ISO 3d, se richiesto if BEAM.FLAG == 1 or BEAM.FLAG == 2 then EgtSetView( SCE_VD.ISO_SW, false) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index cd619b9..5359107 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -27,6 +27,7 @@ function ProcessLapJoint.Identify( Proc) (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 20) 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 == 34) or ( Proc.Grp == 4 and Proc.Prc == 39)) end