From 9350e2b5f479c161d12d945acad797f8c1e50ff2 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Fri, 15 Jan 2021 22:49:53 +0000 Subject: [PATCH] DataBeam : - modifiche per nuova interfaccia. --- BatchProcessNew.lua | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/BatchProcessNew.lua b/BatchProcessNew.lua index 6462258..71ce874 100644 --- a/BatchProcessNew.lua +++ b/BatchProcessNew.lua @@ -1,6 +1,7 @@ --- BatchProcess.lua by Egaltech s.r.l. 2021/01/07 +-- BatchProcess.lua by Egaltech s.r.l. 2021/01/15 -- Gestione calcolo batch disposizione e lavorazioni per Travi -- 2021/01/07 Per nuova interfaccia Egt. +-- 2021/01/15 CREATE_BAR ora FLAG = 6 (prima 5). -- Intestazioni require( 'EgtBase') @@ -25,7 +26,7 @@ elseif BEAM.FLAG == 3 then sFlag = 'CHECK' elseif BEAM.FLAG == 4 then sFlag = 'CHECK+GENERATE' -elseif BEAM.FLAG == 5 then +elseif BEAM.FLAG == 6 then sFlag = 'CREATE_BAR' else sFlag = 'FLAG='..tostring( BEAM.FLAG) @@ -90,7 +91,7 @@ local sBaseDir = EgtGetSourceDir() EgtAddToPackagePath( sBaseDir .. 'LuaLibs\\?.lua') -- Se necessario, impostazione della macchina corrente -if BEAM.FLAG ~= 5 then +if BEAM.FLAG ~= 6 then EgtResetCurrMachGroup() local sMachine = BEAM.MACHINE if not EgtSetCurrMachine( sMachine) then @@ -165,7 +166,7 @@ if bToProcess then local vBeam = {} -- Se necessario, apro il file Bwe - if BEAM.FLAG ~= 5 then + if BEAM.FLAG ~= 6 then if not EgtOpenFile( BEAM.FILE) then BEAM.ERR = 13 BEAM.MSG = 'Error opening BWE file : ' .. BEAM.FILE @@ -254,7 +255,7 @@ if bToProcess then -- Barra da creare bCreateBar = true -- Lunghezza della barra - dBarLen = EgtGetInfo( nMGrpId, 'BARLEN') + dBarLen = EgtGetInfo( nMGrpId, 'BARLEN', 'd') -- Recupero l'elenco ordinato delle travi da inserire nella barra for i = 1, 100 do local sKey = 'PART'..tostring( i) @@ -350,18 +351,23 @@ if bToProcess then local dOvmHead = vBeam[1].PosX or 0 -- Sistemo le travi nel grezzo - local bPbOk, sPbErr = BE.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, vBeam, BEAM.FLAG == 5) + local bPbOk, sPbErr = BE.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, vBeam, BEAM.FLAG == 6) if not bPbOk then BEAM.ERR = 18 BEAM.MSG = sPbErr WriteErrToLogFile( BEAM.ERR, BEAM.MSG) PostErrView( BEAM.ERR, BEAM.MSG) return + else + -- Scrivo altezza e larghezza barra nel gruppo di lavoro corrente + local nMGrpId = EgtGetCurrMachGroup() + EgtSetInfo(nMGrpId, 'BARHEIGHT', dRawW) + EgtSetInfo(nMGrpId, 'BARWIDTH', dRawH) end end -- Se richiesta solo barra, esco - if BEAM.FLAG == 5 then + if BEAM.FLAG == 6 then -- Completamento senza errori e avvisi if nWarnCnt == 0 then BEAM.ERR = 0 @@ -433,12 +439,12 @@ else -- Dichiaro nessun errore local nPartId = EgtGetFirstPart() while nPartId do - local nCutId = EgtGetInfo( nPartId, 'CUTID') + local nCutId = EgtGetInfo( nPartId, 'CUTID', 'i') if nCutId then local nProcId = EgtGetFirstInGroup( EgtGetFirstNameInGroup( nPartId, 'Processings') or GDB_ID.NULL) while nProcId do local bIsFea = EgtExistsInfo( nProcId, 'GRP') and EgtExistsInfo( nProcId, 'PRC') - local nTaskId = EgtGetInfo( nProcId, 'TASKID') + local nTaskId = EgtGetInfo( nProcId, 'TASKID', 'i') if bIsFea and nTaskId then BEAM.ERR = 0 BEAM.MSG = '---' @@ -529,7 +535,7 @@ if not EgtEstimate( '', 'EgtCAM5 - ' .. sNgeFile) then PostErrView( BEAM.ERR, BEAM.MSG) return end -local Ttot = EgtGetInfo( EgtGetCurrMachGroup(), 'Ttot') +local Ttot = EgtGetInfo( EgtGetCurrMachGroup(), 'Ttot', 'd') local sTime = 'Total Time = ' .. EgtNumToString( Ttot, 1) EgtOutLog( sTime)