From 3b59b8f37a70ea72c41b028aa6922755d1edb893 Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Tue, 14 Oct 2025 10:55:57 +0200 Subject: [PATCH] In caso si lasci il codolo, non si considera riduzione pinzaggio testa e coda. --- LuaLibs/MachiningLib.lua | 4 ++-- Strategies/Standard/STR0005/STR0005.lua | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/LuaLibs/MachiningLib.lua b/LuaLibs/MachiningLib.lua index 0f44849..0e32302 100644 --- a/LuaLibs/MachiningLib.lua +++ b/LuaLibs/MachiningLib.lua @@ -1096,8 +1096,8 @@ function MachiningLib.AddOperations( vProc, Part, sRotation) RESULT[MACHININGS[i].Proc.nIndexInResult].ChosenStrategy.sStatus = 'Not-Applicable' RESULT[MACHININGS[i].Proc.nIndexInResult].ChosenStrategy.sApplyInfo = sErr RESULT[MACHININGS[i].Proc.nIndexInResult].ChosenStrategy.nApplyError = nErr - -- si salva ingombro lavorazione attuale e fasi successive - else + -- se non deve essere igniorato, si salva ingombro lavorazione attuale e fasi successive + elseif not MACHININGS[i].AuxiliaryData.bIgnoreNotClampableLength then -- salvo ingombro non pinzabile testa/coda local nCurrRotation = MACHININGS[i].Proc.nIndexRotation local dNotClampHead, dNotClampTail = FeatureLib.GetFeatureRotationNotClampableLengths( MACHININGS[i].Proc, Part, nCurrRotation) diff --git a/Strategies/Standard/STR0005/STR0005.lua b/Strategies/Standard/STR0005/STR0005.lua index 3af108c..0c5e5ac 100644 --- a/Strategies/Standard/STR0005/STR0005.lua +++ b/Strategies/Standard/STR0005/STR0005.lua @@ -56,6 +56,7 @@ function STR0005.Make( bAddMachining, Proc, Part, CustomParameters) Strategy.Result = {} Strategy.Result.sInfo = '' Blade.Result = {} + local AuxiliaryData = { bIgnoreNotClampableLength = false} local dTimeToMachine = 0 local dMRRBlade = 0 local dCompletionPercentage = 0 @@ -108,9 +109,10 @@ function STR0005.Make( bAddMachining, Proc, Part, CustomParameters) if ( Proc.nFct > 2 and bIsFeatureLong) or ( bFeatureHindersClamping and not bDropWaste) or bKeepWasteAttached then - + local BladeKeepWasteResult local OptionalParameters = { dExtendAfterTail = dExtendAfterTail, dStripWidth = Strategy.Parameters.dStripWidth} + AuxiliaryData.bIgnoreNotClampableLength = true Blade.Result, BladeKeepWasteResult = BladeKeepWaste.Make( Proc, Part, OptionalParameters) dTimeToMachine = BladeKeepWasteResult.dTimeToMachine dMRRBlade = BladeKeepWasteResult.dMRR @@ -123,7 +125,8 @@ function STR0005.Make( bAddMachining, Proc, Part, CustomParameters) and Proc.nFct < 3 and not bKeepWasteAttached and not bIsTwoFacesCommonEdgeTooLong then - + + AuxiliaryData.bIgnoreNotClampableLength = false local dMinZTopBlade local dMaxNyTopBlade local BladeToWasteResult @@ -157,6 +160,7 @@ function STR0005.Make( bAddMachining, Proc, Part, CustomParameters) local OptionalParameters = { dExtendAfterTail = dExtendAfterTail, dStripWidth = Strategy.Parameters.dStripWidth, dMillingOffsetFromSide = Strategy.Parameters.dMillingOffsetFromSide } + AuxiliaryData.bIgnoreNotClampableLength = true Blade.Result, BladeKeepWasteResult = BladeKeepWaste.Make( Proc, Part, OptionalParameters) dTimeToMachine = BladeKeepWasteResult.dTimeToMachine dMRRBlade = BladeKeepWasteResult.dMRR @@ -185,7 +189,7 @@ function STR0005.Make( bAddMachining, Proc, Part, CustomParameters) dExtendAfterTail = dExtendAfterTail } Blade.Result, BladeToWasteResult = BladeToWaste.Make( idAddedTmFace, Part, OptionalParameters) - + -- TODO calcolo risultati da aggiornare con funzioni nuove dMRRBladeAddedFace = BladeToWasteResult.dMRR dCompletionPercentageAddedFace = BladeToWasteResult.dCompletionPercentage @@ -205,7 +209,7 @@ function STR0005.Make( bAddMachining, Proc, Part, CustomParameters) if Blade.Result[i].bIsApplicable then nIsApplicableCount = nIsApplicableCount + 1 if bAddMachining then - local bIsMachiningAdded = MachiningLib.AddMachinings( Proc, Blade.Result[i]) + local bIsMachiningAdded = MachiningLib.AddMachinings( Proc, Blade.Result[i], AuxiliaryData) if not bIsMachiningAdded then bAreAllMachiningsAdded = false end