diff --git a/LuaLibs/ProcessProfCamb.lua b/LuaLibs/ProcessProfCamb.lua index 15473e2..7ac52fb 100644 --- a/LuaLibs/ProcessProfCamb.lua +++ b/LuaLibs/ProcessProfCamb.lua @@ -1,8 +1,8 @@ --- ProcessProfCamb.lua by Egaltech s.r.l. 2021/09/15 +-- ProcessProfCamb.lua by Egaltech s.r.l. 2021/10/12 -- Gestione calcolo profilo caudato per Travi -- 2021/05/03 Aggiunta gestione smusso da sopra e sotto per macchina con testa da sotto. -- 2021/06/28 Per macchine con testa sotto, smussi di lato con questa testa se non c'è lav.ne da sopra. --- 2021/09/15 Estesa gestione di testa da sotto, se presente. +-- 2021/10/12 Estesa gestione di testa da sotto, se presente. -- Tabella per definizione modulo local ProcessProfCamb = {} @@ -146,7 +146,7 @@ local function VerifyCham( Proc, AuxId, nRawId, bMakeVertCham, sDephtCham, sOnly nChamfer = nChamfer + 1 -- altrimenti se non ho l'affondamento esco else - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' no chamfer depth' + local sErr = 'Error : no chamfer depth' EgtOutLog( sErr) return -1, dDepth, sErr end @@ -171,16 +171,16 @@ local function VerifyCham( Proc, AuxId, nRawId, bMakeVertCham, sDephtCham, sOnly -- recupero la lavorazione local sMilling, sMilling2 if nChamfer > 0 then - sMilling = ML.FindMilling( 'Mark') + if BD.DOWN_HEAD and abs( vtExtr:getZ()) < 0.1 and BD.DH_MAX_TOP and ( Proc.Box:getMax():getZ() - b3Raw:getMax():getZ()) < BD.DH_MAX_TOP then + sMilling = ML.FindMilling( 'Mark_H2') + if not sMilling then sMilling = ML.FindMilling( 'Mark') end + else + sMilling = ML.FindMilling( 'Mark') + end if not sMilling then - if BD.DOWN_HEAD and abs( vtExtr:getZ()) < 0.1 then - sMilling = ML.FindMilling( 'Mark_H2') - end - if not sMilling then - local sErr = 'Error : chamfer not found in library' - EgtOutLog( sErr) - return -1, 0, sErr - end + local sErr = 'Error : chamfer not found in library' + EgtOutLog( sErr) + return -1, 0, sErr end if BD.DOWN_HEAD and abs( vtExtr:getZ()) > 0.9 then sMilling2 = ML.FindMilling( 'Mark_H2') @@ -204,7 +204,7 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) local Ls = EgtGetFirstNameInGroup( nPartId, 'Box') local b3Solid = EgtGetBBoxGlob( Ls or GDB_ID.NULL, GDB_BB.STANDARD) if not b3Solid then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' part box not found' + local sErr = 'Error : part box not found' EgtOutLog( sErr) return false, sErr end @@ -212,7 +212,7 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') if AuxId then AuxId = AuxId + Proc.Id end if not AuxId or ( EgtGetType( AuxId) & GDB_FY.GEO_CURVE) == 0 then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' missing profile geometry' + local sErr = 'Error : missing profile geometry' EgtOutLog( sErr) return false, sErr end @@ -239,7 +239,7 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) -- recupero gruppo per geometria addizionale local nAddGrpId = BL.GetAddGroup( nPartId) if not nAddGrpId then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' missing AddGroup' + local sErr = 'Error : missing AddGroup' EgtOutLog( sErr) return false, sErr end @@ -331,7 +331,7 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) end local vtOrthoO = Vector3d( vtN) local dVzLimDwnUp = EgtIf( bMillDown, -2, nil) - local bOk, sNameOrErr = BL.MakeOneFaceBySaw( Proc.Id, nLastFacet, sCutting, dToolDiam, vtOrthoO, nil, -((dMillDiam/2)+1), BD.CUT_SIC, 0, 0, 0, nil, b3Raw) + local bOk, sNameOrErr = BL.MakeOneFaceBySaw( Proc.Id, nLastFacet, sCutting, dToolDiam, vtOrthoO, dVzLimDwnUp, -((dMillDiam/2)+1), BD.CUT_SIC, 0, 0, 0, nil, b3Raw) end end -- se devo inserire il chamfer diff --git a/LuaLibs/ProcessProfHead.lua b/LuaLibs/ProcessProfHead.lua index d912947..3adc3ac 100644 --- a/LuaLibs/ProcessProfHead.lua +++ b/LuaLibs/ProcessProfHead.lua @@ -1,7 +1,8 @@ --- ProcessProfHead.lua by Egaltech s.r.l. 2021/06/28 +-- ProcessProfHead.lua by Egaltech s.r.l. 2021/10/12 -- Gestione calcolo profilo di testa per Travi -- 2021/05/03 Aggiunta gestione smusso da sopra e sotto per macchina con testa sotto. -- 2021/06/28 Per macchine con testa sotto, smussi di lato con questa testa se non c'è lav.ne da sopra. +-- 2021/10/12 Estesa gestione di testa da sotto, se presente. -- Tabella per definizione modulo local ProcessProfHead = {} @@ -140,11 +141,11 @@ local function VerifyCham( Proc, AuxId, nRawId, bMakeVertCham, sDephtCham, sOnly if abs( vtExtr:getZ()) > 0.1 then if not bMakeVertCham then if nChamfer == 2 then -- se devo fare solo smusso, genero errore - local sErr = 'Error : not horizontale chamfer' + local sErr = 'Error : not horizontal chamfer' EgtOutLog( sErr) return -1, dDepth, sErr else - local sWarn = 'Warning : skipped not horizontale chamfer' + local sWarn = 'Warning : skipped not horizontal chamfer' EgtOutLog( sWarn) return 0, dDepth end @@ -153,16 +154,16 @@ local function VerifyCham( Proc, AuxId, nRawId, bMakeVertCham, sDephtCham, sOnly -- recupero la lavorazione local sMilling, sMilling2 if nChamfer > 0 then - sMilling = ML.FindMilling( 'Mark') + if BD.DOWN_HEAD and abs( vtExtr:getZ()) < 0.1 and BD.DH_MAX_TOP and ( Proc.Box:getMax():getZ() - b3Raw:getMax():getZ()) < BD.DH_MAX_TOP then + sMilling = ML.FindMilling( 'Mark_H2') + if not sMilling then sMilling = ML.FindMilling( 'Mark') end + else + sMilling = ML.FindMilling( 'Mark') + end if not sMilling then - if BD.DOWN_HEAD and abs( vtExtr:getZ()) < 0.1 then - sMilling = ML.FindMilling( 'Mark_H2') - end - if not sMilling then - local sErr = 'Error : chamfer not found in library' - EgtOutLog( sErr) - return -1, 0, sErr - end + local sErr = 'Error : chamfer not found in library' + EgtOutLog( sErr) + return -1, 0, sErr end if BD.DOWN_HEAD and abs( vtExtr:getZ()) > 0.9 then sMilling2 = ML.FindMilling( 'Mark_H2') @@ -229,6 +230,8 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) elseif vtN:getZ() < -0.1 then nSide = -1 end + -- abilitazione lavorazione da sotto + local bMillDown = ( BD.DOWN_HEAD and nSide == -1) -- verifico se necessari ripassi negli angoli local vAngs = {} for i = 1, Proc.Fct do @@ -392,7 +395,11 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) -- se il chamfer non è esclusivo continuo con le altre lavorazioni if nChamfer < 2 then -- recupero la lavorazione - local sMilling = ML.FindMilling( 'Prof') + local sMillType = 'Prof' + local sMilling = ML.FindMilling( sMillType .. EgtIf( bMillDown, '_H2', '')) + if not sMilling then + sMilling = ML.FindMilling( sMillType) + end if not sMilling then local sErr = 'Error : milling not found in library' EgtOutLog( sErr)