- modifiche a STR0003 per restituizione Result (ora funzionante, modificare per usare AddMachining nuova)
- in BeamExec GetBestStrategy eliminato check strategyOk (ora è relativo solo all'applicazione delle lavorazioni)
This commit is contained in:
+9
-11
@@ -661,6 +661,7 @@ end
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- ritorna l'indice della strategia migliore, tra le due passate
|
||||
local function GetIndexBestStrategyFromComparison( AvailableStrategies, nIndex1, nIndex2)
|
||||
-- TODO tra nCompletionIndex e dCompletionPercentage ne serve uno solo, valutare se ammettere entrambi così la strategia può scegliere quale restituire
|
||||
local dChosenIndex = 0
|
||||
-- controllo indici
|
||||
if nIndex1 == 0 and nIndex2 == 0 then
|
||||
@@ -723,18 +724,15 @@ local function GetBestStrategy( vProcSingleRot, Part)
|
||||
if CurrentStrategy.Config and CurrentStrategy.Script then
|
||||
local bStrategyOk
|
||||
-- eseguo la strategia solo come calcolo fattibilità e voto. Non si applicano le lavorazioni. Si passa la Proc e i parametri personalizzati
|
||||
bStrategyOk, Proc.AvailableStrategies[nIndexCurrentStrategy].Result = CurrentStrategy.Script.Make( false, Proc, Part, Proc.AvailableStrategies[nIndexCurrentStrategy].Parameters)
|
||||
-- se la strategia è andata a buon fine
|
||||
if bStrategyOk then
|
||||
-- scelgo la migliore strategia tra le due
|
||||
nIndexBestStrategy = GetIndexBestStrategyFromComparison( Proc.AvailableStrategies, nIndexCurrentStrategy, nIndexBestStrategy)
|
||||
_, Proc.AvailableStrategies[nIndexCurrentStrategy].Result = CurrentStrategy.Script.Make( false, Proc, Part, Proc.AvailableStrategies[nIndexCurrentStrategy].Parameters)
|
||||
-- scelgo la migliore strategia tra le due
|
||||
nIndexBestStrategy = GetIndexBestStrategyFromComparison( Proc.AvailableStrategies, nIndexCurrentStrategy, nIndexBestStrategy)
|
||||
|
||||
-- se scelta strategia standard, esco subito alla prima che trovo completa
|
||||
-- TODO serve paraemtro da Beam&Wall ( oppure da confirgurazione) !!!!!!!!
|
||||
if BEAM.GetFirstCompletedStrategy and nIndexBestStrategy > 0 then
|
||||
if Proc.AvailableStrategies[nIndexBestStrategy].Result.sStatus == 'Complete' then
|
||||
break
|
||||
end
|
||||
-- se scelta strategia standard, esco subito alla prima che trovo completa
|
||||
-- TODO serve paraemtro da Beam&Wall ( oppure da confirgurazione) !!!!!!!!
|
||||
if BEAM.GetFirstCompletedStrategy and nIndexBestStrategy > 0 then
|
||||
if Proc.AvailableStrategies[nIndexBestStrategy].Result.sStatus == 'Complete' then
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user