From e26866aa5d69d2b000f934a8e876af51b9586f87 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 21 Dec 2020 07:24:15 +0000 Subject: [PATCH] DataBeam : - piccole modifiche per PF1250. --- LuaLibs/ProcessDrill.lua | 26 ++++++++++++++------------ LuaLibs/ProcessTenon.lua | 17 +++++++++++------ 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/LuaLibs/ProcessDrill.lua b/LuaLibs/ProcessDrill.lua index 249ab92..81fa925 100644 --- a/LuaLibs/ProcessDrill.lua +++ b/LuaLibs/ProcessDrill.lua @@ -1,4 +1,4 @@ --- ProcessDrill.lua by Egaltech s.r.l. 2020/12/14 +-- ProcessDrill.lua by Egaltech s.r.l. 2020/12/17 -- Gestione calcolo forature per Travi -- Tabella per definizione modulo @@ -110,7 +110,7 @@ function ProcessDrill.Split( Proc, b3Raw) return false end -- recupero la lavorazione - local sDrilling, _, dMaxMat = ML.FindDrilling( dDiam) + local sDrilling, _, dMaxMat = ML.FindDrilling( dDiam, nil, BD.DOWN_HEAD and ( Proc.Down or vtExtr:getZ() < 0.1)) if not sDrilling then dMaxMat = 0 end -- restituisco se va fatto in doppio (solo fori orizzontali) local bHoriz = ( abs( vtExtr:getZ()) < abs( BD.DRILL_VZ_MIN) and @@ -202,28 +202,30 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) dCheckDepth = nil dCheckDepth2 = nil end + -- abilitazione foratura da sotto + local bDrillDown = ( BD.DOWN_HEAD and ( Proc.Down or vtExtr:getZ() < 0.1)) -- primo gruppo di controlli con lunghezza utensile calcolata -- recupero la lavorazione - local sDrilling, nType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth, BD.DOWN_HEAD and Proc.Down) + local sDrilling, nType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth, bDrillDown) if not sDrilling then -- se ho passato altezza di taglio utensile allora rifaccio la ricerca senza passare altezza utensile if dCheckDepth then dCheckDepth = nil - sDrilling, nType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, nil, BD.DOWN_HEAD and Proc.Down) + sDrilling, nType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, nil, bDrillDown) end if not sDrilling then nErrorCode = 1 end end - -- se la lunghezza utensile massima supera il valore limite del BeamData e la componente Z supera i 10 gradi + -- se esiste la lavorazione e la lunghezza utensile massima supera il valore limite del BeamData e la componente Z supera i 10 gradi -- allora ricerco un utensile senza lunghezza massima - if dMaxToolLength > ( BD.MAX_TOOL_LEN_FOR_HOR_MACH or 300) and abs( vtExtr:getZ()) < ( BD.DRILL_VZ_MIN_LONG_TOOL or cos(10)) then + if nErrorCode == 0 and dMaxToolLength > ( BD.MAX_TOOL_LEN_FOR_HOR_MACH or 300) and abs( vtExtr:getZ()) < ( BD.DRILL_VZ_MIN_LONG_TOOL or cos(10)) then -- se non ho passato altezza di taglio utensile allora la lunghezza utensile non è idonea per il taglio if not dCheckDepth then nErrorCode = 2 -- rifaccio ricerca lavorazione senza specificare la profondità (dovrebbe trovare l'utensile più corto) else - sDrilling, nType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam) + sDrilling, nType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, nil, bDrillDown) if not sDrilling then nErrorCode = 1 end @@ -237,26 +239,26 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) -- recupero la lavorazione local sDrilling2, nType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2 if dDepth2 > dDepth + BD.DRILL_OVERLAP then - sDrilling2, nType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2 = ML.FindDrilling( dDiam, dCheckDepth2, BD.DOWN_HEAD and Proc.Down) + sDrilling2, nType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2 = ML.FindDrilling( dDiam, dCheckDepth2, bDrillDown) if not sDrilling2 then -- se ho passato altezza di taglio utensile allora rifaccio la ricerca senza passare altezza utensile if dCheckDepth2 then dCheckDepth2 = nil - sDrilling2, nType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2 = ML.FindDrilling( dDiam, nil, BD.DOWN_HEAD and Proc.Down) + sDrilling2, nType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2 = ML.FindDrilling( dDiam, nil, bDrillDown) end if not sDrilling2 then nErrorCode = 1 end end - -- se la lunghezza utensile massima supera il valore limite del BeamData e la componente Z supera i 10 gradi + -- se esiste la lavorazione e la lunghezza utensile massima supera il valore limite del BeamData e la componente Z supera i 10 gradi -- allora ricerco un utensile senza lunghezza massima - if dMaxToolLength2 > ( BD.MAX_TOOL_LEN_FOR_HOR_MACH or 300) and abs( vtExtr:getZ()) < ( BD.DRILL_VZ_MIN_LONG_TOOL or cos(10)) then + if nErrorCode == 0 and dMaxToolLength2 > ( BD.MAX_TOOL_LEN_FOR_HOR_MACH or 300) and abs( vtExtr:getZ()) < ( BD.DRILL_VZ_MIN_LONG_TOOL or cos(10)) then -- se non ho passato altezza di taglio utensile allora la lunghezza utensile non è idonea per il taglio if not dCheckDepth2 then nErrorCode = 2 -- rifaccio ricerca lavorazione senza specificare la profondità (dovrebbe trovare l'utensile più corto) else - sDrilling2, nType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2 = ML.FindDrilling( dDiam) + sDrilling2, nType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2 = ML.FindDrilling( dDiam, nil, bDrillDown) if not sDrilling2 then nErrorCode = 1 end diff --git a/LuaLibs/ProcessTenon.lua b/LuaLibs/ProcessTenon.lua index 0cb5a4b..bfbd58a 100644 --- a/LuaLibs/ProcessTenon.lua +++ b/LuaLibs/ProcessTenon.lua @@ -1,4 +1,4 @@ --- ProcessTenon.lua by Egaltech s.r.l. 2020/11/06 +-- ProcessTenon.lua by Egaltech s.r.l. 2020/12/17 -- Gestione calcolo tenone per Travi -- Tabella per definizione modulo @@ -170,8 +170,9 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id)) EgtSetInfo( AddId, 'TASKID', Proc.TaskId) -- se pezzo piccolo, in coda e piano inclinato attorno a Z applico svuotatura - if b3Solid:getDimX() < BD.LEN_SHORT_PART and vtExtr:getX() < 0 and abs( vtExtr:getY()) > 0.173 then - local sPocketing = ML.FindPocketing( 'OpenPocket') + if b3Solid:getDimX() < BD.LEN_SHORT_PART and vtExtr:getX() < 0 and abs( vtExtr:getX()) < 0.985 then + local sPockType = EgtIf( vtExtr:getZ() < 0.1 and BD.DOWN_HEAD, 'OpenPocket_H2', 'OpenPocket') + local sPocketing = ML.FindPocketing( sPockType) local dMaxDepth = 100 local dStep = 30 local nSurfStep @@ -222,7 +223,8 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) end end -- recupero la lavorazione - local sMilling = ML.FindMilling( 'Tenon', dTenH) or ML.FindMilling( 'Tenon') + local sMillType = EgtIf( vtExtr:getZ() < 0.1 and BD.DOWN_HEAD, 'Tenon_H2', 'Tenon') + local sMilling = ML.FindMilling( sMillType, dTenH) or ML.FindMilling( sMillType) if not sMilling then local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' milling not found in library' EgtOutLog( sErr) @@ -301,13 +303,16 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) if Proc.Head then local dOffs = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX() if abs( vtN:getY()) < 0.1 and vtN:getZ() > 0.5 then - dOffs = dOffs / 2 + dOffs = 0.5 * dOffs + end + if b3Solid:getDimX() < BD.LEN_SHORT_PART and b3Raw:getDimZ() < BD.VICE_MINH and abs( vtN:getZ()) > 0.575 then + dOffs = 0.2 * dOffs end BL.UpdateHCING( nRawId, dOffs) elseif Proc.Tail then local dOffs = Proc.Box:getMax():getX() - b3Solid:getMin():getX() if abs( vtN:getY()) < 0.1 and vtN:getZ() > 0.5 then - dOffs = dOffs / 2 + dOffs = 0.5 * dOffs end BL.UpdateTCING( nRawId, dOffs) end