|
|
|
@@ -60,6 +60,72 @@ local function GetCompletionPercentage( Proc, Result)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- TODO si può unificare con eguale funzione in STR0004
|
|
|
|
|
local function SortMachiningsBySegment( MachiningA, MachiningB)
|
|
|
|
|
if MachiningA.nSegment > MachiningB.nSegment then
|
|
|
|
|
return false
|
|
|
|
|
elseif MachiningB.nSegment > MachiningA.nSegment then
|
|
|
|
|
return true
|
|
|
|
|
else
|
|
|
|
|
if TOOLS[ MachiningA.nToolIndex].sFamily == 'SAWBLADE' and TOOLS[ MachiningB.nToolIndex].sFamily == 'MORTISE' then
|
|
|
|
|
return true
|
|
|
|
|
elseif TOOLS[ MachiningA.nToolIndex].sFamily == 'MORTISE' and TOOLS[ MachiningB.nToolIndex].sFamily == 'SAWBLADE' then
|
|
|
|
|
return false
|
|
|
|
|
else
|
|
|
|
|
if MachiningA.sEdgeType == 'Side' and MachiningB.sEdgeType ~= 'Side' then
|
|
|
|
|
return true
|
|
|
|
|
elseif MachiningB.sEdgeType == 'Side' and MachiningA.sEdgeType ~= 'Side' then
|
|
|
|
|
return false
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local function SortMachiningsByTool( MachiningA, MachiningB)
|
|
|
|
|
if TOOLS[ MachiningA.nToolIndex].sFamily == 'SAWBLADE' and TOOLS[ MachiningB.nToolIndex].sFamily == 'MORTISE' then
|
|
|
|
|
return true
|
|
|
|
|
elseif TOOLS[ MachiningA.nToolIndex].sFamily == 'MORTISE' and TOOLS[ MachiningB.nToolIndex].sFamily == 'SAWBLADE' then
|
|
|
|
|
return false
|
|
|
|
|
else
|
|
|
|
|
if MachiningA.nSegment > MachiningB.nSegment then
|
|
|
|
|
return false
|
|
|
|
|
elseif MachiningB.nSegment > MachiningA.nSegment then
|
|
|
|
|
return true
|
|
|
|
|
else
|
|
|
|
|
if MachiningA.sEdgeType == 'Side' and MachiningB.sEdgeType ~= 'Side' then
|
|
|
|
|
return true
|
|
|
|
|
elseif MachiningB.sEdgeType == 'Side' and MachiningA.sEdgeType ~= 'Side' then
|
|
|
|
|
return false
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local function MergeResults( Result)
|
|
|
|
|
local SortedResult = {}
|
|
|
|
|
|
|
|
|
|
for i = 1, #Result.Side do
|
|
|
|
|
if Result.Side[i].bIsApplicable then
|
|
|
|
|
table.insert( SortedResult, Result.Side[i])
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
for i = 1, #Result.Bottom do
|
|
|
|
|
if Result.Bottom[i].bIsApplicable then
|
|
|
|
|
table.insert( SortedResult, Result.Bottom[i])
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
for i = 1, #Result.Opposite do
|
|
|
|
|
if Result.Opposite[i].bIsApplicable then
|
|
|
|
|
table.insert( SortedResult, Result.Opposite[i])
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return SortedResult
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local function AddResult( Machining, Result)
|
|
|
|
|
table.insert( Result, {})
|
|
|
|
|
if not Result.Bottom then
|
|
|
|
@@ -85,6 +151,34 @@ local function AddResult( Machining, Result)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local function AddMachinings( Proc, Machinings, bAddMachining)
|
|
|
|
|
local nIsApplicableCount = 0
|
|
|
|
|
local bAreAllMachiningsAdded = true
|
|
|
|
|
|
|
|
|
|
for i = 1, #Machinings do
|
|
|
|
|
if Machinings[i].bIsApplicable then
|
|
|
|
|
nIsApplicableCount = nIsApplicableCount + 1
|
|
|
|
|
if bAddMachining then
|
|
|
|
|
local bIsMachiningAdded
|
|
|
|
|
if TOOLS[ Machinings[i].nToolIndex].sFamily == 'SAWBLADE' then
|
|
|
|
|
Blade.AddMachiningAllSteps( Proc, Machinings[i])
|
|
|
|
|
elseif TOOLS[ Machinings[i].nToolIndex].sFamily == 'MORTISE' then
|
|
|
|
|
Chainsaw.AddMachiningAllSteps( Proc, Machinings[i])
|
|
|
|
|
else
|
|
|
|
|
error( 'AddMachinings : tool type not supported')
|
|
|
|
|
end
|
|
|
|
|
if not bIsMachiningAdded then
|
|
|
|
|
bAreAllMachiningsAdded = false
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
Strategy.Result.sInfo = Strategy.Result.sInfo .. '\n' .. Machinings[i].sMessage
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return bAreAllMachiningsAdded, nIsApplicableCount
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Blade.AddResult( Cutting)
|
|
|
|
|
AddResult( Cutting, Blade.Result)
|
|
|
|
|
end
|
|
|
|
@@ -206,61 +300,39 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters)
|
|
|
|
|
Strategy.Parameters.bNotCompleteWithBladeRadius = false
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
-- lama - aggiunta lavorazioni
|
|
|
|
|
local nIsApplicableCount = 0
|
|
|
|
|
local dFinalCompletionPercentage = 100
|
|
|
|
|
local bAreAllMachiningsAdded = true
|
|
|
|
|
for i = 1, #Blade.Result.Bottom do
|
|
|
|
|
if Blade.Result.Bottom[i].bIsApplicable then
|
|
|
|
|
nIsApplicableCount = nIsApplicableCount + 1
|
|
|
|
|
if bAddMachining then
|
|
|
|
|
local bIsMachiningAdded = Blade.AddMachiningAllSteps( Proc, Blade.Result.Bottom[i])
|
|
|
|
|
if not bIsMachiningAdded then
|
|
|
|
|
bAreAllMachiningsAdded = false
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
Strategy.Result.sInfo = Strategy.Result.sInfo .. '\n' .. Blade.Result.Bottom[i].sMessage
|
|
|
|
|
end
|
|
|
|
|
-- lama - lavorazioni raggruppate in unica lista
|
|
|
|
|
Blade.Result.Sorted = MergeResults( Blade.Result)
|
|
|
|
|
-- lama - aggiunta eventuali lavorazioni splittate
|
|
|
|
|
local vFeatureSplittingPoints = FeatureLib.GetFeatureSplittingPoints( Proc, Part)
|
|
|
|
|
if #vFeatureSplittingPoints > 0 then
|
|
|
|
|
Blade.Result.Sorted = MachiningLib.GetSplitMachinings( Blade.Result.Sorted, vFeatureSplittingPoints, Part)
|
|
|
|
|
end
|
|
|
|
|
for i = 1, #Blade.Result.Side do
|
|
|
|
|
if Blade.Result.Side[i].bIsApplicable then
|
|
|
|
|
nIsApplicableCount = nIsApplicableCount + 1
|
|
|
|
|
if bAddMachining then
|
|
|
|
|
local bIsMachiningAdded = Blade.AddMachiningAllSteps( Proc, Blade.Result.Side[i])
|
|
|
|
|
if not bIsMachiningAdded then
|
|
|
|
|
bAreAllMachiningsAdded = false
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
Strategy.Result.sInfo = Strategy.Result.sInfo .. '\n' .. Blade.Result.Side[i].sMessage
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
for i = 1, #Blade.Result.Opposite do
|
|
|
|
|
if Blade.Result.Opposite[i].bIsApplicable then
|
|
|
|
|
nIsApplicableCount = nIsApplicableCount + 1
|
|
|
|
|
if bAddMachining then
|
|
|
|
|
local bIsMachiningAdded = Blade.AddMachiningAllSteps( Proc, Blade.Result.Opposite[i])
|
|
|
|
|
if not bIsMachiningAdded then
|
|
|
|
|
bAreAllMachiningsAdded = false
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
Strategy.Result.sInfo = Strategy.Result.sInfo .. '\n' .. Blade.Result.Opposite[i].sMessage
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
if nIsApplicableCount > 0 then
|
|
|
|
|
-- TODO sistemare il calcolo completamento - implementare calcolo area lavorata
|
|
|
|
|
if not Strategy.Parameters.bNotCompleteWithBladeRadius and Cutting.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 = Cutting.dCompletionPercentage
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
Strategy.Result.sStatus = 'Not-Applicable'
|
|
|
|
|
Strategy.Parameters.bFinishWithChainSaw = false
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- lama - nessuna lavorazione successiva - aggiunta lavorazioni e calcolo risultati
|
|
|
|
|
if not Strategy.Parameters.bFinishWithChainSaw then
|
|
|
|
|
-- ordinamento
|
|
|
|
|
if Strategy.Parameters.bSortBySegment then
|
|
|
|
|
table.sort( Blade.Result.Sorted, SortMachiningsBySegment)
|
|
|
|
|
else
|
|
|
|
|
table.sort( Blade.Result.Sorted, SortMachiningsByTool)
|
|
|
|
|
end
|
|
|
|
|
-- aggiunta lavorazioni
|
|
|
|
|
local nIsApplicableCount = 0
|
|
|
|
|
local bAreAllMachiningsAdded = true
|
|
|
|
|
local dFinalCompletionPercentage = 100
|
|
|
|
|
bAreAllMachiningsAdded, nIsApplicableCount = AddMachinings( Proc, Blade.Result.Sorted, bAddMachining)
|
|
|
|
|
if nIsApplicableCount > 0 then
|
|
|
|
|
-- TODO sistemare il calcolo completamento - implementare calcolo area lavorata
|
|
|
|
|
if not Strategy.Parameters.bNotCompleteWithBladeRadius and Cutting.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 = Cutting.dCompletionPercentage
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
Strategy.Result.sStatus = 'Not-Applicable'
|
|
|
|
|
Strategy.Parameters.bFinishWithChainSaw = false
|
|
|
|
|
end
|
|
|
|
|
Strategy.Result.nCompletionIndex = FeatureLib.GetFeatureCompletionIndex( dFinalCompletionPercentage)
|
|
|
|
|
Strategy.Result.nQuality = FeatureLib.GetFeatureQuality( 'Blade')
|
|
|
|
|
local MRRParametersBlade = {
|
|
|
|
@@ -282,12 +354,12 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters)
|
|
|
|
|
( Proc.MainFaces.LongFaces[1].MainEdges.BottomEdge.dLength > 3 * Blade.Result.Bottom[1].dBladeMarkLength - 10 * GEO.EPS_SMALL) then
|
|
|
|
|
|
|
|
|
|
if not Proc.MainFaces.LongFaces[1].MainEdges.BottomEdge.bIsStartOpen then
|
|
|
|
|
local OptionalParameters = { sSideToMachine = 'Start', dLengthToMachine = Blade.Result.Bottom[1].dBladeMarkLength, dMaxElev = 0, dExtendAfterTail = dExtendAfterTail}
|
|
|
|
|
local OptionalParameters = { sSideToMachine = 'Start', dLengthToMachine = Blade.Result.Bottom[1].dBladeMarkLength, dExtendAfterTail = dExtendAfterTail}
|
|
|
|
|
Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.BottomEdge, OptionalParameters)
|
|
|
|
|
Chainsaw.AddResult( Mortising)
|
|
|
|
|
end
|
|
|
|
|
if not Proc.MainFaces.LongFaces[1].MainEdges.BottomEdge.bIsEndOpen then
|
|
|
|
|
local OptionalParameters = { sSideToMachine = 'End', dLengthToMachine = Blade.Result.Bottom[1].dBladeMarkLength, dMaxElev = 0, dExtendAfterTail = dExtendAfterTail}
|
|
|
|
|
local OptionalParameters = { sSideToMachine = 'End', dLengthToMachine = Blade.Result.Bottom[1].dBladeMarkLength, dExtendAfterTail = dExtendAfterTail}
|
|
|
|
|
Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.BottomEdge, OptionalParameters)
|
|
|
|
|
Chainsaw.AddResult( Mortising)
|
|
|
|
|
end
|
|
|
|
@@ -302,10 +374,10 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters)
|
|
|
|
|
-- si lavora solamente l'impronta lama sul fondo
|
|
|
|
|
if ( #Blade.Result.Side > 0) and Blade.Result.Side[1].dResidualDepth < 10 * GEO.EPS_SMALL then
|
|
|
|
|
if ( Proc.MainFaces.LongFaces[1].MainEdges.BottomEdge.bIsStartOpen and Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[1].dLength > 3 * Blade.Result.Side[1].dBladeMarkLength - 10 * GEO.EPS_SMALL) then
|
|
|
|
|
local OptionalParameters = { sSideToMachine = 'End', dLengthToMachine = Blade.Result.Side[1].dBladeMarkLength, dMaxElev = 0, dExtendAfterTail = dExtendAfterTail}
|
|
|
|
|
local OptionalParameters = { sSideToMachine = 'End', dLengthToMachine = Blade.Result.Side[1].dBladeMarkLength, dExtendAfterTail = dExtendAfterTail}
|
|
|
|
|
Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[1], OptionalParameters)
|
|
|
|
|
elseif ( Proc.MainFaces.LongFaces[1].MainEdges.BottomEdge.bIsEndOpen and Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[2].dLength > 3 * Blade.Result.Side[1].dBladeMarkLength - 10 * GEO.EPS_SMALL) then
|
|
|
|
|
local OptionalParameters = { sSideToMachine = 'Start', dLengthToMachine = Blade.Result.Side[1].dBladeMarkLength, dMaxElev = 0, dExtendAfterTail = dExtendAfterTail}
|
|
|
|
|
local OptionalParameters = { sSideToMachine = 'Start', dLengthToMachine = Blade.Result.Side[1].dBladeMarkLength, dExtendAfterTail = dExtendAfterTail}
|
|
|
|
|
Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[2], OptionalParameters)
|
|
|
|
|
end
|
|
|
|
|
-- si lavora tutto il lato
|
|
|
|
@@ -338,16 +410,16 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters)
|
|
|
|
|
if ( Blade.Result.Side[1].dResidualDepth < 10 * GEO.EPS_SMALL and Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[1].dLength > 3 * Blade.Result.Side[1].dBladeMarkLength - 10 * GEO.EPS_SMALL) and
|
|
|
|
|
( Blade.Result.Side[2].dResidualDepth < 10 * GEO.EPS_SMALL and Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[2].dLength > 3 * Blade.Result.Side[2].dBladeMarkLength - 10 * GEO.EPS_SMALL) then
|
|
|
|
|
|
|
|
|
|
local OptionalParameters = { sSideToMachine = 'End', dLengthToMachine = Blade.Result.Side[1].dBladeMarkLength, dMaxElev = 0, dExtendAfterTail = dExtendAfterTail}
|
|
|
|
|
local OptionalParameters = { sSideToMachine = 'End', dLengthToMachine = Blade.Result.Side[1].dBladeMarkLength, dExtendAfterTail = dExtendAfterTail}
|
|
|
|
|
Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[1], OptionalParameters)
|
|
|
|
|
Chainsaw.AddResult( Mortising)
|
|
|
|
|
-- ancora materiale residuo - si lavora da entrambi i lati
|
|
|
|
|
if Chainsaw.Result.Side[1].dResidualDepth > 10 * GEO.EPS_SMALL then
|
|
|
|
|
local OptionalParameters = { bStopAtHalfElevation = true, sSideToMachine = 'End', dLengthToMachine = Blade.Result.Side[1].dBladeMarkLength, dMaxElev = 0, dExtendAfterTail = dExtendAfterTail}
|
|
|
|
|
local OptionalParameters = { bStopAtHalfElevation = true, sSideToMachine = 'End', dLengthToMachine = Blade.Result.Side[1].dBladeMarkLength, dExtendAfterTail = dExtendAfterTail}
|
|
|
|
|
Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[1], OptionalParameters)
|
|
|
|
|
Chainsaw.AddResult( Mortising)
|
|
|
|
|
OptionalParameters = {}
|
|
|
|
|
OptionalParameters = { bStopAtHalfElevation = true, sSideToMachine = 'Start', dLengthToMachine = Blade.Result.Side[2].dBladeMarkLength, dMaxElev = 0, dExtendAfterTail = dExtendAfterTail}
|
|
|
|
|
OptionalParameters = { bStopAtHalfElevation = true, sSideToMachine = 'Start', dLengthToMachine = Blade.Result.Side[2].dBladeMarkLength, dExtendAfterTail = dExtendAfterTail}
|
|
|
|
|
Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[2], OptionalParameters)
|
|
|
|
|
Chainsaw.AddResult( Mortising)
|
|
|
|
|
-- lavorando dai due lati non c'è materiale residuo - si può eliminare la lavorazione del fondo
|
|
|
|
@@ -383,29 +455,29 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters)
|
|
|
|
|
if ( Blade.Result.Opposite[1].dResidualDepth < 10 * GEO.EPS_SMALL and Proc.MainFaces.LongFaces[1].MainEdges.OppositeEdges[1].dLength > 3 * Blade.Result.Opposite[1].dBladeMarkLength - 10 * GEO.EPS_SMALL) and
|
|
|
|
|
( Blade.Result.Opposite[2].dResidualDepth < 10 * GEO.EPS_SMALL and Proc.MainFaces.LongFaces[1].MainEdges.OppositeEdges[2].dLength > 3 * Blade.Result.Opposite[2].dBladeMarkLength - 10 * GEO.EPS_SMALL) then
|
|
|
|
|
|
|
|
|
|
local OptionalParameters = { sSideToMachine = 'Start', dLengthToMachine = Blade.Result.Opposite[1].dBladeMarkLength, dMaxElev = 0, dExtendAfterTail = dExtendAfterTail}
|
|
|
|
|
local OptionalParameters = { sSideToMachine = 'Start', dLengthToMachine = Blade.Result.Opposite[1].dBladeMarkLength, dExtendAfterTail = dExtendAfterTail}
|
|
|
|
|
Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.OppositeEdges[1], OptionalParameters)
|
|
|
|
|
Chainsaw.AddResult( Mortising)
|
|
|
|
|
OptionalParameters = {}
|
|
|
|
|
OptionalParameters = { sSideToMachine = 'End', dLengthToMachine = Blade.Result.Opposite[2].dBladeMarkLength, dMaxElev = 0, dExtendAfterTail = dExtendAfterTail}
|
|
|
|
|
OptionalParameters = { sSideToMachine = 'End', dLengthToMachine = Blade.Result.Opposite[2].dBladeMarkLength, dExtendAfterTail = dExtendAfterTail}
|
|
|
|
|
Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.OppositeEdges[1], OptionalParameters)
|
|
|
|
|
Chainsaw.AddResult( Mortising)
|
|
|
|
|
if Chainsaw.Result.Opposite[1].dResidualDepth > 10 * GEO.EPS_SMALL or Chainsaw.Result.Opposite[2].dResidualDepth > 10 * GEO.EPS_SMALL then
|
|
|
|
|
Chainsaw.Result.Opposite[1].bIsApplicable = false
|
|
|
|
|
Chainsaw.Result.Opposite[2].bIsApplicable = false
|
|
|
|
|
local OptionalParameters = { bStopAtHalfElevation = true, sSideToMachine = 'Start', dLengthToMachine = Blade.Result.Opposite[1].dBladeMarkLength, dMaxElev = 0, dExtendAfterTail = dExtendAfterTail}
|
|
|
|
|
local OptionalParameters = { bStopAtHalfElevation = true, sSideToMachine = 'Start', dLengthToMachine = Blade.Result.Opposite[1].dBladeMarkLength, dExtendAfterTail = dExtendAfterTail}
|
|
|
|
|
Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.OppositeEdges[1], OptionalParameters)
|
|
|
|
|
Chainsaw.AddResult( Mortising)
|
|
|
|
|
OptionalParameters = {}
|
|
|
|
|
OptionalParameters = { bStopAtHalfElevation = true, sSideToMachine = 'End', dLengthToMachine = Blade.Result.Opposite[1].dBladeMarkLength, dMaxElev = 0, dExtendAfterTail = dExtendAfterTail}
|
|
|
|
|
OptionalParameters = { bStopAtHalfElevation = true, sSideToMachine = 'End', dLengthToMachine = Blade.Result.Opposite[1].dBladeMarkLength, dExtendAfterTail = dExtendAfterTail}
|
|
|
|
|
Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.OppositeEdges[1], OptionalParameters)
|
|
|
|
|
Chainsaw.AddResult( Mortising)
|
|
|
|
|
OptionalParameters = {}
|
|
|
|
|
OptionalParameters = { bStopAtHalfElevation = true, sSideToMachine = 'Start', dLengthToMachine = Blade.Result.Opposite[2].dBladeMarkLength, dMaxElev = 0, dExtendAfterTail = dExtendAfterTail}
|
|
|
|
|
OptionalParameters = { bStopAtHalfElevation = true, sSideToMachine = 'Start', dLengthToMachine = Blade.Result.Opposite[2].dBladeMarkLength, dExtendAfterTail = dExtendAfterTail}
|
|
|
|
|
Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.OppositeEdges[2], OptionalParameters)
|
|
|
|
|
Chainsaw.AddResult( Mortising)
|
|
|
|
|
OptionalParameters = {}
|
|
|
|
|
OptionalParameters = { bStopAtHalfElevation = true, sSideToMachine = 'End', dLengthToMachine = Blade.Result.Opposite[2].dBladeMarkLength, dMaxElev = 0, dExtendAfterTail = dExtendAfterTail}
|
|
|
|
|
OptionalParameters = { bStopAtHalfElevation = true, sSideToMachine = 'End', dLengthToMachine = Blade.Result.Opposite[2].dBladeMarkLength, dExtendAfterTail = dExtendAfterTail}
|
|
|
|
|
Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.OppositeEdges[2], OptionalParameters)
|
|
|
|
|
Chainsaw.AddResult( Mortising)
|
|
|
|
|
end
|
|
|
|
@@ -425,46 +497,32 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
-- sega a catena - aggiunta lavorazioni
|
|
|
|
|
-- sega a catena - lavorazioni raggruppate in unica lista
|
|
|
|
|
Chainsaw.Result.Sorted = MergeResults( Chainsaw.Result)
|
|
|
|
|
-- sega a catena - aggiunta eventuali lavorazioni splittate
|
|
|
|
|
if #vFeatureSplittingPoints > 0 then
|
|
|
|
|
Chainsaw.Result.Sorted = MachiningLib.GetSplitMachinings( Chainsaw.Result.Sorted, vFeatureSplittingPoints, Part)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- tutte le lavorazioni di tutti gli utensili in unica lista
|
|
|
|
|
local Result = {}
|
|
|
|
|
for i = 1, #Blade.Result.Sorted do
|
|
|
|
|
table.insert( Result, Blade.Result.Sorted[i])
|
|
|
|
|
end
|
|
|
|
|
for i = 1, #Chainsaw.Result.Sorted do
|
|
|
|
|
table.insert( Result, Chainsaw.Result.Sorted[i])
|
|
|
|
|
end
|
|
|
|
|
-- ordinamento
|
|
|
|
|
if Strategy.Parameters.bSortBySegment then
|
|
|
|
|
table.sort( Result, SortMachiningsBySegment)
|
|
|
|
|
else
|
|
|
|
|
table.sort( Result, SortMachiningsByTool)
|
|
|
|
|
end
|
|
|
|
|
-- aggiunta lavorazioni per tutti gli utensili
|
|
|
|
|
local nIsApplicableCount = 0
|
|
|
|
|
local dFinalCompletionPercentage = 100
|
|
|
|
|
local bAreAllMachiningsAdded = true
|
|
|
|
|
for i = 1, #Chainsaw.Result.Bottom do
|
|
|
|
|
if Chainsaw.Result.Bottom[i].bIsApplicable then
|
|
|
|
|
nIsApplicableCount = nIsApplicableCount + 1
|
|
|
|
|
if bAddMachining then
|
|
|
|
|
local bIsMachiningAdded = Chainsaw.AddMachiningAllSteps( Proc, Chainsaw.Result.Bottom[i])
|
|
|
|
|
if not bIsMachiningAdded then
|
|
|
|
|
bAreAllMachiningsAdded = false
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
Strategy.Result.sInfo = Strategy.Result.sInfo .. '\n' .. Chainsaw.Result.Bottom[i].sMessage
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
for i = 1, #Chainsaw.Result.Side do
|
|
|
|
|
if Chainsaw.Result.Side[i].bIsApplicable then
|
|
|
|
|
nIsApplicableCount = nIsApplicableCount + 1
|
|
|
|
|
if bAddMachining then
|
|
|
|
|
local bIsMachiningAdded = Chainsaw.AddMachiningAllSteps( Proc, Chainsaw.Result.Side[i])
|
|
|
|
|
if not bIsMachiningAdded then
|
|
|
|
|
bAreAllMachiningsAdded = false
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
Strategy.Result.sInfo = Strategy.Result.sInfo .. '\n' .. Chainsaw.Result.Side[i].sMessage
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
for i = 1, #Chainsaw.Result.Opposite do
|
|
|
|
|
if Chainsaw.Result.Opposite[i].bIsApplicable then
|
|
|
|
|
nIsApplicableCount = nIsApplicableCount + 1
|
|
|
|
|
if bAddMachining then
|
|
|
|
|
local bIsMachiningAdded = Chainsaw.AddMachiningAllSteps( Proc, Chainsaw.Result.Opposite[i])
|
|
|
|
|
if not bIsMachiningAdded then
|
|
|
|
|
bAreAllMachiningsAdded = false
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
Strategy.Result.sInfo = Strategy.Result.sInfo .. '\n' .. Chainsaw.Result.Opposite[i].sMessage
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
local dFinalCompletionPercentage = 100
|
|
|
|
|
bAreAllMachiningsAdded, nIsApplicableCount = AddMachinings( Proc, Result, bAddMachining)
|
|
|
|
|
if nIsApplicableCount > 0 then
|
|
|
|
|
if Mortising.dCompletionPercentage > 100 - 10 * GEO.EPS_SMALL then
|
|
|
|
|
Strategy.Result.sStatus = 'Completed'
|
|
|
|
@@ -476,6 +534,7 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters)
|
|
|
|
|
else
|
|
|
|
|
Strategy.Result.sStatus = 'Not-Applicable'
|
|
|
|
|
end
|
|
|
|
|
-- calcolo risultati
|
|
|
|
|
Strategy.Result.nCompletionIndex = FeatureLib.GetFeatureCompletionIndex( dFinalCompletionPercentage)
|
|
|
|
|
Strategy.Result.nQuality = FeatureLib.GetFeatureQuality( 'Chainsaw')
|
|
|
|
|
local MRRParametersBlade = {
|
|
|
|
|