DataBeam :

- modifiche per gestione warnings per caduta pezzi
- modifiche per gestire ricalcolo per PF1250.
This commit is contained in:
Dario Sassi
2021-02-25 14:51:59 +00:00
parent c1032afc73
commit 26f428646a
3 changed files with 59 additions and 14 deletions
+23 -2
View File
@@ -1,4 +1,4 @@
-- BeamExec.lua by Egaltech s.r.l. 2021/01/21
-- BeamExec.lua by Egaltech s.r.l. 2021/02/25
-- Libreria esecuzione lavorazioni per Travi
-- 2019/07/11 Aggiunta gestione stato rotazione di feature per TS3.
-- 2019/09/04 Corretto controllo feature di testa e coda con sovramateriale di testa elevato.
@@ -20,6 +20,7 @@
-- 2020/10/15 Per foro sdoppiato ricalcolo anche flag Head oltre a Tail .
-- 2020/10/23 Corretto spostamento foro per tenone quando tenone nullo.
-- 2020/12/29 Aggiunta gestione fori in doppio.
-- 2021/02/25 Aggiunta gestione eventuale ricalcolo per macchine tipo PF.
-- Tabella per definizione modulo
local BeamExec = {}
@@ -1232,10 +1233,30 @@ function BeamExec.ProcessFeatures()
-- Aggiornamento finale di tutto
EgtSetCurrPhase( 1)
local bApplOk, sApplErrors = EgtApplyAllMachinings()
local bApplOk, sApplErrors, sApplWarns = EgtApplyAllMachinings()
-- eventuale ricalcolo per macchine tipo PF (ma tengo warning del primo calcolo)
if EgtExistsInfo( EgtGetCurrMachGroup(), 'RECALC') then
EgtOutLog( ' **** RECALC ****')
bApplOk, sApplErrors, _ = EgtApplyAllMachinings()
EgtRemoveInfo( EgtGetCurrMachGroup(), 'RECALC')
end
if not bApplOk then
nTotErr = nTotErr + 1
table.insert( Stats, {Err = 1, Msg=sApplErrors, Rot=0, CutId=0, TaskId=0})
elseif sApplWarns and #sApplWarns > 0 then
local vLine = EgtSplitString( sApplWarns, '\r\n')
for i = 1, #vLine do
local nPos = vLine[i]:find( '(WRN', 1, true)
if nPos then
local sData = vLine[i]:sub( nPos + 1, -2)
local vVal = EgtSplitString( sData, ',')
local nWarn = EgtGetVal( vVal[1] or '', 'WRN', 'i')
local nCutId = EgtGetVal( vVal[2] or '', 'CUTID', 'i')
if nWarn and nCutId then
table.insert( Stats, { Err=-nWarn, Msg=vLine[i], Rot=0, CutId=nCutId, TaskId=0})
end
end
end
end
return ( nTotErr == 0), Stats