From 1baecd24e529e613d3e3a5cbc857eae30aa70cbb Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Tue, 2 Jun 2020 17:51:48 +0000 Subject: [PATCH] DataBeam : - aggiunta gestione fori aggiuntivi a feature con diametro definito da UserParam di TS3. --- LuaLibs/BeamExec.lua | 10 ++++------ LuaLibs/ProcessDrill.lua | 25 ++++++++++++++++++++++--- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index 4157e25..04d3bbd 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -1,4 +1,4 @@ --- BeamExec.lua by Egaltech s.r.l. 2020/05/25 +-- BeamExec.lua by Egaltech s.r.l. 2020/06/02 -- Libreria esecuzione lavorazioni per Travi -- 2019/07/11 Aggiunta gestione stato rotazione di feature per TS3. -- 2019/09/04 Corretto controllo feature di testa e coda con sovramateriale di testa elevato. @@ -13,6 +13,7 @@ -- 2020/05/16 Gestione rotazione di 90deg. -- 2020/05/21 Correzione rotazione di 90deg (caso DY > DZ). -- 2020/05/25 Correzione rotazione di 90deg dopo scarico su carico. +-- 2020/06/02 Per dati foro si chiama funzione GetData di ProcessDrill (per gestire variazioni di diametro da UserParams). -- Tabella per definizione modulo local BeamExec = {} @@ -348,11 +349,8 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH) table.insert( vProc, Proc) -- se foro if Drill.Identify( Proc) then - -- assegno diametro - Proc.Diam = EgtGetInfo( Proc.Id, 'P12', 'd') or 0 - -- assegno faccia di entrata e uscita (dati tabelle sempre per riferimento) - Proc.Fcs = EgtGetInfo( Proc.Id, 'FCS', 'i') or 0 - Proc.Fce = EgtGetInfo( Proc.Id, 'FCE', 'i') or 0 + -- assegno diametro e facce di ingresso e uscita (dati tabelle sempre per riferimento) + Proc.Diam, Proc.Fcs, Proc.Fce = Drill.GetData( Proc, b3Raw) -- verifico se necessaria seconda lavorazione da parte opposta per foro più lungo della punta if Drill.Split( Proc, b3Raw) then -- aggiorno flag prima parte foro (dati tabelle sempre per riferimento) diff --git a/LuaLibs/ProcessDrill.lua b/LuaLibs/ProcessDrill.lua index fb61c34..8774bf9 100644 --- a/LuaLibs/ProcessDrill.lua +++ b/LuaLibs/ProcessDrill.lua @@ -1,4 +1,4 @@ --- ProcessDrill.lua by Egaltech s.r.l. 2020/05/23 +-- ProcessDrill.lua by Egaltech s.r.l. 2020/06/02 -- Gestione calcolo forature per Travi -- Tabella per definizione modulo @@ -27,7 +27,7 @@ function ProcessDrill.IsHeadFeature( Proc, b3Raw, dCurrOvmH) return false end -- recupero e verifico l'entità foro - local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') or 0 + local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') if AuxId then AuxId = AuxId + Proc.Id end if not AuxId or EgtGetType( AuxId) ~= GDB_TY.CRV_ARC then return false @@ -53,7 +53,7 @@ function ProcessDrill.IsTailFeature( Proc, b3Raw) return false end -- recupero e verifico l'entità foro - local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') or 0 + local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') if AuxId then AuxId = AuxId + Proc.Id end if not AuxId or EgtGetType( AuxId) ~= GDB_TY.CRV_ARC then return false @@ -70,6 +70,25 @@ function ProcessDrill.IsTailFeature( Proc, b3Raw) end end +--------------------------------------------------------------------- +-- Recupero dati foro e adattamento se speciale +function ProcessDrill.GetData( Proc, b3Raw) + -- verifico se foro da adattare + if EgtExistsInfo( Proc.Id, 'DiamUser') then + local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') + if AuxId then AuxId = AuxId + Proc.Id end + if AuxId and EgtGetType( AuxId) == GDB_TY.CRV_ARC and BD.USER_HOLE_DIAM and BD.USER_HOLE_DIAM > 1 then + EgtModifyArcRadius( AuxId, BD.USER_HOLE_DIAM / 2) + end + end + -- recupero diametro + local dDiam = EgtGetInfo( Proc.Id, 'P12', 'd') or 0 + -- recupero faccia di entrata e uscita + local nFcs = EgtGetInfo( Proc.Id, 'FCS', 'i') or 0 + local nFce = EgtGetInfo( Proc.Id, 'FCE', 'i') or 0 + return dDiam, nFcs, nFce +end + --------------------------------------------------------------------- -- Verifica se da lavorare in due metà function ProcessDrill.Split( Proc, b3Raw)