- Correzioni varie per compatibilità con lettura file JSON di configurazione

- In GetBestStrategy si fa copia della tabella che prima era passata come riferimento
This commit is contained in:
andrea.villa
2025-05-23 14:55:26 +02:00
parent 97dfd6f2e1
commit a772113107
4 changed files with 30 additions and 15 deletions
+23 -8
View File
@@ -550,13 +550,28 @@ local function GetStrategiesFromGlobalList( Proc)
-- cerco tra le feature
for i = 1, #STRATEGIES.FeatureList do
-- se trovo la feature
if Proc.nPrc == STRATEGIES.FeatureList[i].nPrc and Proc.nGrp == STRATEGIES.FeatureList[i].nGrp then
-- cerco tra le topologie
for j = 1, #STRATEGIES.FeatureList[i].TopologyList do
-- se trovo la topologia
if Proc.Topology.sName == STRATEGIES.FeatureList[i].TopologyList[j].sName then
-- ritorno le strategie disponibili per la feature che sto analizzando
return STRATEGIES.FeatureList[i].TopologyList[j].StrategyList
if Proc.nPrc == STRATEGIES.FeatureList[i].nPrc then
local bGroupIsCompatible = false
-- nel JSON il gruppo è sempre 0/1, mente da BTL possono arrivare altri valori.
if STRATEGIES.FeatureList[i].nGrp == 0 then
if Proc.nGrp == 0 or Proc.nGrp == 3 or Proc.nGrp == 4 then
bGroupIsCompatible = true
end
elseif STRATEGIES.FeatureList[i].nGrp == 1 then
if Proc.nGrp == 1 or Proc.nGrp == 2 then
bGroupIsCompatible = true
end
end
-- si controlla gruppo
if bGroupIsCompatible then
-- cerco tra le topologie
for j = 1, #STRATEGIES.FeatureList[i].TopologyList do
-- se trovo la topologia
if Proc.Topology.sName == STRATEGIES.FeatureList[i].TopologyList[j].sName then
-- ritorno le strategie disponibili per la feature che sto analizzando
return STRATEGIES.FeatureList[i].TopologyList[j].StrategyList
end
end
end
end
@@ -916,7 +931,7 @@ local function GetBestStrategy( vProcSingleRot)
-- salvo sulla proc la migliore strategia
end
if nIndexBestStrategy ~= 0 then
Proc.ChosenStrategy = Proc.AvailableStrategies[nIndexBestStrategy]
Proc.ChosenStrategy = BeamLib.TableCopyDeep( Proc.AvailableStrategies[nIndexBestStrategy])
Proc.nIndexBestStrategy = nIndexBestStrategy
end
end