DataBeam :

- modifiche per gestire macchine con carico da destra (flag BD.RIGHT_LOAD)
- modifiche per favorire, se presente, lama di testa da sotto su pezzi corti.
This commit is contained in:
DarioS
2021-07-14 15:44:46 +02:00
parent 10056ea266
commit 6c95b78e80
5 changed files with 30 additions and 25 deletions
+18 -16
View File
@@ -1,4 +1,4 @@
-- BeamExec.lua by Egaltech s.r.l. 2021/03/25
-- BeamExec.lua by Egaltech s.r.l. 2021/07/13
-- 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.
@@ -21,6 +21,7 @@
-- 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.
-- 2021/07/13 Aggiunta gestione posizionamento pezzo TR/BR per macchine con carico a destra e scarico a sinistra.
-- Tabella per definizione modulo
local BeamExec = {}
@@ -140,9 +141,10 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, vBeam, bMachGroup
-- Area tavola
local b3Tab = EgtGetTableArea()
-- Calcolo posizione estremo TR della tavola rispetto a sua origine in BL
BD.OriTR = Point3d( b3Tab:getDimX(), b3Tab:getDimY(), 0)
-- Calcolo posizione estremo TR/BR della tavola rispetto a sua origine in BL
BD.OriXR = Point3d( b3Tab:getDimX(), EgtIf( BD.RIGHT_LOAD, 0, b3Tab:getDimY()), 0)
BD.PosXR = EgtIf( BD.RIGHT_LOAD, MCH_CR.BR, MCH_CR.TR)
-- Impostazione dell'attrezzaggio di default
EgtImportSetup()
@@ -177,7 +179,7 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, vBeam, bMachGroup
local Delta = CrawLen - PartLen - DeltaS
-- creo e posiziono il grezzo
local nRaw = EgtAddRawPart( Point3d(0,0,0), CrawLen, dRawW, dRawH, BD.RAWCOL)
EgtMoveToCornerRawPart( nRaw, BD.OriTR, MCH_CR.TR)
EgtMoveToCornerRawPart( nRaw, BD.OriXR, BD.PosXR)
EgtMoveRawPart( nRaw, Vector3d( Len - dRawL, 0, 0))
-- assegno ordine in lavorazione
Cnt = Cnt + 1
@@ -228,7 +230,7 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, vBeam, bMachGroup
-- Se rimasto materiale aggiungo grezzo dell'avanzo
if Len > 10 then
local nRaw = EgtAddRawPart( Point3d(0,0,0), Len, dRawW, dRawH, BD.RAWCOL)
EgtMoveToCornerRawPart( nRaw, BD.OriTR, MCH_CR.TR)
EgtMoveToCornerRawPart( nRaw, BD.OriXR, BD.PosXR)
EgtMoveRawPart( nRaw, Vector3d( Len - dRawL, 0, 0))
-- assegno ordine in lavorazione
Cnt = Cnt + 1
@@ -1086,7 +1088,7 @@ function BeamExec.ProcessFeatures()
if nOrd == 1 then
EgtSetCurrPhase( 1)
else
BL.AddPhaseWithRawParts( nRawId, BD.OriTR, 0)
BL.AddPhaseWithRawParts( nRawId, BD.OriXR, BD.PosXR, 0)
end
local nPhase = EgtGetCurrPhase()
local nDispId = EgtGetPhaseDisposition( nPhase)
@@ -1141,7 +1143,7 @@ function BeamExec.ProcessFeatures()
end
-- se era taglio di separazione, aggiungo nuova fase
if bNewPhase then
BL.AddPhaseWithRawParts( nRawId, BD.OriTR, BD.RAW_OFFSET)
BL.AddPhaseWithRawParts( nRawId, BD.OriXR, BD.PosXR, BD.RAW_OFFSET)
EgtRotateRawPart( nRawId, X_AX(), 180)
-- se grezzo successivo senza pezzi e finale, va tolto
local nNextRawId = EgtGetNextRawPart( nRawId)
@@ -1158,11 +1160,11 @@ function BeamExec.ProcessFeatures()
end
-- se separazione non ancora effettuata, aggiungo nuova fase con le travi in posizione standard
if not bSplitRot then
BL.AddPhaseWithRawParts( nRawId, BD.OriTR, 0)
BL.AddPhaseWithRawParts( nRawId, BD.OriXR, BD.PosXR, 0)
-- altrimenti
else
-- aggiungo nuova fase con le travi in posizione standard
BL.AddPhaseWithRawParts( nRawId, BD.OriTR, BD.RAW_OFFSET)
BL.AddPhaseWithRawParts( nRawId, BD.OriXR, BD.PosXR, BD.RAW_OFFSET)
-- se grezzo successivo senza pezzi e finale, va tolto
local nNextRawId = EgtGetNextRawPart( nRawId)
if nNextRawId and EgtGetPartInRawPartCount( nNextRawId) == 0 and EgtGetRawPartBBox( nNextRawId):getDimX() < BD.MinRaw then
@@ -1186,7 +1188,7 @@ function BeamExec.ProcessFeatures()
local nRId = nRawId
while nRId do
if bPreMove then EgtMoveRawPart( nRId, vtMove) end
EgtRotateRawPart( nRId, X_AX(), 90)
EgtRotateRawPart( nRId, X_AX(), EgtIf( BD.RIGHT_LOAD, -90, 90))
if not bPreMove then EgtMoveRawPart( nRId, vtMove) end
nRId = EgtGetNextRawPart( nRId)
end
@@ -1209,9 +1211,9 @@ function BeamExec.ProcessFeatures()
if bOk then nSideMchOk = nSideMchOk + 1 end
-- se era taglio di separazione, aggiungo nuova fase
if bNewPhase then
BL.AddPhaseWithRawParts( nRawId, BD.OriTR, BD.RAW_OFFSET)
BL.AddPhaseWithRawParts( nRawId, BD.OriXR, BD.PosXR, BD.RAW_OFFSET)
if bPreMove then EgtMoveRawPart( nRawId, vtMove) end
EgtRotateRawPart( nRawId, X_AX(), 90)
EgtRotateRawPart( nRawId, X_AX(), EgtIf( BD.RIGHT_LOAD, -90, 90))
if not bPreMove then EgtMoveRawPart( nRawId, vtMove) end
-- se grezzo successivo senza pezzi e finale, va tolto
local nNextRawId = EgtGetNextRawPart( nRawId)
@@ -1232,10 +1234,10 @@ function BeamExec.ProcessFeatures()
end
-- se separazione non ancora effettuata, aggiungo nuova fase con le travi in posizione standard
if not bSplitRot then
BL.AddPhaseWithRawParts( nRawId, BD.OriTR, 0)
BL.AddPhaseWithRawParts( nRawId, BD.OriXR, BD.PosXR, 0)
-- altrimenti
else
BL.AddPhaseWithRawParts( nRawId, BD.OriTR, BD.RAW_OFFSET)
BL.AddPhaseWithRawParts( nRawId, BD.OriXR, BD.PosXR, BD.RAW_OFFSET)
-- se grezzo successivo senza pezzi e finale, va tolto
local nNextRawId = EgtGetNextRawPart( nRawId)
if nNextRawId and EgtGetPartInRawPartCount( nNextRawId) == 0 and EgtGetRawPartBBox( nNextRawId):getDimX() < BD.MinRaw then
@@ -1263,7 +1265,7 @@ function BeamExec.ProcessFeatures()
end
-- se era taglio di separazione, aggiungo nuova fase
if bNewPhase then
BL.AddPhaseWithRawParts( nRawId, BD.OriTR, BD.RAW_OFFSET)
BL.AddPhaseWithRawParts( nRawId, BD.OriXR, BD.PosXR, BD.RAW_OFFSET)
-- se grezzo successivo senza pezzi e finale, va tolto
local nNextRawId = EgtGetNextRawPart( nRawId)
if nNextRawId and EgtGetPartInRawPartCount( nNextRawId) == 0 and EgtGetRawPartBBox( nNextRawId):getDimX() < BD.MinRaw then