DataBeam :
- miglioramenti.
This commit is contained in:
+39
-21
@@ -1,4 +1,4 @@
|
||||
-- ProcessLapJoint.lua by Egaltech s.r.l. 2020/03/19
|
||||
-- ProcessLapJoint.lua by Egaltech s.r.l. 2020/03/20
|
||||
-- Gestione calcolo mezzo-legno per Travi
|
||||
-- 2019/10/08 Agg. gestione OpenPocket.
|
||||
|
||||
@@ -778,12 +778,19 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV
|
||||
end
|
||||
-- recupero i dati dell'utensile
|
||||
local dTDiam = 50
|
||||
local dMaxMat = 0
|
||||
if EgtMdbSetCurrMachining( sMilling) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dTDiam
|
||||
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat
|
||||
end
|
||||
end
|
||||
-- Se massimo materiale utensile è molto inferiore dell'elevazione non faccio la lavorazione e do un warning
|
||||
if dMaxMat > 0 and dMaxMat + 15 < dElev then
|
||||
sWarn = 'Warning in process ' .. tostring( Proc.Id) .. ' ,skipped milling; elevation bigger than max tool depth'
|
||||
return true, sWarn
|
||||
end
|
||||
-- Calcolo uso faccia
|
||||
local nFaceUse = BL.GetNearestParalOpposite( rfFac:getVersZ())
|
||||
-- inserisco la lavorazione di fresatura
|
||||
@@ -1437,6 +1444,7 @@ local function EvaluateQParam( Proc, nRawId, bMakeVertCham, sDephtCham, sOnlyCha
|
||||
end
|
||||
end
|
||||
-- verifico se devo usare lama invece della sega-catena
|
||||
-- 2020-03-20 forzata abilitazione uso lama se parametro Q non è presente
|
||||
if #sUseBlade == 0 or EgtGetInfo( Proc.Id, sUseBlade, 'i') == 1 then
|
||||
bForceUseBlade = true
|
||||
end
|
||||
@@ -2204,12 +2212,23 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId)
|
||||
if nChamfer < 2 then
|
||||
local bSpecial3faces = false
|
||||
-- verifico se sono nel caso in cui la faccia esclusa ha elevazione più alta
|
||||
if not bIsU and bIsL and Proc.Fct <= 3 and nFacInd ~= 0 and nFacInd2 ~= 0 then
|
||||
-- verifico se l'elevazione della faccia 0 è maggiore dell'elevazione delle altre due facce
|
||||
local rfFac0 = EgtSurfTmFacetMinAreaRectangle( Proc.Id, 0, GDB_ID.ROOT)
|
||||
-- in ogni caso a parità di adiacenze la funzione BL.GetFaceWithMostAdj restituisce le facce con minore elevazione
|
||||
-- if not bIsU and bIsL and Proc.Fct <= 3 and nFacInd ~= 0 and nFacInd2 ~= 0 then
|
||||
if not bIsU and bIsL and Proc.Fct <= 3 then
|
||||
-- verifico se l'elevazione della faccia esclusa è maggiore dell'elevazione delle altre due facce
|
||||
local nFaceMaxElev = 0
|
||||
if Proc.Fct == 3 then
|
||||
for i = 1, Proc.Fct do
|
||||
if (i-1) ~= nFacInd and (i-1) ~= nFacInd2 then
|
||||
nFaceMaxElev = (i-1)
|
||||
end
|
||||
end
|
||||
end
|
||||
local rfFac0 = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFaceMaxElev, GDB_ID.ROOT)
|
||||
-- ottengo il box con la normale della faccia 0
|
||||
local bBoxF0 = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, rfFac0)
|
||||
local dElevF0 = bBoxF0:getDimZ()
|
||||
-- se effettivamente l'elevazione della faccia esclusa è maggiore delle altre elevazioni segno il flag per le 3 facce speciali
|
||||
if dElevF0 > dFacElev and dElevF0 > dFacElev2 then
|
||||
bSpecial3faces = true
|
||||
end
|
||||
@@ -2265,11 +2284,11 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId)
|
||||
end
|
||||
end
|
||||
-- provo con contornatura
|
||||
local dDiamTool = 20
|
||||
local dDiamTool = 20
|
||||
if bIsL then
|
||||
local bOk, sErr
|
||||
bOk, sErr, dDiamTool = MakeByMill( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV, dFacElev, true, sMilling, nFacInd2, dFacElev2)
|
||||
if not bOk then return bOk, sErr end
|
||||
bOk, sWarn, dDiamTool = MakeByMill( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV, dFacElev, true, sMilling, nFacInd2, dFacElev2)
|
||||
if not bOk then return bOk, sWarn end
|
||||
else
|
||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' Impossible mill special LapJoint'
|
||||
EgtOutLog( sErr)
|
||||
@@ -2340,7 +2359,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId)
|
||||
-- recupero la lavorazione
|
||||
local nUseRoughTool = 0
|
||||
local sMchFind = 'Pocket'
|
||||
if Proc.Fct < 3 or bIsU then
|
||||
if Proc.Fct < 3 or bIsU or bIsL then
|
||||
sMchFind = 'OpenPocket'
|
||||
-- abilito il truciolatore
|
||||
nUseRoughTool = 1
|
||||
@@ -2363,9 +2382,9 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId)
|
||||
-- se non è possibile allora provo in seguito con lama o segacatena
|
||||
-- o passare subito dalla lavorazione con lama/sega catena
|
||||
if bTrySidePocketAtFirst and Proc.Fct == 3 and bIsU then
|
||||
nOk, sErr = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, 'OpenPocket', true, b3Solid)
|
||||
nOk, sWarn = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, 'OpenPocket', true, b3Solid)
|
||||
if nOk < 0 then
|
||||
return false, sErr
|
||||
return false, sWarn
|
||||
elseif nOk > 0 then
|
||||
bTryWithBlades = false
|
||||
end
|
||||
@@ -2373,7 +2392,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId)
|
||||
end
|
||||
-- Se la svuotatura precedente non è stata fatta provo con le lame
|
||||
if bTryWithBlades then
|
||||
bOk, sErr, sStat = MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV, dFacElev, bForceUseBlade)
|
||||
bOk, sWarn, sStat = MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV, dFacElev, bForceUseBlade)
|
||||
if not bOk and sStat == 'MNF' then
|
||||
sPocketing = ML.FindPocketing( sMchFind, dDiam)
|
||||
if not sPocketing then
|
||||
@@ -2382,11 +2401,11 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId)
|
||||
return false, sErr
|
||||
end
|
||||
else
|
||||
return bOk, sErr
|
||||
return bOk, sWarn
|
||||
end
|
||||
-- altrimenti ho già svuotato dal fianco, esco
|
||||
else
|
||||
return bOk, sErr
|
||||
return bOk, sWarn
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -2398,9 +2417,8 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId)
|
||||
-- va eseguito sulle facce diverse dalla principale
|
||||
for nFacet = 0, 2 do
|
||||
if nFacet ~= nFacInd then
|
||||
local sErr
|
||||
bMadeASbyBld, sErr = MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw)
|
||||
if not bMadeASbyBld then return false, sErr end
|
||||
bMadeASbyBld, sWarn = MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw)
|
||||
if not bMadeASbyBld then return false, sWarn end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -2494,16 +2512,16 @@ local function MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId)
|
||||
table.insert( vAddId, AddId)
|
||||
end
|
||||
-- applico le lavorazioni sulle diverse parti
|
||||
local sWarn
|
||||
for i = 1, #vAddId do
|
||||
local b3Box = EgtGetBBoxGlob( vAddId[i], GDB_BB.STANDARD)
|
||||
local nFct = EgtSurfTmFacetCount( vAddId[i])
|
||||
local AddProc = { Id = vAddId[i], Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Box, Fct = nFct, Flg = Proc.Flg}
|
||||
local bOk, sErr = MakeMoreFaces( AddProc, nPhase, nRawId, nPartId)
|
||||
if not bOk then
|
||||
return bOk, sErr
|
||||
end
|
||||
local bOk, sMyWarn = MakeMoreFaces( AddProc, nPhase, nRawId, nPartId)
|
||||
if not bOk then return bOk, sWarn end
|
||||
if not sWarn then sWarn = sMyWarn end
|
||||
end
|
||||
return true, sErr
|
||||
return true, sWarn
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user