DataBeam :

- in BatchProcess aggiunta gestione Flag 4 (Check+Generate).
This commit is contained in:
Dario Sassi
2019-10-08 06:53:12 +00:00
parent 2d77d67bc0
commit c2e4e8ba55
2 changed files with 34 additions and 26 deletions
+33 -26
View File
@@ -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)