- in STR0003 gestione ritorno risultati nuovo e completamento con area lavorata
This commit is contained in:
@@ -108,7 +108,7 @@ function MachiningLib.GetMachiningSteps( dMachiningDepth, dStep)
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function MachiningLib.GetSplitMachinings( Machinings, SplittingPoints, Part )
|
||||
function MachiningLib.GetSplitMachinings( Machinings, SplittingPoints, Part)
|
||||
for i = #Machinings, 1, -1 do
|
||||
local nParts = #SplittingPoints + 1
|
||||
local dEdgeMaxX = Machinings[i].ptEdge1:getX()
|
||||
|
||||
@@ -165,6 +165,18 @@ function Chainsaw.AddResult( Mortising)
|
||||
end
|
||||
|
||||
|
||||
local function GetTotalAreaToMachine( Machinings)
|
||||
local dTotalAreaToMachine = 0
|
||||
|
||||
for i = 1, #Machinings do
|
||||
local Machining = Machinings[i]
|
||||
dTotalAreaToMachine = dTotalAreaToMachine + Machining.dAreaToMachine
|
||||
end
|
||||
|
||||
return dTotalAreaToMachine
|
||||
end
|
||||
|
||||
|
||||
function STR0003.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
-- carico parametri da default e li aggiorno con quelli passati dal chiamante (potrebbero non essere congruenti)
|
||||
local StrategyLib = {}
|
||||
@@ -223,6 +235,7 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
local SideEdge2 = LongFace.MainEdges.SideEdges[2]
|
||||
local BottomEdge = LongFace.MainEdges.BottomEdge
|
||||
|
||||
-- TODO funzione separata
|
||||
-- lama - calcolo lavorazioni
|
||||
local Cutting = {}
|
||||
-- parametri comuni a tutte le lavorazioni cutting
|
||||
@@ -283,17 +296,8 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
-- lama - lavorazioni raggruppate in unica lista, escluse le lavorazioni non applicabili
|
||||
Blade.Result.Sorted = MergeResults( Blade.Result)
|
||||
|
||||
-- lama - nessuna lavorazione successiva - calcolo qualità e completamento
|
||||
if not Strategy.Parameters.bFinishWithChainSaw then
|
||||
Strategy.Result.nQuality = FeatureLib.GetStrategyQuality( Blade.Result.Sorted)
|
||||
local dTotalAreaToMachine = 0
|
||||
for i = 1, #Blade.Result.Sorted do
|
||||
local Machining = Blade.Result.Sorted[i]
|
||||
dTotalAreaToMachine = dTotalAreaToMachine + Machining.dAreaToMachine
|
||||
end
|
||||
Strategy.Result.dCompletionPercentage = dTotalAreaToMachine / LongFace.dArea * 100
|
||||
Strategy.Result.nCompletionIndex = FeatureLib.GetFeatureCompletionIndex( Strategy.Result.dCompletionPercentage)
|
||||
end
|
||||
-- lama - calcolo area lavorata
|
||||
local dAreaToMachineBlade = GetTotalAreaToMachine( Blade.Result.Sorted)
|
||||
|
||||
-- lama - aggiunta eventuali lavorazioni splittate
|
||||
if bIsSplitFeature then
|
||||
@@ -316,7 +320,10 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
bAreAllMachiningsAdded = AddMachinings( Proc, Blade.Result.Sorted)
|
||||
end
|
||||
|
||||
-- calcolo MRR e esito strategia
|
||||
-- calcolo risultati
|
||||
Strategy.Result.nQuality = FeatureLib.GetStrategyQuality( Blade.Result.Sorted)
|
||||
Strategy.Result.dCompletionPercentage = dAreaToMachineBlade / LongFace.dArea * 100
|
||||
Strategy.Result.nCompletionIndex = FeatureLib.GetFeatureCompletionIndex( Strategy.Result.dCompletionPercentage)
|
||||
local dTimeToMachine = FeatureLib.GetStrategyTimeToMachine( Blade.Result.Sorted)
|
||||
Strategy.Result.dMRR = ( dFeatureVolume / dTimeToMachine) / pow( 10, 6)
|
||||
if #Blade.Result.Sorted > 0 then
|
||||
@@ -334,6 +341,7 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
return bAreAllMachiningsAdded, Strategy.Result
|
||||
end
|
||||
|
||||
-- TODO funzione separata
|
||||
-- sega a catena - calcolo lavorazioni
|
||||
local Mortising = {}
|
||||
-- parametri comuni a tutte le lavorazioni mortising
|
||||
@@ -608,6 +616,9 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
-- sega a catena - lavorazioni raggruppate in unica lista
|
||||
Chainsaw.Result.Sorted = MergeResults( Chainsaw.Result)
|
||||
|
||||
-- sega a catena - calcolo completamento
|
||||
local dAreaToMachineChainsaw = GetTotalAreaToMachine( Chainsaw.Result.Sorted)
|
||||
|
||||
-- sega a catena - aggiunta eventuali lavorazioni splittate
|
||||
if bIsSplitFeature then
|
||||
Chainsaw.Result.Sorted = MachiningLib.GetSplitMachinings( Chainsaw.Result.Sorted, FeatureSplittingPoints, Part)
|
||||
@@ -631,36 +642,25 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
|
||||
-- aggiunta lavorazioni per tutti gli utensili
|
||||
local bAreAllMachiningsAdded = true
|
||||
local dFinalCompletionPercentage = 100
|
||||
if bAddMachining then
|
||||
bAreAllMachiningsAdded = AddMachinings( Proc, Result)
|
||||
end
|
||||
|
||||
-- calcolo risultati
|
||||
Strategy.Result.dCompletionPercentage = max( dAreaToMachineBlade, dAreaToMachineChainsaw) / LongFace.dArea * 100
|
||||
Strategy.Result.nCompletionIndex = FeatureLib.GetFeatureCompletionIndex( Strategy.Result.dCompletionPercentage)
|
||||
if #Result > 0 then
|
||||
if Mortising.dCompletionPercentage > 100 - 10 * GEO.EPS_SMALL then
|
||||
if Strategy.Result.dCompletionPercentage > 100 - 10 * GEO.EPS_SMALL then
|
||||
Strategy.Result.sStatus = 'Completed'
|
||||
else
|
||||
Strategy.Result.sStatus = 'Not-Completed'
|
||||
-- TODO al momento si assume che la percentuale di completamento dell'ultima lavorazione sia quella rilevante
|
||||
dFinalCompletionPercentage = Mortising.dCompletionPercentage
|
||||
end
|
||||
else
|
||||
Strategy.Result.sStatus = 'Not-Applicable'
|
||||
end
|
||||
Strategy.Result.nCompletionIndex = FeatureLib.GetFeatureCompletionIndex( dFinalCompletionPercentage)
|
||||
Strategy.Result.nQuality = 0.5 * TOOLS[Cutting.nToolIndex].nQuality + 0.5 * TOOLS[Mortising.nToolIndex].nQuality
|
||||
local MRRParametersBlade = {
|
||||
dStep = TOOLS[Cutting.nToolIndex].dThickness,
|
||||
dSideStep = min( TOOLS[Cutting.nToolIndex].dSideStep, SideEdge1.dLength),
|
||||
dFeed = TOOLS[Cutting.nToolIndex].Feeds.dFeed}
|
||||
local MRRParametersChainsaw = {
|
||||
dStep = min( TOOLS[Mortising.nToolIndex].dStep, SideEdge1.dLength),
|
||||
dSideStep = TOOLS[Mortising.nToolIndex].dThickness,
|
||||
dFeed = TOOLS[Mortising.nToolIndex].Feeds.dFeed}
|
||||
local dMRRBlade = MachiningLib.GetToolMRR( MRRParametersBlade)
|
||||
local dMRRChainsaw = MachiningLib.GetToolMRR( MRRParametersChainsaw)
|
||||
Strategy.Result.dMRR = ( dMRRBlade + dMRRChainsaw) / 2
|
||||
Strategy.Result.nQuality = FeatureLib.GetStrategyQuality( Result)
|
||||
local dTimeToMachine = FeatureLib.GetStrategyTimeToMachine( Result)
|
||||
Strategy.Result.dMRR = ( dFeatureVolume / dTimeToMachine) / pow( 10, 6)
|
||||
|
||||
return bAreAllMachiningsAdded, Strategy.Result
|
||||
end
|
||||
|
||||
@@ -242,9 +242,7 @@ function BLADEKEEPWASTE.Make( Proc, Part, OptionalParameters)
|
||||
end
|
||||
end
|
||||
|
||||
-- calcolo qualità e completamento
|
||||
Result.nQuality = FeatureLib.GetStrategyQuality( Machinings)
|
||||
-- per il completamento serve la lista di lavorazioni che comprende le non applicabili
|
||||
-- calcolo completamento, serve la lista di lavorazioni che comprende le non applicabili
|
||||
Result.dCompletionPercentage = GetStrategyCompletionPercentage( CalculatedMachinings)
|
||||
Result.nCompletionIndex = FeatureLib.GetFeatureCompletionIndex( Result.dCompletionPercentage)
|
||||
|
||||
@@ -256,8 +254,9 @@ function BLADEKEEPWASTE.Make( Proc, Part, OptionalParameters)
|
||||
-- ordinamento
|
||||
table.sort( Machinings, SortMachiningsBySegment)
|
||||
|
||||
-- calcolo MRR e esito strategia
|
||||
-- calcolo risultati
|
||||
if Cutting1.bIsApplicable or Cutting2.bIsApplicable then
|
||||
Result.nQuality = FeatureLib.GetStrategyQuality( Machinings)
|
||||
local dTimeToMachine = FeatureLib.GetStrategyTimeToMachine( Machinings)
|
||||
Result.dMRR = ( dFeatureVolume / dTimeToMachine) / pow( 10, 6)
|
||||
if Result.dCompletionPercentage > 100 - 10 * GEO.EPS_SMALL then
|
||||
|
||||
Reference in New Issue
Block a user