Piccola correzione lettura parametri strategia

This commit is contained in:
andrea.villa
2025-03-14 12:29:51 +01:00
parent 5f930e2e21
commit a4ed9b5b5b
3 changed files with 19 additions and 15 deletions
+1 -1
View File
@@ -384,7 +384,7 @@ 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.Parameters and #DefaultStrategyParamList.Parameters > 0 then
if DefaultStrategyParamList and DefaultStrategyParamList.Parameters and #DefaultStrategyParamList.Parameters > 0 then
for i=1, #DefaultStrategyParamList.Parameters do
local xParameterValue = nil
-- se strategia forzata, leggo eventuali parametri nelle info
+17 -13
View File
@@ -868,20 +868,24 @@ function MachiningLib.PrepareMachiningsForSorting( Part)
-- se fase di lavoro standard, assegnazione dello spezzone
if MachiningCurrent.nStage == 2 then
local nParts = #Part.SplittingPoints + 1
local dPartMinX = Part.b3Part:getMin():getX()
local dPartMaxX = Part.b3Part:getMax():getX()
for j = 1, nParts do
local dNextSplitX = dPartMinX
local dPreviousSplitX = dPartMaxX
if j ~= 1 then
dPreviousSplitX = Part.SplittingPoints[j - 1]:getX()
end
if j ~= nParts then
dNextSplitX = Part.SplittingPoints[j]:getX()
end
if MachiningCurrent.ptCenter:getX() > dNextSplitX - 10 * GEO.EPS_SMALL and MachiningCurrent.ptCenter:getX() < dPreviousSplitX + 10 * GEO.EPS_SMALL then
MachiningCurrent.nPartSegment = j
if nParts > 1 then
local dPartMinX = Part.b3Part:getMin():getX()
local dPartMaxX = Part.b3Part:getMax():getX()
for j = 1, nParts do
local dNextSplitX = dPartMinX
local dPreviousSplitX = dPartMaxX
if j ~= 1 then
dPreviousSplitX = Part.SplittingPoints[j - 1]:getX()
end
if j ~= nParts then
dNextSplitX = Part.SplittingPoints[j]:getX()
end
if MachiningCurrent.ptCenter:getX() > dNextSplitX - 10 * GEO.EPS_SMALL and MachiningCurrent.ptCenter:getX() < dPreviousSplitX + 10 * GEO.EPS_SMALL then
MachiningCurrent.nPartSegment = j
end
end
else
MachiningCurrent.nPartSegment = -1
end
else
MachiningCurrent.nPartSegment = -1
+1 -1
View File
@@ -155,7 +155,7 @@ function STR0006.Make( bAddMachining, Proc, Part, CustomParameters)
local StrategyLib = {}
StrategyLib.Config = require( 'STR0006\\STR0006Config')
Strategy.sName = StrategyLib.Config.sStrategyId
Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( CustomParameters, StrategyLib.Config)
Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, StrategyLib.Config)
Strategy.Machining = {}
Strategy.Result = {}
local Results = {}