- in BeamExec e BatchProcessNew contemplate feature senza strategia e sostituite in restituzione risultati

This commit is contained in:
luca.mazzoleni
2025-04-28 15:02:29 +02:00
parent dca28cbe1b
commit 603043b9d2
2 changed files with 38 additions and 18 deletions
+29 -12
View File
@@ -663,6 +663,10 @@ local function CollectFeatures( Part)
table.insert( vProc, Proc)
-- altrimenti errore (non ci sono strategie per lavorare la topologia riconosciuta)
else
Proc.nFlg = 0
nProcCount = nProcCount + 1
Proc.nIndexInVProc = nProcCount
table.insert( vProc, Proc)
EgtOutLog( ' Feature ' .. tostring( Proc.idFeature) .. ' : NO available strategies')
end
-- calcolo riduzione lunghezza pinzabile testa/coda
@@ -671,6 +675,10 @@ local function CollectFeatures( Part)
Proc.bHindersLaserMeasure = FeatureLib.CalculateFeatureHindersLaserMeasure( Proc, Part)
-- altrimenti errore (serviva riconoscimento topologico, ma non è stato possibile farlo)
else
Proc.nFlg = 0
nProcCount = nProcCount + 1
Proc.nIndexInVProc = nProcCount
table.insert( vProc, Proc)
EgtOutLog( ' Feature ' .. tostring( Proc.idFeature) .. ' : NO available strategies')
end
else
@@ -768,15 +776,21 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part)
-- verifico se il taglio può essere saltato perchè è nella stessa posizione del taglio di testa
if Proc.nPrc == 340 and ProcB.Topology.sFamily == 'Cut' and
AreSameVectorApprox( ProcB.Faces[1].vtN, X_AX()) and abs( ProcB.Faces[1].ptCenter:getX() - Part.b3Part:getMax():getX()) < 10 * GEO.EPS_SMALL then
Proc.SubstitutedProc = ProcB
ProcB.IsSubstitutedBy = Proc
if not Proc.SlaveProcIndexes then
Proc.SlaveProcIndexes = {}
end
table.insert( Proc.SlaveProcIndexes, j)
ProcB.nIndexMasterProc = i
ProcB.nFlg = 0
end
-- verifico se il taglio può essere saltato perchè è nella stessa posizione del taglio di coda
if Proc.nPrc == 350 and ProcB.Topology.sFamily == 'Cut' and
AreSameVectorApprox( ProcB.Faces[1].vtN, -X_AX()) and abs( ProcB.Faces[1].ptCenter:getX() - Part.b3Part:getMin():getX()) < 10 * GEO.EPS_SMALL then
Proc.SubstitutedProc = ProcB
ProcB.IsSubstitutedBy = Proc
if not Proc.SlaveProcIndexes then
Proc.SlaveProcIndexes = {}
end
table.insert( Proc.SlaveProcIndexes, j)
ProcB.nIndexMasterProc = i
ProcB.nFlg = 0
end
-- verifico se feature tipo LapJoint è attraversata da almeno un foro
@@ -960,6 +974,8 @@ local function OrderFeatures( vProc)
-- se secondo disabilitato, va lasciato dopo
if B1.nFlg ~= 0 and B2.nFlg == 0 then
return true
elseif B2.nFlg ~= 0 and B1.nFlg == 0 then
return false
-- se entrambi disabilitati seguo l'Id
elseif B1.nFlg == 0 and B2.nFlg == 0 then
return ( B1.id < B2.id)
@@ -1027,14 +1043,13 @@ local function AddFeatureResultToGlobalList( Proc, nRotation)
local nCompletionIndex
local dCompositeRating
local sInfo
-- TODO non funziona perchè il riferimento ad un elemento della stessa tabella fa sparire la Proc sostituita (GetFeatureInfoAndDependency)
if Proc.IsSubstitutedBy then
sStrategyId = Proc.IsSubstitutedBy.ChosenStrategy.sStrategyId
sStatus = Proc.IsSubstitutedBy.ChosenStrategy.Result.sStatus
nCompletionIndex = Proc.IsSubstitutedBy.ChosenStrategy.Result.nCompletionIndex
dCompositeRating = Proc.IsSubstitutedBy.ChosenStrategy.Result.dCompositeRating
sInfo = Proc.IsSubstitutedBy.ChosenStrategy.Result.sInfo
else
if Proc.nIndexMasterProc then
sStrategyId = PROCESSINGS[Proc.nIndexPartInParts].Rotation[Proc.nIndexRotation][Proc.nIndexMasterProc].ChosenStrategy.sStrategyId
sStatus = PROCESSINGS[Proc.nIndexPartInParts].Rotation[Proc.nIndexRotation][Proc.nIndexMasterProc].ChosenStrategy.Result.sStatus
nCompletionIndex = PROCESSINGS[Proc.nIndexPartInParts].Rotation[Proc.nIndexRotation][Proc.nIndexMasterProc].ChosenStrategy.Result.nCompletionIndex
dCompositeRating = PROCESSINGS[Proc.nIndexPartInParts].Rotation[Proc.nIndexRotation][Proc.nIndexMasterProc].ChosenStrategy.Result.dCompositeRating
sInfo = PROCESSINGS[Proc.nIndexPartInParts].Rotation[Proc.nIndexRotation][Proc.nIndexMasterProc].ChosenStrategy.Result.sInfo
elseif Proc.ChosenStrategy then
sStrategyId = Proc.ChosenStrategy.sStrategyId
sStatus = Proc.ChosenStrategy.Result.sStatus
nCompletionIndex = Proc.ChosenStrategy.Result.nCompletionIndex
@@ -1390,6 +1405,8 @@ local function GetBestResultFromCombinationsMatrix( ProcessingsOnPart, PartInfo)
SingleCombination.nIndexInCombinationList = i
SingleCombination.nIndexRotation = nUnloadPos
else
ProcessingsOnPart.Rotation[1][nProc].nIndexRotation = nUnloadPos
table.insert( SingleCombination.Rot0, ProcessingsOnPart.Rotation[1][nProc])
SingleCombination.nNotExecute = SingleCombination.nNotExecute + 1
end
else