DataBeam :

- correzioni per tagli su pezzi grossi
- correzioni varie.
This commit is contained in:
Dario Sassi
2019-09-04 18:31:10 +00:00
parent fcdc31ae09
commit 4d26232057
9 changed files with 140 additions and 114 deletions
+32 -13
View File
@@ -1,9 +1,10 @@
-- BatchProcess.lua by Egaltech s.r.l. 2019/07/25
-- BatchProcess.lua by Egaltech s.r.l. 2019/08/29
-- 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.
-- 2019/07/19 Aggiunta gestione collisioni.
-- 2019/07/24 Aggiunta gestione extra-corse.
-- 2019/08/29 Aggiunta possibilità di processare file NGE.
-- Intestazioni
require( 'EgtBase')
@@ -12,7 +13,7 @@ EgtEnableDebug( false)
-- Per test
--BEAM = {}
--BEAM.FILE = 'c:\\EgtData\\Varie\\TestEssetreFast\\TestFabio\\Accettazione.btl'
--BEAM.FILE = 'c:\\EgtData\\Varie\\TestEssetreFast\\Xxx\\2-Banchina smussata.nge'
--BEAM.MACHINE = 'FAST'
--BEAM.FLAG = 3
@@ -57,7 +58,7 @@ local function PostWarnView( nWarn, sMsg)
if nWarn ~= 0 and ( BEAM.FLAG == 1 or BEAM.FLAG == 2) then
EgtSetView( SCE_VD.ISO_SW, false)
EgtZoom( SCE_ZM.ALL)
EgtOutBox( sMsg, 'BatchProcess (wrn=' .. tostring( nErr) .. ')', 'WARNINGS')
EgtOutBox( sMsg, 'BatchProcess (wrn=' .. tostring( nWarn) .. ')', 'WARNINGS')
end
end
@@ -107,14 +108,32 @@ local BL = require( 'BeamLib')
-- Carico i dati globali
local BD = require( 'BeamData')
-- Importo il file Btl
EgtNewFile()
if not EgtImportBtl( BEAM.FILE, EIB_FL.TS3_POS) then
BEAM.ERR = 13
BEAM.MSG = 'Error importing BTL file : ' .. BEAM.FILE
WriteErrToLogFile( BEAM.ERR, BEAM.MSG)
PostErrView( BEAM.ERR, BEAM.MSG)
return
-- Verifico il tipo di file
local _, _, sExt = EgtSplitPath( BEAM.FILE)
local bBtl = ( string.upper( sExt or '') ~= '.NGE')
-- Se Btl, lo importo
if bBtl then
EgtNewFile()
if not EgtImportBtl( BEAM.FILE, EIB_FL.TS3_POS) then
BEAM.ERR = 13
BEAM.MSG = 'Error importing BTL file : ' .. BEAM.FILE
WriteErrToLogFile( BEAM.ERR, BEAM.MSG)
PostErrView( BEAM.ERR, BEAM.MSG)
return
end
-- altrimenti apro Nge
else
if not EgtOpenFile( BEAM.FILE) then
BEAM.ERR = 13
BEAM.MSG = 'Error opening NGE file : ' .. BEAM.FILE
WriteErrToLogFile( BEAM.ERR, BEAM.MSG)
PostErrView( BEAM.ERR, BEAM.MSG)
return
end
-- faccio copia del file originale
local sDir, sTitle, sExt = EgtSplitPath( BEAM.FILE)
EgtCopyFile( BEAM.FILE, sDir..sTitle..'.ori'..sExt)
end
-- Recupero l'elenco ordinato delle travi
@@ -215,9 +234,9 @@ if dRawW > BD.MAX_WIDTH + 10 * GEO.EPS_SMALL or dRawH > BD.MAX_HEIGHT + 10 * GEO
end
-- Lunghezza della barra
local dRawL = EgtGetInfo( EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo'), 'BARLEN', 'd') or 12000
local dRawL = EgtGetInfo( EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or GDB_ID.NULL, 'BARLEN', 'd') or 12000
-- Sovramateriale di testa
local dOvmHead = EgtGetInfo( EgtGetFirstPart(), 'POSX', 'd') or 10
local dOvmHead = vBeam[1].PosX or 10
-- Sistemo le travi nel grezzo
local bPbOk, sPbErr = BE.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, vBeam)