From 6a6dc2756053a81cbddfe5e211265ae00f9da80c Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Fri, 20 Jun 2025 17:30:08 +0200 Subject: [PATCH 1/6] Primo commit gestione tastatura --- LuaLibs/MachiningLib.lua | 44 ++++++++++++++++++-------------- LuaLibs/ProcessProbing.lua | 52 ++++++++++++++++++++++++++++++++++++++ Process.lua | 2 +- 3 files changed, 78 insertions(+), 20 deletions(-) create mode 100644 LuaLibs/ProcessProbing.lua diff --git a/LuaLibs/MachiningLib.lua b/LuaLibs/MachiningLib.lua index b8970c3..d69f7f3 100644 --- a/LuaLibs/MachiningLib.lua +++ b/LuaLibs/MachiningLib.lua @@ -30,6 +30,7 @@ local Millings = require( 'MillingData') local Pocketings = require( 'PocketingData') local Sawings = require( 'SawingData') local Drillings = require( 'DrillData') +local Probing = require( 'ProbingData') -- tipo di teste macchina local ONE_HEAD = 1 -- una testa (Fast, One, Turn1T) @@ -196,6 +197,8 @@ function GetMachinings( MachiningType, sType) Machinings = Pocketings elseif MachiningType == MCH_MY.MORTISING then Machinings = Sawings + elseif MachiningType == MCH_MY.PROBING then + Machinings = Probing end -- scrivo i parametri utensile nella lavorazione local validMachinings = {} @@ -208,27 +211,30 @@ function GetMachinings( MachiningType, sType) if Machining.Tool.Name then if EgtTdbSetCurrTool( Machining.Tool.Name) then table.insert( validMachinings, Machining) - if ( MachiningType == MCH_MY.MILLING) or ( MachiningType == MCH_MY.POCKETING) or ( MachiningType == MCH_MY.DRILLING and EgtStartsWith( sType, 'Pocket')) then - Machining.Tool.MaxMat = EgtTdbGetCurrToolMaxDepth() - else - Machining.Tool.MaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) - end - if MachiningType == MCH_MY.DRILLING then - if EgtStartsWith( Machining.Type, 'Drill') then - Machining.SubType = 'Drill' - elseif EgtStartsWith( Machining.Type, 'AngleDrill') then - Machining.SubType = 'AngleDrill' - elseif EgtStartsWith( Machining.Type, 'Pocket') then - Machining.SubType = 'DrillPocket' - elseif EgtStartsWith( Machining.Type, 'Predrill') then - Machining.SubType = 'Predrill' + -- se non è tastatura, recupero dati utensile + if MachiningType ~= MCH_MY.PROBING then + if ( MachiningType == MCH_MY.MILLING) or ( MachiningType == MCH_MY.POCKETING) or ( MachiningType == MCH_MY.DRILLING and EgtStartsWith( sType, 'Pocket')) then + Machining.Tool.MaxMat = EgtTdbGetCurrToolMaxDepth() + else + Machining.Tool.MaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) end + if MachiningType == MCH_MY.DRILLING then + if EgtStartsWith( Machining.Type, 'Drill') then + Machining.SubType = 'Drill' + elseif EgtStartsWith( Machining.Type, 'AngleDrill') then + Machining.SubType = 'AngleDrill' + elseif EgtStartsWith( Machining.Type, 'Pocket') then + Machining.SubType = 'DrillPocket' + elseif EgtStartsWith( Machining.Type, 'Predrill') then + Machining.SubType = 'Predrill' + end + end + Machining.Tool.Diameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM) + Machining.Tool.Length = EgtTdbGetCurrToolParam( MCH_TP.LEN) + Machining.Tool.TotalLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) + Machining.Tool.ToolHolderDiameter = EgtTdbGetCurrToolThDiam() + Machining.Tool.ToolHolderLength = EgtTdbGetCurrToolThLength() or 72 end - Machining.Tool.Diameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM) - Machining.Tool.Length = EgtTdbGetCurrToolParam( MCH_TP.LEN) - Machining.Tool.TotalLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) - Machining.Tool.ToolHolderDiameter = EgtTdbGetCurrToolThDiam() - Machining.Tool.ToolHolderLength = EgtTdbGetCurrToolThLength() or 72 end end end diff --git a/LuaLibs/ProcessProbing.lua b/LuaLibs/ProcessProbing.lua new file mode 100644 index 0000000..f294383 --- /dev/null +++ b/LuaLibs/ProcessProbing.lua @@ -0,0 +1,52 @@ +-- ProcessSplit.lua by Egaltech s.r.l. 2025/06/20 +-- Gestione tastatura + +-- Tabella per definizione modulo +local ProcessProbing = {} + +-- Include +require( 'EgtBase') +local BL = require( 'BeamLib') + +-- Dati +local BD = require( 'BeamData') + +--------------------------------------------------------------------- +local function GetProbingMachining( Machinings, nHead) + local sProbeMachining + + for i = 1, #Machinings do + if EgtEndsWith( Machinings[i], '_H2') then + sProbeMachining = Machinings[i] + break + end + end + + return sProbeMachining +end + +--------------------------------------------------------------------- +-- Applicazione della lavorazione +function ProcessProbing.Make( Proc, nRawId, nPartId, Info) + local bOk, sErr + + -- per eseguire tastatura servono tutti i dati, altriemnti impossibile + if Info.vtProbe and Info.ptProbe and Info.sType then + -- recupero gruppo per geometria addizionale + local nAddGrpId = BL.GetAddGroup( nPartId) + local nIdLine = EgtLinePVL( nAddGrpId, Info.ptProbe, Info.vtProbe, 10) -- TODO lunghezza da portare fuori come parametro + local Machinings = GetMachinings( MCH_MY.PROBING, Info.sType) + local Probing = GetProbingMachining( Machinings, Info.nHead) + -- se c'è la linea e la lavorazione, applico + if Probing and nIdLine then + end + else + bOk = true + sErr = 'Error on probing' + end + + return bOk, sErr +end + +--------------------------------------------------------------------- +return ProcessProbing diff --git a/Process.lua b/Process.lua index ea714f4..51fd56d 100644 --- a/Process.lua +++ b/Process.lua @@ -8,7 +8,7 @@ -- Intestazioni require( 'EgtBase') _ENV = EgtProtectGlobal() -EgtEnableDebug( false) +EgtEnableDebug( true) -- Imposto direttorio libreria specializzata per Travi EgtAddToPackagePath( BEAM.BASEDIR .. '\\LuaLibs\\?.lua') From 8e19e87d3f9172a7b4fef5102a6958c7f2f28f6d Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Mon, 23 Jun 2025 12:15:45 +0200 Subject: [PATCH 2/6] Prima versiomne funzionante tastatura. Manca disattivazione finale --- LuaLibs/BeamExec.lua | 1 + LuaLibs/ProcessDtMortise.lua | 6 ++++ LuaLibs/ProcessProbing.lua | 61 +++++++++++++++++++++++++++++------- 3 files changed, 57 insertions(+), 11 deletions(-) diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index 60afcc9..8efc44b 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -108,6 +108,7 @@ _G.package.loaded.ProcessScarfJoint = nil _G.package.loaded.ProcessSimpleScarf = nil _G.package.loaded.ProcessStepJoint = nil _G.package.loaded.ProcessStepJointNotch = nil +_G.package.loaded.ProcessProbing = nil _G.package.loaded.ProcessProfFront = nil _G.package.loaded.ProcessProfConcave = nil _G.package.loaded.ProcessProfConvex = nil diff --git a/LuaLibs/ProcessDtMortise.lua b/LuaLibs/ProcessDtMortise.lua index ad4e66a..8954ac9 100644 --- a/LuaLibs/ProcessDtMortise.lua +++ b/LuaLibs/ProcessDtMortise.lua @@ -20,6 +20,7 @@ local ProcessDtMortise = {} require( 'EgtBase') local BL = require( 'BeamLib') local Cut = require( 'ProcessCut') +local Probe = require( 'ProcessProbing') EgtOutLog( ' ProcessDtMortise started', 1) @@ -292,6 +293,11 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) EgtOutLog( sErr) return false, sErr end + + -- tastatura se richiesta + local Info = { vtProbe = vtExtr, ptProbe = ptBC, sType = 'DTMortise', sHead = sMchExt} + local bProbeExecuted, sErr = Probe.Make( Proc, nPartId, Info) + -- se con tasca, la lavoro (mai in doppio) if bPocket then -- recupero il contorno della tasca (seconda curva ausiliaria) diff --git a/LuaLibs/ProcessProbing.lua b/LuaLibs/ProcessProbing.lua index f294383..8506203 100644 --- a/LuaLibs/ProcessProbing.lua +++ b/LuaLibs/ProcessProbing.lua @@ -9,39 +9,78 @@ require( 'EgtBase') local BL = require( 'BeamLib') -- Dati -local BD = require( 'BeamData') +local ML = require( 'MachiningLib') --------------------------------------------------------------------- -local function GetProbingMachining( Machinings, nHead) +local function GetProbingMachining( Machinings, sHead) local sProbeMachining for i = 1, #Machinings do - if EgtEndsWith( Machinings[i], '_H2') then + if EgtEndsWith( Machinings[i], sHead) then sProbeMachining = Machinings[i] - break + return sProbeMachining end end - + sProbeMachining = Machinings[1] return sProbeMachining end +--------------------------------------------------------------------- +local function MoveProbePointToRawFaces( ptProbe, vtProbe, nPartId) + local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD) + -- si porta linea di tastatura su grezzo + if AreSameVectorApprox( vtProbe, Z_AX()) then + ptProbe[3] = b3Solid:getMax():getZ() + elseif AreSameVectorApprox( vtProbe, -Z_AX()) then + ptProbe[3] = b3Solid:getMin():getZ() + elseif AreSameVectorApprox( vtProbe, Y_AX()) then + ptProbe[2] = b3Solid:getMax():getY() + elseif AreSameVectorApprox( vtProbe, -Y_AX()) then + ptProbe[2] = b3Solid:getMin():getY() + end + return ptProbe +end + --------------------------------------------------------------------- -- Applicazione della lavorazione -function ProcessProbing.Make( Proc, nRawId, nPartId, Info) +function ProcessProbing.Make( Proc, nPartId, Info) local bOk, sErr -- per eseguire tastatura servono tutti i dati, altriemnti impossibile if Info.vtProbe and Info.ptProbe and Info.sType then + Info.ptProbe = MoveProbePointToRawFaces( Info.ptProbe, Info.vtProbe, nPartId) -- recupero gruppo per geometria addizionale local nAddGrpId = BL.GetAddGroup( nPartId) - local nIdLine = EgtLinePVL( nAddGrpId, Info.ptProbe, Info.vtProbe, 10) -- TODO lunghezza da portare fuori come parametro + local nIdLine = EgtLinePVL( nAddGrpId, Info.ptProbe, Info.vtProbe, 10, GDB_RT.GLOB) -- TODO lunghezza da portare fuori come parametro local Machinings = GetMachinings( MCH_MY.PROBING, Info.sType) - local Probing = GetProbingMachining( Machinings, Info.nHead) - -- se c'è la linea e la lavorazione, applico - if Probing and nIdLine then + -- se c'è almeno una lavorazione, allora devo fare tastatura + if Machinings and #Machinings > 0 then + local sProbing = GetProbingMachining( Machinings, Info.sHead) + -- se c'è la linea e la lavorazione, applico + if sProbing and nIdLine then + local sName = 'DtMtProbe_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) + local nMchFId = EgtAddMachining( sName, sProbing.Name) + -- si inverte la direzione della linea, deve essere entrante, oppostaa vettore estrusione + EgtInvertCurve( nIdLine) + -- aggiungo geometria + EgtSetMachiningGeometry( {{ nIdLine, -1}}) + + -- eseguo + if not ML.ApplyMachining( true, false) then + local _, sErr = EgtGetLastMachMgrError() + EgtSetOperationMode( nMchFId, false) + return false, sErr + end + else + bOk = false + sErr = 'Error on probing' + end + -- altrimenti tastatura non richiesta, esco + else + return true end else - bOk = true + bOk = false sErr = 'Error on probing' end From 9480453e5796dff801eccb08880f6f48ea015a4a Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Mon, 23 Jun 2025 14:53:33 +0200 Subject: [PATCH 3/6] Disattivazione finale e altre modifiche --- LuaLibs/ProcessDtMortise.lua | 6 +++++- LuaLibs/ProcessProbing.lua | 12 +++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/LuaLibs/ProcessDtMortise.lua b/LuaLibs/ProcessDtMortise.lua index 8954ac9..40cfd96 100644 --- a/LuaLibs/ProcessDtMortise.lua +++ b/LuaLibs/ProcessDtMortise.lua @@ -528,7 +528,7 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) end end -- se necessario, imposto SCC - if nSCC then + if nSCC then EgtSetMachiningParam( MCH_MP.SCC, nSCC) end -- dichiaro massima elevazione e assenza sfridi per VMill @@ -545,6 +545,10 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) sUserNotes = EgtSetValInNotes( sUserNotes, 'StartZmax', 2) end end + -- se c'è stata tastatura, si disattiva sull'ultima lavorazione + if bProbeExecuted and i == 1 then + sUserNotes = EgtSetValInNotes( sUserNotes, 'END-PROBE', true) + end EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes) -- eseguo if not ML.ApplyMachining( true, false) then diff --git a/LuaLibs/ProcessProbing.lua b/LuaLibs/ProcessProbing.lua index 8506203..b1c48dd 100644 --- a/LuaLibs/ProcessProbing.lua +++ b/LuaLibs/ProcessProbing.lua @@ -27,16 +27,16 @@ end --------------------------------------------------------------------- local function MoveProbePointToRawFaces( ptProbe, vtProbe, nPartId) - local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD) + local b3BoxPart = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD) -- si porta linea di tastatura su grezzo if AreSameVectorApprox( vtProbe, Z_AX()) then - ptProbe[3] = b3Solid:getMax():getZ() + ptProbe[3] = b3BoxPart:getMax():getZ() elseif AreSameVectorApprox( vtProbe, -Z_AX()) then - ptProbe[3] = b3Solid:getMin():getZ() + ptProbe[3] = b3BoxPart:getMin():getZ() elseif AreSameVectorApprox( vtProbe, Y_AX()) then - ptProbe[2] = b3Solid:getMax():getY() + ptProbe[2] = b3BoxPart:getMax():getY() elseif AreSameVectorApprox( vtProbe, -Y_AX()) then - ptProbe[2] = b3Solid:getMin():getY() + ptProbe[2] = b3BoxPart:getMin():getY() end return ptProbe end @@ -70,6 +70,8 @@ function ProcessProbing.Make( Proc, nPartId, Info) local _, sErr = EgtGetLastMachMgrError() EgtSetOperationMode( nMchFId, false) return false, sErr + else + bOk = true end else bOk = false From 3e01fb36b0200e69a4f7b4728f8e0abc6863ed41 Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Mon, 23 Jun 2025 15:36:20 +0200 Subject: [PATCH 4/6] 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 From 0f536b07c49207bbf6d991bdd326e0964f4472a4 Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Mon, 23 Jun 2025 16:26:39 +0200 Subject: [PATCH 5/6] Aggiornato Compile --- Compile.bat | 1 + Process.lua | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Compile.bat b/Compile.bat index 9e11c86..4091878 100644 --- a/Compile.bat +++ b/Compile.bat @@ -45,6 +45,7 @@ REM Compilazione 32 e 64 bit \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessText.lua -s LuaLibs\ProcessText.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessTyroleanDovetail.lua -s LuaLibs\ProcessTyroleanDovetail.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessVariant.lua -s LuaLibs\ProcessVariant.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessProbing.lua -s LuaLibs\ProcessProbing.lua \EgtProg\Dll32\luac54 -o bin\BatchProcess.lua -s BatchProcess.lua \EgtProg\Dll32\luac54 -o bin\BatchProcessNew.lua -s BatchProcessNew.lua \EgtProg\Dll32\luac54 -o bin\GetBeamData.lua -s GetBeamData.lua diff --git a/Process.lua b/Process.lua index 51fd56d..ea714f4 100644 --- a/Process.lua +++ b/Process.lua @@ -8,7 +8,7 @@ -- Intestazioni require( 'EgtBase') _ENV = EgtProtectGlobal() -EgtEnableDebug( true) +EgtEnableDebug( false) -- Imposto direttorio libreria specializzata per Travi EgtAddToPackagePath( BEAM.BASEDIR .. '\\LuaLibs\\?.lua') From 73c86bd35f93b8c71fb9d74bcffcbff8ff6b216b Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Tue, 24 Jun 2025 10:32:37 +0200 Subject: [PATCH 6/6] =?UTF-8?q?In=20MAchiningLib,=20le=20librerie=20di=20l?= =?UTF-8?q?avorazioni=20chiamate=20con=20pcall=20perch=C3=A8=20non=20?= =?UTF-8?q?=C3=A8=20detto=20che=20siano=20tutte=20presenti?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/MachiningLib.lua | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/LuaLibs/MachiningLib.lua b/LuaLibs/MachiningLib.lua index d69f7f3..768a9fd 100644 --- a/LuaLibs/MachiningLib.lua +++ b/LuaLibs/MachiningLib.lua @@ -25,12 +25,14 @@ EgtOutLog( ' MachiningLib started', 1) -- Dati local BD = require( 'BeamData') -local Cuttings = require( 'CutData') -local Millings = require( 'MillingData') -local Pocketings = require( 'PocketingData') -local Sawings = require( 'SawingData') -local Drillings = require( 'DrillData') -local Probing = require( 'ProbingData') +-- librerie lavorazioni caricate con pcall perchè potrebbero non esserci +local Cuttings, Millings, Pocketings, Sawings, Drillings, Probing +if pcall( require, 'CutData') then Cuttings = require( 'CutData') end +if pcall( require, 'MillingData') then Millings = require( 'MillingData') end +if pcall( require, 'PocketingData') then Pocketings = require( 'PocketingData') end +if pcall( require, 'SawingData') then Sawings = require( 'SawingData') end +if pcall( require, 'DrillData') then Drillings = require( 'DrillData') end +if pcall( require, 'ProbingData') then Probing = require( 'ProbingData') end -- tipo di teste macchina local ONE_HEAD = 1 -- una testa (Fast, One, Turn1T) @@ -185,20 +187,32 @@ end --------------------------------------------------------------------- function GetMachinings( MachiningType, sType) - local Machinings + local Machinings = {} -- leggo le lavorazioni disponibili if MachiningType == MCH_MY.DRILLING then - Machinings = Drillings + if Drillings and type( Drillings) == "table" then + Machinings = Drillings + end elseif MachiningType == MCH_MY.SAWING then - Machinings = Cuttings + if Cuttings and type( Cuttings) == "table" then + Machinings = Cuttings + end elseif MachiningType == MCH_MY.MILLING then - Machinings = Millings + if Millings and type( Millings) == "table" then + Machinings = Millings + end elseif MachiningType == MCH_MY.POCKETING then - Machinings = Pocketings + if Pocketings and type( Pocketings) == "table" then + Machinings = Pocketings + end elseif MachiningType == MCH_MY.MORTISING then - Machinings = Sawings + if Sawings and type( Sawings) == "table" then + Machinings = Sawings + end elseif MachiningType == MCH_MY.PROBING then - Machinings = Probing + if Probing and type( Probing) == "table" then + Machinings = Probing + end end -- scrivo i parametri utensile nella lavorazione local validMachinings = {}