diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index 7001d8a..7f8a97e 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -661,7 +661,6 @@ 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 diff --git a/LuaLibs/FeatureData.lua b/LuaLibs/FeatureData.lua index f9bc291..ea2f3b4 100644 --- a/LuaLibs/FeatureData.lua +++ b/LuaLibs/FeatureData.lua @@ -277,16 +277,6 @@ function FeatureData.GetFeatureQuality( sTypeTools) return nQuality end -------------------------------------------------------------------------------------------------------------- --- funzione che restituisce l'indice MRR (Material Removal Rate) della strategia. -function FeatureData.GetFeatureMRR( dMachiningStep, dMachiningSideStep, dFeed) - local dMRR = 1 - - -- Unità: dm/min per avere un indice vicino alle unità - dMRR = ( dMachiningStep * dMachiningSideStep * dFeed) / pow( 10, 6) - - return dMRR -end ------------------------------------------------------------------------------------------------------------- return FeatureData \ No newline at end of file diff --git a/LuaLibs/MachiningLib.lua b/LuaLibs/MachiningLib.lua index 32a1c98..ff84c26 100644 --- a/LuaLibs/MachiningLib.lua +++ b/LuaLibs/MachiningLib.lua @@ -476,5 +476,16 @@ function MachiningLib.ApplyMachining( bRecalc, bApplyPost) return bResult end +------------------------------------------------------------------------------------------------------------- +-- funzione che restituisce l'indice MRR (Material Removal Rate) della strategia. +function MachiningLib.GetToolMRR( dMachiningStep, dMachiningSideStep, dFeed) + local dMRR = 1 + + -- Unità: dm/min per avere un indice vicino alle unità + dMRR = ( dMachiningStep * dMachiningSideStep * dFeed) / pow( 10, 6) + + return dMRR +end + ------------------------------------------------------------------------------------------------------------- return MachiningLib diff --git a/Strategies/STR0002/STR0002.lua b/Strategies/STR0002/STR0002.lua index a76d271..b2cb567 100644 --- a/Strategies/STR0002/STR0002.lua +++ b/Strategies/STR0002/STR0002.lua @@ -76,10 +76,10 @@ function STR0002.Make( bAddMachining, Proc, Part, CustomParameters) else Strategy.Result.sStatus = 'Completed' end - Strategy.Result.dCompletionPercentage = min( 100, ( ( Proc.MainFaces.BottomFace.dElevation - ToolInfo.dResidualDepth) / Proc.MainFaces.BottomFace.dElevation) * 100) - Strategy.Result.nCompletionIndex = FeatureData.GetFeatureCompletionIndex( Strategy.Result.dCompletionPercentage) + local dCompletionPercentage = min( 100, ( ( Proc.MainFaces.BottomFace.dElevation - ToolInfo.dResidualDepth) / Proc.MainFaces.BottomFace.dElevation) * 100) + Strategy.Result.nCompletionIndex = FeatureData.GetFeatureCompletionIndex( dCompletionPercentage) Strategy.Result.nQuality = FeatureData.GetFeatureQuality( 'Mill') - Strategy.Result.dMRR = FeatureData.GetFeatureMRR( TOOLS[ToolInfo.nToolIndex].dStep, TOOLS[ToolInfo.nToolIndex].dSideStep, TOOLS[ToolInfo.nToolIndex].Feeds.dFeed) + Strategy.Result.dMRR = MachiningLib.GetToolMRR( TOOLS[ToolInfo.nToolIndex].dStep, TOOLS[ToolInfo.nToolIndex].dSideStep, TOOLS[ToolInfo.nToolIndex].Feeds.dFeed) Strategy.Result.sInfo = '' -- se richiesto applico lavorazione