diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index aeea289..a76b480 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -233,12 +233,12 @@ function BeamExec.GetStrategiesFromJSONinBD() return end - local FeaturesList = {} - FeaturesList = ImportFileJSON( sFile) + local FeatureList = {} + FeatureList = ImportFileJSON( sFile) -- metto la tabella letta nella lista globale STRATEGIES STRATEGIES = {} - STRATEGIES.Features = FeaturesList + STRATEGIES.FeatureList = FeatureList end end @@ -537,15 +537,15 @@ end local function GetStrategiesFromGlobalList( Proc) -- cerco tra le feature - for i = 1, #STRATEGIES.Features do + for i = 1, #STRATEGIES.FeatureList do -- se trovo la feature - if Proc.nPrc == STRATEGIES.Features[i].nPrc and Proc.nGrp == STRATEGIES.Features[i].nGrp then + if Proc.nPrc == STRATEGIES.FeatureList[i].nPrc and Proc.nGrp == STRATEGIES.FeatureList[i].nGrp then -- cerco tra le topologie - for j = 1, #STRATEGIES.Features[i].Topologies do + for j = 1, #STRATEGIES.FeatureList[i].TopologyList do -- se trovo la topologia - if Proc.Topology.sName == STRATEGIES.Features[i].Topologies[j].sName then + if Proc.Topology.sName == STRATEGIES.FeatureList[i].TopologyList[j].sName then -- ritorno le strategie disponibili per la feature che sto analizzando - return STRATEGIES.Features[i].Topologies[j].Strategies + return STRATEGIES.FeatureList[i].TopologyList[j].StrategyList end end end @@ -557,7 +557,7 @@ end local function GetStrategies( Proc) local AvailableStrategiesForProc = nil -- se la lista STRATEGIES è stata letta da JSON (quindi non è vuota), ritorno le strategie possibili - if STRATEGIES and #STRATEGIES.Features > 0 then + if STRATEGIES and #STRATEGIES.FeatureList > 0 then AvailableStrategiesForProc = GetStrategiesFromGlobalList( Proc) end -- se non ho trovato strategie disponibili nel JSON, o se JSON non presente, lancio script che setta le strategie in modo statico, come definito con cliente diff --git a/LuaLibs/BeamLib.lua b/LuaLibs/BeamLib.lua index 5b62581..5e1472f 100644 --- a/LuaLibs/BeamLib.lua +++ b/LuaLibs/BeamLib.lua @@ -424,32 +424,32 @@ end function BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, DefaultStrategyParamList) local UpdatedParameters = {} -- TODO serve controllare se campo 'sStrategyId' congruente tra il Config (DefaultStrategyParamList) e i parametri custom (CustomParameters)? - if DefaultStrategyParamList and DefaultStrategyParamList.Parameters and #DefaultStrategyParamList.Parameters > 0 then + if DefaultStrategyParamList and DefaultStrategyParamList.ParameterList and #DefaultStrategyParamList.ParameterList > 0 then -- se le strategie disponibili sono le basic, non si possono customizzare valori di default da interfaccia, si leggono allora eventuali parametri di default decisi con cliente if Proc.AvailableStrategies.bIsBasicStrategy then -- essendo una strategia basic, la lista dei parametri custom dovrebbe essere sempre vuota. Si leggono ora - if not CustomParameters.Parameters then - CustomParameters.Parameters = BCS.GetParametersFromBasicCustomerStrategies( Proc, CustomParameters.sStrategyId) + if not CustomParameters.ParameterList then + CustomParameters.ParameterList = BCS.GetParametersFromBasicCustomerStrategies( Proc, CustomParameters.sStrategyId) end end -- lettura e settaggio parametri finali per la strategia (customizzati o default) - for i=1, #DefaultStrategyParamList.Parameters do + for i=1, #DefaultStrategyParamList.ParameterList do local xParameterValue = nil -- se strategia forzata, leggo eventuali parametri nelle info if CustomParameters and CustomParameters.bForcedStrategy then - local sParameterToRead = DefaultStrategyParamList.sStrategyId .. '_' .. DefaultStrategyParamList.Parameters[i].sNameNge + local sParameterToRead = DefaultStrategyParamList.sStrategyId .. '_' .. DefaultStrategyParamList.ParameterList[i].sNameNge local sForcedParameterForProc = EgtGetInfo( Proc.id, sParameterToRead, 's') -- se ho trovato il valore, lo sovrascrivo al default if sForcedParameterForProc then xParameterValue = sForcedParameterForProc end -- altrimenti i parametri custom si trovano già su questa lista - elseif CustomParameters and CustomParameters.Parameters then - for j=1, #CustomParameters.Parameters do - if CustomParameters.Parameters[j].sName == DefaultStrategyParamList.Parameters[i].sName or - CustomParameters.Parameters[j].sName == DefaultStrategyParamList.Parameters[i].sNameNge then - xParameterValue = CustomParameters.Parameters[j].sValue + elseif CustomParameters and CustomParameters.ParameterList then + for j=1, #CustomParameters.ParameterList do + if CustomParameters.ParameterList[j].sName == DefaultStrategyParamList.ParameterList[i].sName or + CustomParameters.ParameterList[j].sName == DefaultStrategyParamList.ParameterList[i].sNameNge then + xParameterValue = CustomParameters.ParameterList[j].sValue break end end @@ -457,20 +457,20 @@ function BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, Default -- se non arriva forzato da strategia, oppure se non è stato configurato da cliente, si prende default if not xParameterValue then - xParameterValue = DefaultStrategyParamList.Parameters[i].sValue + xParameterValue = DefaultStrategyParamList.ParameterList[i].sValue end - if DefaultStrategyParamList.Parameters[i].sType == 'b' then - UpdatedParameters[DefaultStrategyParamList.Parameters[i].sName] = xParameterValue == 'true' - elseif DefaultStrategyParamList.Parameters[i].sType == 'd' then - if #DefaultStrategyParamList.Parameters[i].sValue > 0 then - UpdatedParameters[DefaultStrategyParamList.Parameters[i].sName] = tonumber( xParameterValue) + if DefaultStrategyParamList.ParameterList[i].sType == 'b' then + UpdatedParameters[DefaultStrategyParamList.ParameterList[i].sName] = xParameterValue == 'true' + elseif DefaultStrategyParamList.ParameterList[i].sType == 'd' then + if #DefaultStrategyParamList.ParameterList[i].sValue > 0 then + UpdatedParameters[DefaultStrategyParamList.ParameterList[i].sName] = tonumber( xParameterValue) -- stringa vuota equivale a non passare alcun valore (deciderà la strategia) else - UpdatedParameters[DefaultStrategyParamList.Parameters[i].sName] = nil + UpdatedParameters[DefaultStrategyParamList.ParameterList[i].sName] = nil end else --DefaultStrategyParamList[i].sType == 's' or DefaultStrategyParamList[i].sType == 'combo' - UpdatedParameters[DefaultStrategyParamList.Parameters[i].sName] = xParameterValue + UpdatedParameters[DefaultStrategyParamList.ParameterList[i].sName] = xParameterValue end end diff --git a/Strategies/Standard/HEADCUT/HEADCUT.json b/Strategies/Standard/HEADCUT/HEADCUT.json index 02db2f3..b69359b 100644 --- a/Strategies/Standard/HEADCUT/HEADCUT.json +++ b/Strategies/Standard/HEADCUT/HEADCUT.json @@ -1,6 +1,6 @@ { "sStrategyId": "HEADCUT", - "Parameters" : [ + "ParameterList" : [ { "sName": "dDepthChamfer", "sNameNge": "DEPTH_CHAMFER", diff --git a/Strategies/Standard/STR0001/STR0001.json b/Strategies/Standard/STR0001/STR0001.json index 682b603..3a59f7a 100644 --- a/Strategies/Standard/STR0001/STR0001.json +++ b/Strategies/Standard/STR0001/STR0001.json @@ -1,6 +1,6 @@ { "sStrategyId": "STR0001", - "Parameters" : [ + "ParameterList" : [ { "sName": "dOverMatOnLength", "sNameNge": "OVM_LENGTH", diff --git a/Strategies/Standard/STR0002/STR0002.json b/Strategies/Standard/STR0002/STR0002.json index 9b9b7ba..e2441dd 100644 --- a/Strategies/Standard/STR0002/STR0002.json +++ b/Strategies/Standard/STR0002/STR0002.json @@ -1,6 +1,6 @@ { "sStrategyId": "STR0002", - "Parameters" : [ + "ParameterList" : [ { "sName": "dMaxCornerRadius", "sNameNge": "MAX_CORNER_RADIUS", diff --git a/Strategies/Standard/STR0003/STR0003.json b/Strategies/Standard/STR0003/STR0003.json index b3f3118..431813f 100644 --- a/Strategies/Standard/STR0003/STR0003.json +++ b/Strategies/Standard/STR0003/STR0003.json @@ -1,6 +1,6 @@ { "sStrategyId": "STR0003", - "Parameters" : [ + "ParameterList" : [ { "sName": "bFinishWithChainSaw", "sNameNge": "ALLOW_FINISH_CHAINSAW", diff --git a/Strategies/Standard/STR0004/STR0004.json b/Strategies/Standard/STR0004/STR0004.json index b9c919d..52788f2 100644 --- a/Strategies/Standard/STR0004/STR0004.json +++ b/Strategies/Standard/STR0004/STR0004.json @@ -1,6 +1,6 @@ { "sStrategyId": "STR0004", - "Parameters" : [ + "ParameterList" : [ { "sName": "bUseZigZagMortising", "sNameNge": "USE_ZIGZAG_CHAINSAW", diff --git a/Strategies/Standard/STR0005/STR0005.json b/Strategies/Standard/STR0005/STR0005.json index 41f744a..1db2cf9 100644 --- a/Strategies/Standard/STR0005/STR0005.json +++ b/Strategies/Standard/STR0005/STR0005.json @@ -1,6 +1,6 @@ { "sStrategyId": "STR0005", - "Parameters" : [ + "ParameterList" : [ { "sName": "bForceLongcutBlade", "sNameNge": "USE_LONGCUT_BLADE", diff --git a/Strategies/Standard/STR0006/STR0006.json b/Strategies/Standard/STR0006/STR0006.json index 874b8fc..6fc5008 100644 --- a/Strategies/Standard/STR0006/STR0006.json +++ b/Strategies/Standard/STR0006/STR0006.json @@ -1,6 +1,6 @@ { "sStrategyId": "STR0006", - "Parameters" : [ + "ParameterList" : [ { "sName": "dOverMatOnLength", "sNameNge": "OVM_LENGTH", diff --git a/Strategies/Standard/STR0007/STR0007.json b/Strategies/Standard/STR0007/STR0007.json index 5342eb1..3e7ca2b 100644 --- a/Strategies/Standard/STR0007/STR0007.json +++ b/Strategies/Standard/STR0007/STR0007.json @@ -1,6 +1,6 @@ { "sStrategyId": "STR0007", - "Parameters" : [ + "ParameterList" : [ { "sName": "dOverMatOnLength", "sNameNge": "OVM_LENGTH", diff --git a/Strategies/Standard/STR0008/STR0008.json b/Strategies/Standard/STR0008/STR0008.json index 41b5b80..2fe9e66 100644 --- a/Strategies/Standard/STR0008/STR0008.json +++ b/Strategies/Standard/STR0008/STR0008.json @@ -1,6 +1,6 @@ { "sStrategyId": "STR0008", - "Parameters" : [ + "ParameterList" : [ { "sName": "dOverMatOnLength", "sNameNge": "OVM_LENGTH", diff --git a/Strategies/Standard/STR0009/STR0009.json b/Strategies/Standard/STR0009/STR0009.json index 51894ca..cff429c 100644 --- a/Strategies/Standard/STR0009/STR0009.json +++ b/Strategies/Standard/STR0009/STR0009.json @@ -1,6 +1,6 @@ { "sStrategyId": "STR0009", - "Parameters" : [ + "ParameterList" : [ { "sName": "dDepthChamfer", "sNameNge": "DEPTH_CHAMFER", diff --git a/Strategies/Standard/TAILCUT/TAILCUT.json b/Strategies/Standard/TAILCUT/TAILCUT.json index 42a0f83..606e466 100644 --- a/Strategies/Standard/TAILCUT/TAILCUT.json +++ b/Strategies/Standard/TAILCUT/TAILCUT.json @@ -1,6 +1,6 @@ { "sStrategyId": "TAILCUT", - "Parameters" : [ + "ParameterList" : [ { "sName": "dDepthChamfer", "sNameNge": "DEPTH_CHAMFER",