Piccole modifiche alle strategie

This commit is contained in:
andrea.villa
2025-05-14 16:16:32 +02:00
parent 717dca1089
commit 607a3e61af
4 changed files with 26 additions and 6 deletions
+3
View File
@@ -289,6 +289,7 @@ local function GetBestPocketingStrategy( Proc)
Machining.sTypeMachining = 'Side1'
Strategy.Result.sStatus = 'Completed'
Strategy.Result.nCompletionIndex = FeatureLib.GetFeatureCompletionIndex( 100)
Strategy.Result.nQuality = FeatureLib.GetFeatureQuality( 'RadiusOnCornerLeft')
Strategy.Result.dMRR = Machining[3].dMRR
if Proc.MainFaces.TunnelAddedFaces then
Machining[3].ToolInfo.dResidualDepth = -( Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Faces[1].dElevation + BeamData.MILL_OVERLAP)
@@ -304,6 +305,7 @@ local function GetBestPocketingStrategy( Proc)
Machining.sTypeMachining = 'Side2'
Strategy.Result.sStatus = 'Completed'
Strategy.Result.nCompletionIndex = FeatureLib.GetFeatureCompletionIndex( 100)
Strategy.Result.nQuality = FeatureLib.GetFeatureQuality( 'RadiusOnCornerLeft')
Strategy.Result.dMRR = Machining[4].dMRR
if Proc.MainFaces.TunnelAddedFaces then
Machining[4].ToolInfo.dResidualDepth = -( Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Faces[1].dElevation + BeamData.MILL_OVERLAP)
@@ -322,6 +324,7 @@ local function GetBestPocketingStrategy( Proc)
Machining[3].ToolInfo.dResidualDepth = Machining[3].ToolInfo.dResidualDepth - Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Faces[1].dElevation
Machining[4].ToolInfo.dResidualDepth = -Machining[3].ToolInfo.dResidualDepth - BeamData.MILL_OVERLAP
Strategy.Result.nCompletionIndex = FeatureLib.GetFeatureCompletionIndex( 100)
Strategy.Result.nQuality = FeatureLib.GetFeatureQuality( 'RadiusOnCornerLeft')
Strategy.Result.dMRR = ( Machining[3].dMRR + Machining[4].dMRR) / 2
Machining[1].bIsApplicable = false
Machining[2].bIsApplicable = false
+8 -2
View File
@@ -80,7 +80,7 @@ function GetTenonStrategy( Proc, Part)
if bMachIsOk then
Machining.Milling.bIsApplicable = true
-- calcolo passate necessarie
if Proc.FeatureInfo.dTenonMaxDist > TOOLS[Machining.Milling.ToolInfo.nToolIndex].dDiameter then
if Proc.FeatureInfo.dTenonMaxDist > TOOLS[Machining.Milling.ToolInfo.nToolIndex].dDiameter * 0.8 then
Machining.nMillingPathsNeeded = ceil( Proc.FeatureInfo.dTenonMaxDist / TOOLS[Machining.Milling.ToolInfo.nToolIndex].dSideStep)
else
Machining.nMillingPathsNeeded = 1
@@ -247,8 +247,14 @@ function STR0006.Make( bAddMachining, Proc, Part, CustomParameters)
Strategy.Machining.Milling.nType = MCH_MY.MILLING
Strategy.Machining.Milling.vtToolDirection = Proc.FeatureInfo.vtTenonN
Strategy.Machining.Milling.sDepth = min( -Strategy.Machining.Milling.ToolInfo.dResidualDepth, 0)
Strategy.Machining.Milling.dStartSafetyLength = BeamData.COLL_SIC
Strategy.Machining.Milling.Steps = {}
Strategy.Machining.Milling.Steps.dStep = TOOLS[Strategy.Machining.Milling.ToolInfo.nToolIndex].dStep
-- se servono passate con sovramateriale e lunghezza tenone entro il massimo materiale, si annulla lo step
if Strategy.Machining.nMillingPathsNeeded > 1 and Proc.FeatureInfo.dTenonLength < TOOLS[Strategy.Machining.Milling.ToolInfo.nToolIndex].dMaxMaterial - BeamData.COLL_SIC then
Strategy.Machining.Milling.Steps.dStep = 0
else
Strategy.Machining.Milling.Steps.dStep = TOOLS[Strategy.Machining.Milling.ToolInfo.nToolIndex].dStep
end
Strategy.Machining.Milling.Steps.nStepType = MCH_MILL_ST.ONEWAY
local nNearSide -- +3 = Z+, -3 = Z-
+2 -2
View File
@@ -139,10 +139,10 @@ local function GetArcStrategy( Proc, Part)
elseif Milling.ToolInfo.nToolIndex and Milling2.ToolInfo.nToolIndex then
table.insert( Machining, Milling)
table.insert( Machining, Milling2)
-- se utensile 2 esegue completamente
-- se utensile 1 non completo
elseif Milling.ToolInfo.nToolIndex then
table.insert( Machining, Milling)
-- se utensile 2 esegue completamente
-- se utensile 2 non completo
elseif Milling2.ToolInfo.nToolIndex then
table.insert( Machining, Milling2)
end
+13 -2
View File
@@ -638,16 +638,27 @@ function BLADETOWASTE.Make( ProcOrId, Part, OptionalParameters)
-- tutte le lavorazioni raggruppatee e calcolo area lavorata
local dAreaToMachineTotal = 0
-- TODO SISTEMARE!! A volte la lavorazione risulta completa, ma l'area lavorata è inferipre all'area totale e ritorna lavorazione incompleta (vedi i due casi sotto)
for i = 1, #Machinings1 do
if Machinings1[i].bIsApplicable then
table.insert( Machinings, Machinings1[i])
dAreaToMachineTotal = dAreaToMachineTotal + Machinings1[i].dAreaToMachine
-- TODO controllare come mai nel progetto fiera saomad, pezzo 8 ritorna area lavorata più piccola pur lavorando tutto
if Result1.sStatus == 'Completed' then
dAreaToMachineTotal = dAreaToMachineTotal + EgtSurfArea( idFace1)
else
dAreaToMachineTotal = dAreaToMachineTotal + Machinings1[i].dAreaToMachine
end
end
end
for i = 1, #Machinings2 do
if Machinings2[i].bIsApplicable then
table.insert( Machinings, Machinings2[i])
dAreaToMachineTotal = dAreaToMachineTotal + Machinings2[i].dAreaToMachine
-- TODO controllare come mai nel progetto fiera saomad, pezzo 8 ritorna area lavorata più piccola pur lavorando tutto
if Result2.sStatus == 'Completed' then
dAreaToMachineTotal = dAreaToMachineTotal + EgtSurfArea( idFace2)
else
dAreaToMachineTotal = dAreaToMachineTotal + Machinings2[i].dAreaToMachine
end
end
end