From 7a27212cb84f9760aaa781540edbc8840ab85e0d Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Thu, 22 May 2025 10:48:48 +0200 Subject: [PATCH] =?UTF-8?q?-=20in=20BeamExec.CollectFeatures=20si=20salva?= =?UTF-8?q?=20la=20rotazione=20in=20cui=20=C3=A8=20stata=20costruita=20la?= =?UTF-8?q?=20Proc=20-=20in=20BasicCustomerStrategies=20correzione=20in=20?= =?UTF-8?q?lettura=20Q=20-=20in=20STR0002=20in=20caso=20di=202=20facce=20>?= =?UTF-8?q?=2090=C2=B0=20si=20lavorano=20sempre=20entrambe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/BasicCustomerStrategies.lua | 3 ++- LuaLibs/BeamExec.lua | 5 +++-- Strategies/Standard/STR0002/STR0002.lua | 6 ++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/LuaLibs/BasicCustomerStrategies.lua b/LuaLibs/BasicCustomerStrategies.lua index 28329f3..1e2715f 100644 --- a/LuaLibs/BasicCustomerStrategies.lua +++ b/LuaLibs/BasicCustomerStrategies.lua @@ -698,7 +698,8 @@ local function GetParameters_Essetre( Proc, sStrategyIdToGet) local dDepthChamfer = 0 -- eventuali informazioni da recuperare sulla feature sostituita if Proc.SlaveProcIndexes then - dDepthChamfer = EgtGetInfo( Proc.SlaveProcIndexes or GDB_ID.NULL, 'Q06', 'd') or 0 + local idSlaveProc = PROCESSINGS[Proc.idPart].Rotation[Proc.nCurrentRotation][Proc.SlaveProcIndexes[1]].id + dDepthChamfer = EgtGetInfo( idSlaveProc or GDB_ID.NULL, 'Q06', 'd') or 0 end Parameters = { { sName = 'dDepthChamfer', sValue = dDepthChamfer, sType = 'd'}} end diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index c97ad29..e5505bd 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -599,7 +599,7 @@ local function GetFeatureForcedStrategy( Proc) end ------------------------------------------------------------------------------------------------------------- -local function CollectFeatures( Part) +local function CollectFeatures( Part, dRotIndex) -- recupero le feature local nProcCount = 0 local vProc = {} @@ -620,6 +620,7 @@ local function CollectFeatures( Part) Proc.idPart = Part.id Proc.idRaw = Part.idRaw Proc.nIndexPartInParts = Part.nIndexInParts + Proc.nCurrentRotation = dRotIndex Proc.id = ProcId -- id della feature btl ( se non presente info, si prende id dell'entità geometrica) Proc.idFeature = EgtGetInfo( Proc.id, 'PRID', 's') or Proc.id @@ -1198,7 +1199,7 @@ function BeamExec.GetProcessings( PARTS) -- si calcolano le feature solo se la rotazione può essere presa in considerazione if PARTS[nPart].CombinationList.Rotations[dRotIndex] == 1 then -- recupero le feature di lavorazione della trave - table.insert( vProcRot, CollectFeatures( PARTS[nPart])) + table.insert( vProcRot, CollectFeatures( PARTS[nPart], dRotIndex)) -- recupero informazioni ausiliarie feature e dipendenze tra feature stesse -- TODO le dipendenze cambiano in base alla rotazione del pezzo? probabilmente no diff --git a/Strategies/Standard/STR0002/STR0002.lua b/Strategies/Standard/STR0002/STR0002.lua index ddbbbe4..6f8bd24 100644 --- a/Strategies/Standard/STR0002/STR0002.lua +++ b/Strategies/Standard/STR0002/STR0002.lua @@ -281,8 +281,10 @@ local function GetBestPocketingStrategy( Proc) Machining[1].ToolInfo.dResidualDepth = 0 Machining[3].bIsApplicable = false Machining[4].bIsApplicable = false - -- caso speciale 'DoubleBevel-2-Through' che deve lavorare due facce - if Proc.Topology.sName == 'DoubleBevel-2-Through' and Machining[2].bIsApplicable and Machining[2].ToolInfo.dResidualDepth < 10 * GEO.EPS_SMALL then + -- caso speciale in cui si devono lavorare due facce + if ( Proc.nFct == 2 and Proc.AdjacencyMatrix[1][2] >= -89.9) + and Machining[2].bIsApplicable and Machining[2].ToolInfo.dResidualDepth < 10 * GEO.EPS_SMALL then + Machining.sTypeMachining = 'Bottom2' Strategy.Result.sStatus = 'Completed' Strategy.Result.nCompletionIndex = FeatureLib.GetFeatureCompletionIndex( 100)