Aggiornamento con nuovo standard nomencalatura

This commit is contained in:
andrea.villa
2025-04-24 09:02:21 +02:00
parent 0d3cc467a9
commit 88ee8759a3
13 changed files with 38 additions and 38 deletions
+18 -18
View File
@@ -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