- In FACEBYMILL aggiunto parametro StepType

- STR0010 gestisce ora nuove topologie
- Modificata scelta strategie, se enrambe incomplete, predilige quella con più feature complete
- Corretta gestione feature da saltare perchè sostituta da altra. Prima la segnava come incompleta
This commit is contained in:
andrea.villa
2025-05-15 17:14:59 +02:00
parent 957269abf1
commit 03e37702e6
4 changed files with 169 additions and 104 deletions
+56 -46
View File
@@ -257,9 +257,9 @@ local function IsCombinationAvailable( sCombination, nUnloadPos, bSquareSection)
-- TODO scelta combinazione forzato DA RIMUOVERE!! Serve modifica al BEAM.
BEAM.BeamWall = true
BEAM.Rotation = {}
BEAM.Rotation.bBasic = true
BEAM.Rotation.bBasic = false
BEAM.Rotation.bNoRotation = false
BEAM.Rotation.bAdvanced = false
BEAM.Rotation.bAdvanced = true
--------------------------------------------------------------------------
-- BASIC : posizione di scarico come posizionamento iniziale
@@ -1241,8 +1241,11 @@ local function GetBestCombination( ListToCompare)
nIndexBestCombination = ListIndex
-- altrimenti guardo il voto
else
-- si sceglie soluzione con più feature complete
if ListToCompare[ListIndex].nComplete > ListToCompare[nIndexBestCombination].nComplete then
nIndexBestCombination = ListIndex
-- se stesso voto
if ListToCompare[nIndexBestCombination].dTotalRating == ListToCompare[ListIndex].dTotalRating then
elseif ListToCompare[nIndexBestCombination].dTotalRating == ListToCompare[ListIndex].dTotalRating then
-- TODO il voto dovrebbe essere considerato già pesando le rotazioni, con un coefficiente o un peso fisso aggiuntivo
-- scelgo soluzione con meno rotazioni
if ListToCompare[nIndexBestCombination].nRotations > ListToCompare[ListIndex].nRotations then
@@ -1374,51 +1377,58 @@ local function GetBestResultFromCombinationsMatrix( ProcessingsOnPart, PartInfo)
-- tagli testa e coda vengono aggiunti sempre alla fine
for nProc = 1, #ProcessingsOnPart.Rotation[1] do
if ProcessingsOnPart.Rotation[1][nProc].nPrc ~= 340 and ProcessingsOnPart.Rotation[1][nProc].nPrc ~= 350 then
-- ciclo sulle rotazioni
local nNextRot = nUnloadPos
local ResultsList = {}
for nRotation = 1, 3 do
-- se rotazione abilitata da combinazione
if string.sub( PartInfo.CombinationList[i].sBitIndexCombination, nNextRot, nNextRot) == '1' then
-- se è ultima rotazione oppure se feature non impatta su misura laser, allora è valida e può essere effettivamente considerata
if nNextRot == nUnloadPos or not( ProcessingsOnPart.Rotation[nNextRot][nProc].bHindersLaserMeasure) then
-- controllo se è stata scelta una strategia
if ProcessingsOnPart.Rotation[nNextRot][nProc].ChosenStrategy then
local Proc = {}
Proc.nRotation = nNextRot
table.insert( Proc, ProcessingsOnPart.Rotation[nNextRot][nProc])
table.insert( ResultsList, Proc)
end
end
end
nNextRot = EgtIf( nNextRot + 1 > 4, nNextRot + 1 - 4, nNextRot + 1)
end
-- se la feature può essere lavorata in almeno una rotazione
if #ResultsList > 0 then
local Proc, Data = GetProcBestMachRotationFromList( ResultsList)
Proc.nIndexRotation = Data.nIndexRotation
-- inserisco la Proc nell'apposita lista
if Data.nIndexRotation == nUnloadPos then
table.insert( SingleCombination.Rot0, Proc)
elseif Data.nIndexRotation == nUnloadPos + 1 then
table.insert( SingleCombination.Rot90, Proc)
bRot90 = true
else
table.insert( SingleCombination.Rot180, Proc)
bRot180 = true
end
SingleCombination.dTotalRating = SingleCombination.dTotalRating + Data.dCompositeRating
SingleCombination.nComplete = SingleCombination.nComplete + EgtIf( Data.bComplete, 1, 0)
SingleCombination.nNotComplete = SingleCombination.nNotComplete + EgtIf( Data.bNotComplete, 1, 0)
SingleCombination.nNotExecute = SingleCombination.nNotExecute + EgtIf( Data.bNotApplicable, 1, 0)
SingleCombination.nIndexInCombinationList = i
SingleCombination.nIndexRotation = nUnloadPos
else
-- se feature disattivata perchè eseguita da master a lei associata dichiaro comunque eseguita
if ProcessingsOnPart.Rotation[1][nProc].nFlg == 0 and ProcessingsOnPart.Rotation[1][nProc].nIndexMasterProc then
ProcessingsOnPart.Rotation[1][nProc].nIndexRotation = nUnloadPos
table.insert( SingleCombination.Rot0, ProcessingsOnPart.Rotation[1][nProc])
SingleCombination.nNotExecute = SingleCombination.nNotExecute + 1
SingleCombination.nComplete = SingleCombination.nComplete + 1
else
-- ciclo sulle rotazioni
local nNextRot = nUnloadPos
local ResultsList = {}
for nRotation = 1, 3 do
-- se rotazione abilitata da combinazione
if string.sub( PartInfo.CombinationList[i].sBitIndexCombination, nNextRot, nNextRot) == '1' then
-- se è ultima rotazione oppure se feature non impatta su misura laser, allora è valida e può essere effettivamente considerata
if nNextRot == nUnloadPos or not( ProcessingsOnPart.Rotation[nNextRot][nProc].bHindersLaserMeasure) then
-- controllo se è stata scelta una strategia
if ProcessingsOnPart.Rotation[nNextRot][nProc].ChosenStrategy then
local Proc = {}
Proc.nRotation = nNextRot
table.insert( Proc, ProcessingsOnPart.Rotation[nNextRot][nProc])
table.insert( ResultsList, Proc)
end
end
end
nNextRot = EgtIf( nNextRot + 1 > 4, nNextRot + 1 - 4, nNextRot + 1)
end
-- se la feature può essere lavorata in almeno una rotazione
if #ResultsList > 0 then
local Proc, Data = GetProcBestMachRotationFromList( ResultsList)
Proc.nIndexRotation = Data.nIndexRotation
-- inserisco la Proc nell'apposita lista
if Data.nIndexRotation == nUnloadPos then
table.insert( SingleCombination.Rot0, Proc)
elseif Data.nIndexRotation == nUnloadPos + 1 then
table.insert( SingleCombination.Rot90, Proc)
bRot90 = true
else
table.insert( SingleCombination.Rot180, Proc)
bRot180 = true
end
SingleCombination.dTotalRating = SingleCombination.dTotalRating + Data.dCompositeRating
SingleCombination.nComplete = SingleCombination.nComplete + EgtIf( Data.bComplete, 1, 0)
SingleCombination.nNotComplete = SingleCombination.nNotComplete + EgtIf( Data.bNotComplete, 1, 0)
SingleCombination.nNotExecute = SingleCombination.nNotExecute + EgtIf( Data.bNotApplicable, 1, 0)
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
end
else
if ProcessingsOnPart.Rotation[1][nProc].nPrc == 340 then