From 3e01fb36b0200e69a4f7b4728f8e0abc6863ed41 Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Mon, 23 Jun 2025 15:36:20 +0200 Subject: [PATCH] Si sceglie lavorazione che utilizza la stessa testa della lavorazione --- LuaLibs/ProcessDtMortise.lua | 4 +++- LuaLibs/ProcessProbing.lua | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/LuaLibs/ProcessDtMortise.lua b/LuaLibs/ProcessDtMortise.lua index 40cfd96..6069f60 100644 --- a/LuaLibs/ProcessDtMortise.lua +++ b/LuaLibs/ProcessDtMortise.lua @@ -274,6 +274,7 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) local dToolDiam = 100 local dMaxMat = 30 local dSideAng = 0 + local sHeadTool = 'H1' local bCW = true local bMillOnAggregate = sMchExt == '_AT' if EgtMdbSetCurrMachining( sMilling) then @@ -283,6 +284,7 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) dToolDiam = max( dToolDiam, 10) dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat dSideAng = EgtTdbGetCurrToolParam( MCH_TP.SIDEANG) or dSideAng + sHeadTool = EgtTdbGetCurrToolParam( MCH_TP.HEAD) local dSpeed = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) or 0 bCW = ( dSpeed >= 0) end @@ -295,7 +297,7 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) end -- tastatura se richiesta - local Info = { vtProbe = vtExtr, ptProbe = ptBC, sType = 'DTMortise', sHead = sMchExt} + local Info = { vtProbe = vtExtr, ptProbe = ptBC, sType = 'DTMortise', sHead = sHeadTool} local bProbeExecuted, sErr = Probe.Make( Proc, nPartId, Info) -- se con tasca, la lavoro (mai in doppio) diff --git a/LuaLibs/ProcessProbing.lua b/LuaLibs/ProcessProbing.lua index b1c48dd..b90cfcd 100644 --- a/LuaLibs/ProcessProbing.lua +++ b/LuaLibs/ProcessProbing.lua @@ -13,10 +13,20 @@ local ML = require( 'MachiningLib') --------------------------------------------------------------------- local function GetProbingMachining( Machinings, sHead) - local sProbeMachining + local sProbeMachining, sHeadTool + + -- TODO questa associazione "testa utensile"-"testa tastatore" dovrebbe essere spostata nella macchina. + -- Non รจ detto che se testa utensile inizia con "H2" allora bisogna prendere lavorazione con "_H2" + + -- se la testa utilizzata dalla lavorazione inizia con H2, dovrebbe essere la seconda testa + if EgtStartsWith( sHead, 'H2') then + sHeadTool = '_H2' + else + sHeadTool = '_H1' + end for i = 1, #Machinings do - if EgtEndsWith( Machinings[i], sHead) then + if EgtEndsWith( Machinings[i].Name, sHeadTool) then sProbeMachining = Machinings[i] return sProbeMachining end