DataBeam :

- correzioni varie.
This commit is contained in:
Dario Sassi
2021-03-22 14:53:55 +00:00
parent 91dd924536
commit acc6cc020b
2 changed files with 26 additions and 26 deletions
+19 -23
View File
@@ -725,7 +725,7 @@ local function MakeOneFaceByMill( Proc, nPhase, nRawId, nPartId)
end
---------------------------------------------------------------------
local function MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId)
local function MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId, bDownHead)
-- recupero l'ingombro del grezzo di appartenenza
local b3Raw = EgtGetRawPartBBox( nRawId)
-- recupero l'ingombro della trave
@@ -742,9 +742,9 @@ local function MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId)
-- verifico il parametro Q per uso fresa
local nUseRM = EgtGetInfo( Proc.Id, Q_USE_MILL, 'i')
if nUseRM and nUseRM == 1 then
sMilling = ML.FindMilling( 'LongSmallCut')
sMilling = ML.FindMilling( 'LongSmallCut' .. EgtIf( bDownHead, '_H2', ''))
else
sMilling = ML.FindMilling( 'BirdsMouth')
sMilling = ML.FindMilling( 'BirdsMouth' .. EgtIf( bDownHead, '_H2', ''))
end
-- recupero la lavorazione
local dTDiam = 0
@@ -770,7 +770,7 @@ local function MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId)
local bFaceOk = {}
bFaceOk[1] = ( vtN[1]:getZ() >= BD.NZ_MINB)
bFaceOk[2] = ( vtN[2]:getZ() >= BD.NZ_MINB)
if not bFaceOk[1] and not bFaceOk[2] then
if not bDownHead and not bFaceOk[1] and not bFaceOk[2] then
local sErr = 'Error : LapJoint from bottom impossible'
EgtOutLog( sErr)
return false, sErr
@@ -2895,16 +2895,14 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
end
-- imposto posizione braccio porta testa
local nSCC
if vtOrtho:getY() < GEO.EPS_SMALL then
if abs( vtOrtho:getX()) < 0.02 and abs( vtOrtho:getY()) > 0.02 then
local bNearTail = ( Proc.Box:getCenter():getX() < b3Solid:getCenter():getX() and Proc.Box:getCenter():getX() - b3Solid:getMin():getX() < 1000)
local bVeryShortPart = ( BD.LEN_VERY_SHORT_PART and b3Solid:getDimX() < BD.LEN_VERY_SHORT_PART)
nSCC = EgtIf( BL.IsPartFinalPhase( nPhase) or ( bNearTail and not bVeryShortPart), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
elseif vtOrtho:getY() < GEO.EPS_SMALL then
nSCC = EgtIf( bInvertMach, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
else
if abs( vtOrtho:getX()) > 0.1 then
nSCC = EgtIf( bInvertMach, MCH_SCC.ADIR_YM, MCH_SCC.ADIR_YP)
else
local bNearTail = ( Proc.Box:getCenter():getX() < b3Solid:getCenter():getX() and Proc.Box:getCenter():getX() - b3Solid:getMin():getX() < 1000)
local bVeryShortPart = ( BD.LEN_VERY_SHORT_PART and b3Solid:getDimX() < BD.LEN_VERY_SHORT_PART)
nSCC = EgtIf( BL.IsPartFinalPhase( nPhase) or ( bNearTail and not bVeryShortPart), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
end
nSCC = EgtIf( bInvertMach, MCH_SCC.ADIR_YM, MCH_SCC.ADIR_YP)
end
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- se tasca aperta, imposto opportuno attacco
@@ -2953,16 +2951,14 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
-- imposto posizione braccio porta testa
local nSCC
if vtOrtho:getY() < GEO.EPS_SMALL then
if abs( vtOrtho:getX()) < 0.02 and abs( vtOrtho:getY()) > 0.02 then
local bNearTail = ( Proc.Box:getCenter():getX() < b3Solid:getCenter():getX() and Proc.Box:getCenter():getX() - b3Solid:getMin():getX() < 1000)
local bVeryShortPart = ( BD.LEN_VERY_SHORT_PART and b3Solid:getDimX() < BD.LEN_VERY_SHORT_PART)
nSCC = EgtIf( BL.IsPartFinalPhase( nPhase) or ( bNearTail and not bVeryShortPart), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
elseif vtOrtho:getY() < GEO.EPS_SMALL then
nSCC = MCH_SCC.ADIR_YP
else
if abs( vtOrtho:getX()) > 0.1 then
nSCC = MCH_SCC.ADIR_YM
else
local bNearTail = ( Proc.Box:getCenter():getX() < b3Solid:getCenter():getX() and Proc.Box:getCenter():getX() - b3Solid:getMin():getX() < 1000)
local bVeryShortPart = ( BD.LEN_VERY_SHORT_PART and b3Solid:getDimX() < BD.LEN_VERY_SHORT_PART)
nSCC = EgtIf( BL.IsPartFinalPhase( nPhase) or ( bNearTail and not bVeryShortPart), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
end
nSCC = MCH_SCC.ADIR_YM
end
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- se tasca aperta, imposto opportuno attacco
@@ -3953,10 +3949,10 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- determino l'angolo tra le facce
local bAdj, _, _, dAng = EgtSurfTmFacetsContact( Proc.Id, 0, 1, GDB_ID.ROOT)
-- se ortogonali e non forzata lama oppure con testa da sotto, con fresa
if ( not bUseBlade and bAdj and abs( dAng + 90) < 1) or bDownHead then
if ( not bUseBlade or bDownHead) and bAdj and abs( dAng + 90) < 1 then
-- se piccole
if ( Proc.Box:getDimX() < MAX_MILL_LIN and ( Proc.Box:getDimZ() < MAX_MILL_LIN or Proc.Box:getDimY() < MAX_MILL_LIN)) then
return MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId)
return MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId, bDownHead)
else
return MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, true)
end
@@ -3987,7 +3983,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
local nOk, sErr = MakeChamfer( Proc, true, nAddGrpId, vtOrtho, b3Solid, nSurfInt, dDepthCham)
if nOk < 0 then return false, sErr end
end
return Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, 'HeadSide')
return Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, 'HeadSide' .. EgtIf( bDownHead, '_H2', ''), true, bDownHead)
end
-- tre o più facce
else
+7 -3
View File
@@ -1,4 +1,4 @@
-- ProcessStepJointNotch.lua by Egaltech s.r.l. 2020/12/01
-- ProcessStepJointNotch.lua by Egaltech s.r.l. 2021/03/21
-- Gestione calcolo tacca a gradino per Travi
-- Tabella per definizione modulo
@@ -264,10 +264,13 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, ptC, vtN,
end
-- recupero i dati dell'utensile
local dTDiam = 50
local bCW = true
if EgtMdbSetCurrMachining( sMilling) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dTDiam
local dSpeed = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) or 0
bCW = ( dSpeed >= 0)
end
end
-- Calcolo uso faccia
@@ -284,8 +287,9 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, ptC, vtN,
EgtSetMachiningGeometry( {{ Proc.Id, (nSmaInd-1)}})
-- imposto uso faccia
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
-- setto inversione del percorso
EgtSetMachiningParam( MCH_MP.INVERT, true)
-- setto inversione del percorso e lato di lavoro
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bCW, true, false))
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bCW, MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT))
-- setto a 0 eventuali offset
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
-- applico gli allungamenti o accorciamenti considerando che la lavorazione è invertita