DataBeam :
- se modificati parametri macchina o utensili si forza ricalcolo disposizioni e lavorazioni.
This commit is contained in:
+20
-10
@@ -152,6 +152,7 @@ local sBtmFile = sDir..sTitle..'.btm'
|
||||
|
||||
-- In generale va completamente riprocessato
|
||||
local bToProcess = true
|
||||
local bToRecalc = false
|
||||
-- se BTL, barra ed esiste già il corrispondente progetto Nge
|
||||
if bBtl and string.find( sTitle, 'Bar_', 1, true) and EgtExistsFile( sNgeFile) then
|
||||
local sOriFile = sDir..sTitle..'.ori'..sExt
|
||||
@@ -161,10 +162,11 @@ if bBtl and string.find( sTitle, 'Bar_', 1, true) and EgtExistsFile( sNgeFile) t
|
||||
-- se BTL corrente coincide con originale, salto il riprocessamento
|
||||
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
|
||||
-- se cambiata configurazione macchina da ultima elaborazione, devo riprocessare
|
||||
if EgtCompareFilesLastWriteTime( sOriFile, sMachDir .. '\\Beam\\TS3Data.lua') == -1 or
|
||||
EgtCompareFilesLastWriteTime( sOriFile, sMachDir .. '\\Tools\\Tools.data') == -1 then
|
||||
bToRecalc = true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -412,15 +414,22 @@ else
|
||||
nPartId = EgtGetNextPart( nPartId)
|
||||
end
|
||||
-- Aggiorno eventuali dati ausiliari
|
||||
if UpdateAuxData( sBtmFile) then
|
||||
EgtSaveFile( sNgeFile)
|
||||
end
|
||||
UpdateAuxData( sBtmFile)
|
||||
-- Passo in modalità lavora
|
||||
EgtSetCurrMachGroup( EgtGetLastMachGroup())
|
||||
-- Se necessario eseguo aggiornamento con ricalcolo delle lavorazioni
|
||||
if bToRecalc then
|
||||
EgtOutLog( ' +++ Recalculating all dispositions and machinings >>>')
|
||||
EgtApplyAllMachinings()
|
||||
-- copia del file btl originale (per dichiarare progetto ricalcolato)
|
||||
EgtCopyFile( BEAM.FILE, sDir..sTitle..'.ori'..sExt)
|
||||
end
|
||||
-- Salvo il progetto
|
||||
EgtSaveFile( sNgeFile)
|
||||
end
|
||||
|
||||
-- *** Eseguo simulazione in cieco ***
|
||||
if ( BEAM.FLAG == 3 or BEAM.FLAG == 4) then
|
||||
-- *** Eseguo simulazione con verifica collisione in cieco ***
|
||||
if ( BEAM.FLAG == 0 and ( bToProcess or bToRecalc)) or BEAM.FLAG == 3 or BEAM.FLAG == 4 then
|
||||
EgtOutLog( ' +++ Simulating with collision check >>>')
|
||||
local bSimOk, nErr, sErr = EgtSimulate()
|
||||
if not bSimOk then
|
||||
@@ -471,8 +480,9 @@ if BEAM.FLAG == 0 or BEAM.FLAG == 4 then
|
||||
end
|
||||
|
||||
-- *** Eseguo stima tempi ***
|
||||
EgtOutLog( ' +++ Estimating T&L >>>')
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user