Completata gestione scrittura dati nelle info del DISP
This commit is contained in:
+28
-24
@@ -487,6 +487,7 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, PARTS, b
|
||||
PARTS[i].nIndexInParts = i
|
||||
PARTS[i].CombinationList = BeamExec.GetAvailableCombinations( PARTS[i])
|
||||
PARTS[i].SplittingPoints = BeamLib.GetPartSplittingPoints( PARTS[i])
|
||||
PARTS[i].NotClampableLength = { STD = { dHead = 0, dTail = 0}, SIDE = { dHead = 0, dTail = 0}, DOWN = { dHead = 0, dTail = 0}}
|
||||
else
|
||||
local sOut = 'Error: part L(' .. EgtNumToString( dPartLen, 1) .. ') too big for raw part L(' .. EgtNumToString( dLen - 0.1, 1) .. ')'
|
||||
return false, sOut
|
||||
@@ -630,12 +631,12 @@ local function CollectFeatures( Part)
|
||||
Proc.idTask = EgtGetInfo( ProcId, 'TASKID', 'i') or 0
|
||||
Proc.b3Box = EgtGetBBoxGlob( ProcId, GDB_BB.STANDARD)
|
||||
EgtOutLog( '------Feature ' .. Proc.idFeature .. '------')
|
||||
Proc.Topology = {}
|
||||
-- se esiste la geometria
|
||||
if Proc.b3Box and not Proc.b3Box:isEmpty() then
|
||||
-- informazioni facce e topologia
|
||||
Proc.AffectedFaces = BeamLib.GetAffectedFaces( Proc, Part)
|
||||
-- calcolo topologia solo se necessario, altrimenti si sfruttano le informazioni della feature BTL
|
||||
Proc.Topology = {}
|
||||
local bIsFeatureReadyForProcessing = false
|
||||
if FeatureLib.NeedTopologyFeature( Proc) then
|
||||
Proc.AdjacencyMatrix = FaceData.GetAdjacencyMatrix( Proc)
|
||||
@@ -1148,7 +1149,7 @@ local function CalculateMachinings( vProc, Part, nInitialRotation)
|
||||
-- se non esiste una strategia scelta (non dovrebbe mai succedere) cancello da lista generale
|
||||
PROCESSINGS[Proc.nIndexPartInParts].Rotation[Proc.nIndexRotation][Proc.nIndexInVProc].ChosenStrategy = nil
|
||||
|
||||
-- TODO dare messaggio che la feature non 0è stata eseguita nonostante la presenza di strategie disponibili
|
||||
-- TODO dare messaggio che la feature non è stata eseguita nonostante la presenza di strategie disponibili
|
||||
|
||||
end
|
||||
end
|
||||
@@ -1458,6 +1459,7 @@ local function GetBestResultFromCombinationsMatrix( ProcessingsOnPart, PartInfo)
|
||||
end
|
||||
BestCombination = GetBestCombination( CombinationsList)
|
||||
|
||||
PartInfo.ChosenCombination = BestCombination.sBitIndexCombination
|
||||
-- scrittura nel log delle combinazioni possibili
|
||||
if EgtGetDebugLevel() >= 3 then
|
||||
Logs.WriteCombinationLog( CombinationsList, BestCombination)
|
||||
@@ -1506,7 +1508,7 @@ function BeamExec.ProcessMachinings( PARTS)
|
||||
if nOrd == 1 then
|
||||
EgtSetCurrPhase( 1)
|
||||
else
|
||||
BeamLib.AddPhaseWithRawParts( PARTS[nPart].idRaw, BeamData.ptOriXR, BeamData.dPosXR, 0)
|
||||
BeamLib.AddPhaseWithRawParts( PARTS[nPart], BeamData.ptOriXR, BeamData.dPosXR, 0)
|
||||
end
|
||||
-- si sposta il pezzo nella posizione originale, di quando è stata fatta la collect. In questo modo tutti i dati calcolati nella collect restano validi.
|
||||
-- Altrimenti bisognava ricalcolare tutto, aumentando tempo di calcolo.
|
||||
@@ -1642,12 +1644,13 @@ function BeamExec.ProcessMachinings( PARTS)
|
||||
local bSplitAlreadyExecuted = false
|
||||
local bSplitExecutedOnRot = false
|
||||
local nPhase = EgtGetCurrPhase()
|
||||
local nDispId = EgtGetPhaseDisposition( nPhase)
|
||||
EgtSetInfo( nDispId, 'TYPE', 'START')
|
||||
EgtSetInfo( nDispId, 'ORD', nOrd)
|
||||
local idDisp = EgtGetPhaseDisposition( nPhase)
|
||||
EgtSetInfo( idDisp, 'TYPE', 'START')
|
||||
EgtSetInfo( idDisp, 'ORD', nOrd)
|
||||
EgtOutLog( ' *** Phase=' .. tostring( nPhase) .. ' Raw=' .. tostring( PARTS[nPart].idRaw) .. ' Part=' .. tostring( PARTS[nPart].id) .. ' ***', 1)
|
||||
|
||||
-- creazione effettiva delle lavorazioni
|
||||
MACHININGS.Info = {}
|
||||
local nCurrPosition = 1
|
||||
local nInitialPosition = MatrixResult.nInitialPosition
|
||||
-- se c'è almeno una lavorazione in posizionamento con trave ribaltata
|
||||
@@ -1655,7 +1658,7 @@ function BeamExec.ProcessMachinings( PARTS)
|
||||
local nRotation = EgtIf( nInitialPosition + 2 > 4, nInitialPosition + 2 - 4, nInitialPosition + 2)
|
||||
BeamLib.RotateRawPart( PARTS[nPart], nRotation - nCurrPosition)
|
||||
nCurrPosition = nRotation
|
||||
EgtSetInfo( nDispId, 'ROT', -2)
|
||||
EgtSetInfo( idDisp, 'ROT', -2)
|
||||
bAreAllMachiningApplyOk, sErr, bSplitExecutedOnRot = MachiningLib.AddOperations( MACHININGS, PARTS[nPart], 'DOWN')
|
||||
bSplitAlreadyExecuted = bSplitAlreadyExecuted or bSplitExecutedOnRot
|
||||
end
|
||||
@@ -1664,36 +1667,37 @@ function BeamExec.ProcessMachinings( PARTS)
|
||||
if MatrixResult.bSomeFeatureSide then
|
||||
-- se ci sono state lavorazioni in rotazione precedente devo creare altra fase. Altrimenti già creata da prima
|
||||
if MatrixResult.bSomeFeatureDown then
|
||||
BeamLib.AddPhaseWithRawParts( PARTS[nPart].idRaw, BeamData.ptOriXR, BeamData.dPosXR, EgtIf( bSplitAlreadyExecuted, BeamData.RAW_OFFSET, 0))
|
||||
BeamLib.AddPhaseWithRawParts( PARTS[nPart], BeamData.ptOriXR, BeamData.dPosXR, EgtIf( bSplitAlreadyExecuted, BeamData.RAW_OFFSET, 0))
|
||||
nPhase = EgtGetCurrPhase()
|
||||
nDispId = EgtGetPhaseDisposition( nPhase)
|
||||
EgtSetInfo( nDispId, 'ORD', nOrd)
|
||||
-- se c'è già stata seoparazione
|
||||
idDisp = EgtGetPhaseDisposition( nPhase)
|
||||
EgtSetInfo( idDisp, 'ORD', nOrd)
|
||||
-- se c'è già stata separazione
|
||||
if bSplitAlreadyExecuted then
|
||||
EgtSetInfo( nDispId, 'TYPE', 'MID2')
|
||||
EgtSetInfo( idDisp, 'TYPE', 'MID2')
|
||||
else
|
||||
EgtSetInfo( nDispId, 'TYPE', 'MID')
|
||||
EgtSetInfo( idDisp, 'TYPE', 'MID')
|
||||
end
|
||||
end
|
||||
local nRotation = EgtIf( nInitialPosition + 1 > 4, nInitialPosition + 1 - 4, nInitialPosition + 1)
|
||||
BeamLib.RotateRawPart( PARTS[nPart], nRotation - nCurrPosition)
|
||||
nCurrPosition = nRotation
|
||||
EgtSetInfo( nDispId, 'ROT', -1)
|
||||
EgtSetInfo( idDisp, 'ROT', -1)
|
||||
bAreAllMachiningApplyOk, sErr, bSplitExecutedOnRot = MachiningLib.AddOperations( MACHININGS, PARTS[nPart], 'SIDE')
|
||||
bSplitAlreadyExecuted = bSplitAlreadyExecuted or bSplitExecutedOnRot
|
||||
end
|
||||
|
||||
-- se ci sono state lavorazioni in rotazione precedente devo creare altra fase. Altrimenti già creata da prima
|
||||
if MatrixResult.bSomeFeatureDown or MatrixResult.bSomeFeatureSide then
|
||||
BeamLib.AddPhaseWithRawParts( PARTS[nPart].idRaw, BeamData.ptOriXR, BeamData.dPosXR, EgtIf( bSplitAlreadyExecuted, BeamData.RAW_OFFSET, 0))
|
||||
local sPrevRotation = EgtIf( MatrixResult.bSomeFeatureSide, 'SIDE', 'DOWN')
|
||||
BeamLib.AddPhaseWithRawParts( PARTS[nPart], BeamData.ptOriXR, BeamData.dPosXR, EgtIf( bSplitAlreadyExecuted, BeamData.RAW_OFFSET, 0))
|
||||
nPhase = EgtGetCurrPhase()
|
||||
nDispId = EgtGetPhaseDisposition( nPhase)
|
||||
EgtSetInfo( nDispId, 'ORD', nOrd)
|
||||
-- se c'è già stata seoparazione
|
||||
idDisp = EgtGetPhaseDisposition( nPhase)
|
||||
EgtSetInfo( idDisp, 'ORD', nOrd)
|
||||
-- se c'è già stata separazione
|
||||
if bSplitAlreadyExecuted then
|
||||
EgtSetInfo( nDispId, 'TYPE', 'END2')
|
||||
EgtSetInfo( idDisp, 'TYPE', 'END2')
|
||||
else
|
||||
EgtSetInfo( nDispId, 'TYPE', 'MID')
|
||||
EgtSetInfo( idDisp, 'TYPE', 'MID')
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1713,11 +1717,11 @@ function BeamExec.ProcessMachinings( PARTS)
|
||||
-- ===== finiti i pezzi, si scarica il restante =====
|
||||
local idRestPart = EgtGetNextRawPart( PARTS[#PARTS].idRaw)
|
||||
if idRestPart and EgtGetRawPartBBox( idRestPart):getDimX() >= BeamData.dMinRaw then
|
||||
BeamLib.AddPhaseWithRawParts( idRestPart, BeamData.ptOriXR, BeamData.dPosXR, 0)
|
||||
BeamLib.AddPhaseWithRawParts( PARTS[#PARTS], BeamData.ptOriXR, BeamData.dPosXR, 0)
|
||||
local nPhase = EgtGetCurrPhase()
|
||||
local nDispId = EgtGetPhaseDisposition( nPhase)
|
||||
EgtSetInfo( nDispId, 'TYPE', 'REST')
|
||||
EgtSetInfo( nDispId, 'ORD', nOrd)
|
||||
local idDisp = EgtGetPhaseDisposition( nPhase)
|
||||
EgtSetInfo( idDisp, 'TYPE', 'REST')
|
||||
EgtSetInfo( idDisp, 'ORD', nOrd)
|
||||
end
|
||||
|
||||
-- Aggiornamento finale di tutto
|
||||
|
||||
Reference in New Issue
Block a user