DataBeam :
- corretta assegnazione fori cieca a fase ribaltata e non ruotata - corretta gestione ruotato insieme con ribaltato senza lavorazioni subito dopo carico della barra.
This commit is contained in:
+35
-8
@@ -1,4 +1,4 @@
|
||||
-- BeamExec.lua by Egaltech s.r.l. 2020/05/21
|
||||
-- BeamExec.lua by Egaltech s.r.l. 2020/05/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.
|
||||
@@ -12,6 +12,7 @@
|
||||
-- 2020/05/16 Migliorie ordinamento fori.
|
||||
-- 2020/05/16 Gestione rotazione di 90deg.
|
||||
-- 2020/05/21 Correzione rotazione di 90deg (caso DY > DZ).
|
||||
-- 2020/05/25 Correzione rotazione di 90deg dopo scarico su carico.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local BeamExec = {}
|
||||
@@ -175,9 +176,10 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, vBeam)
|
||||
local sOut = 'Error creating Additional Group in Part ' .. tostring( Pz)
|
||||
return false, sOut
|
||||
end
|
||||
-- se sovramateriale di testa, aggiungo faccia per taglio iniziale al pezzo
|
||||
-- aggiungo faccia per taglio iniziale al pezzo
|
||||
BL.AddPartStartFace( Pz, b3Solid)
|
||||
-- se sovramateriale di testa, lo notifico
|
||||
if DeltaS > 0.09 then
|
||||
BL.AddPartStartFace( Pz, b3Solid)
|
||||
EgtSetInfo( nRaw, 'HOVM', DeltaS)
|
||||
end
|
||||
-- aggiungo faccia per taglio finale al pezzo
|
||||
@@ -686,14 +688,14 @@ local function PrintFeatures( vProc, b3Raw)
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, b3Raw)
|
||||
local function AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bNeedHCut, b3Raw)
|
||||
local bOk = true
|
||||
local sErr = ''
|
||||
local bNewPhase = false
|
||||
-- se intestatura ( 1-340-X )
|
||||
if Hcut.Identify( Proc) then
|
||||
-- esecuzione taglio di testa
|
||||
bOk, sErr = Hcut.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
bOk, sErr = Hcut.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bNeedHCut)
|
||||
-- se separazione ( 2-350-X )
|
||||
elseif Split.Identify( Proc) then
|
||||
-- esecuzione separazione o eliminazione grezzo residuo
|
||||
@@ -843,6 +845,29 @@ local function AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, b3
|
||||
return bOk, sErr, bNewPhase
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function VerifyNeedForHeadCut( vProc, bSomeDown, bSomeSide)
|
||||
-- verifico se necessaria la rotazione di 90 gradi
|
||||
if not bSomeSide then
|
||||
return false
|
||||
end
|
||||
-- verifico se viene dopo un pezzo diviso quando ruotato (quindi con rimanenza scaricata sul carico)
|
||||
local nPrevPhase = EgtGetCurrPhase() - 1
|
||||
local nPrevDispId = EgtGetPhaseDisposition( nPrevPhase) or GDB_ID.NULL
|
||||
local nPrevType = EgtGetInfo( nPrevDispId, 'TYPE')
|
||||
if nPrevType ~= 'MID2' and nPrevType ~= 'END2' then
|
||||
return false
|
||||
end
|
||||
-- verifico se c'è una sola lavorazione ribaltata (quindi è il taglio di testa)
|
||||
local nDownCnt = 0
|
||||
for i = 1, #vProc do
|
||||
if vProc[i].Down then
|
||||
nDownCnt = nDownCnt + 1
|
||||
end
|
||||
end
|
||||
return ( nDownCnt == 1)
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function MoveDrillsOnTenon( vProc)
|
||||
-- se non richiesto spostamento fori su tenone, esco
|
||||
@@ -918,6 +943,8 @@ function BeamExec.ProcessFeatures()
|
||||
if EgtGetDebugLevel() >= 1 then
|
||||
PrintFeatures( vProc, b3Raw)
|
||||
end
|
||||
-- verifico se comunque necessario taglio di testa
|
||||
local bNeedHCut = VerifyNeedForHeadCut( vProc, bSomeDown, bSomeSide)
|
||||
-- eventuale spostamento fori sui tenoni
|
||||
MoveDrillsOnTenon( vProc)
|
||||
-- se richiesto ribaltamento (oppure rotazione)
|
||||
@@ -934,7 +961,7 @@ function BeamExec.ProcessFeatures()
|
||||
-- creo la lavorazione
|
||||
local Proc = vProc[i]
|
||||
if Proc.Flg ~= 0 and Proc.Down then
|
||||
local bOk, sMsg, bNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, b3Raw)
|
||||
local bOk, sMsg, bNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bNeedHCut, b3Raw)
|
||||
if not bOk then
|
||||
nTotErr = nTotErr + 1
|
||||
table.insert( Stats, {Err=1, Msg=sMsg, Rot=-2, CutId=Proc.CutId, TaskId=Proc.TaskId})
|
||||
@@ -1001,7 +1028,7 @@ function BeamExec.ProcessFeatures()
|
||||
-- creo la lavorazione
|
||||
local Proc = vProc[i]
|
||||
if Proc.Flg ~= 0 and Proc.Side then
|
||||
local bOk, sMsg, bNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, b3Raw)
|
||||
local bOk, sMsg, bNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, false, b3Raw)
|
||||
if not bOk then
|
||||
nTotErr = nTotErr + 1
|
||||
table.insert( Stats, {Err=1, Msg=sMsg, Rot=-2, CutId=Proc.CutId, TaskId=Proc.TaskId})
|
||||
@@ -1056,7 +1083,7 @@ function BeamExec.ProcessFeatures()
|
||||
-- creo la lavorazione
|
||||
local Proc = vProc[i]
|
||||
if Proc.Flg ~= 0 and not ( Proc.Down or Proc.Side) then
|
||||
local bOk, sMsg, bNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, b3Raw)
|
||||
local bOk, sMsg, bNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, false, b3Raw)
|
||||
if not bOk then
|
||||
nTotErr = nTotErr + 1
|
||||
table.insert( Stats, {Err=1, Msg=sMsg, Rot=0, CutId=Proc.CutId, TaskId=Proc.TaskId})
|
||||
|
||||
Reference in New Issue
Block a user