DataWall :

- modifiche per nailing.
This commit is contained in:
Dario Sassi
2021-03-14 15:15:42 +00:00
parent 5f5d24c731
commit 6a5662ae65
3 changed files with 37 additions and 12 deletions
+31 -10
View File
@@ -1,4 +1,4 @@
-- ProcessFreeContour.lua by Egaltech s.r.l. 2021/02/19
-- ProcessFreeContour.lua by Egaltech s.r.l. 2021/03/11
-- Gestione calcolo profilo libero per Pareti
-- Tabella per definizione modulo
@@ -1091,6 +1091,8 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
dMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), EgtTdbGetCurrToolMaxDepth()) or dMaxDepth
end
end
-- se entità singola in parte fatta con lama, non lavoro
if #vFace == 1 and vFace[1].Type ~= 4 then return true end
-- verifico se ciclo chiuso
local bClosed = ( abs( vFace[1].PrevAng) > 0.1)
-- ciclo di inserimento delle fresate sulle facce del contorno in esame
@@ -1191,7 +1193,7 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
local dEal = 0
local OrigI = i
i = i + 1
local j = EgtIf( i <= #vFace, i, EgtIf( bAllType4, nil, 1))
local j = EgtIf( i <= #vFace, i, EgtIf( bAllType4 or not bClosed, nil, 1))
while j and ( ( vFace[j].Type & 1) ~= 0 or vFace[j].Type == 4) and abs( vFace[j].SideAng - vFace[OrigI].SideAng) < 0.1 do
table.insert( vGeom, { Proc.Id, vFace[j].Fac})
dEal = EgtIf( ( vFace[j].Type & 1) ~= 0, vFace[j].Whisk - vFace[j].Len, 0)
@@ -1201,6 +1203,11 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
i = i + 1
j = EgtIf( j + 1 <= #vFace, j + 1, EgtIf( bAllType4 or not bClosed, nil, 1))
end
-- se faccia singola è da fare tutta senza oltrepassare estremi
if #vFace == 1 then
dSal = -dMillDiam / 2
dEal = -dMillDiam / 2
end
-- se non devo scaricare l'angolo
if nConeCut <= 1 then
EgtSetMachiningGeometry( vGeom)
@@ -1470,6 +1477,7 @@ local function AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick)
return false, sErr
end
EgtSetInfo( nMchId, 'Part', Proc.PartId)
local dSpeed = EgtGetMachiningParam( MCH_MP.SPEED)
-- aggiungo geometria
EgtSetMachiningGeometry( { { Proc.Id, vFace[i].Fac}})
-- assegno affondamento
@@ -1485,8 +1493,8 @@ local function AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick)
EgtSetMachiningParam( MCH_MP.INVERT, bInvert)
-- imposto lato di lavoro
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bInvert, MCH_SAW_WS.LEFT, MCH_SAW_WS.RIGHT))
-- lato mandrino sempre a sinistra (rotazione lama oraria)
EgtSetMachiningParam( MCH_MP.HEADSIDE, MCH_SAW_HS.LEFT)
-- lato mandrino ( a sinistra se rotazione CCW, altrimenti a destra)
EgtSetMachiningParam( MCH_MP.HEADSIDE, EgtIf( dSpeed < 0, MCH_SAW_HS.LEFT, MCH_SAW_HS.RIGHT))
-- assegno i dati di attacco (sicurezza solo se angolo interno)
local nLeadIn = MCH_SAW_LI.CENT
if ( not bInvert and ( vFace[i].Type & 1) ~= 0) or ( bInvert and ( vFace[i].Type & 2) ~= 0) then
@@ -1509,9 +1517,15 @@ local function AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick)
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.NONE)
-- eseguo
if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchId, false)
return false, sErr
-- provo a invertire direzione e lato di lavoro
EgtSetMachiningParam( MCH_MP.INVERT, not bInvert)
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( not bInvert, MCH_SAW_WS.LEFT, MCH_SAW_WS.RIGHT))
-- ri-eseguo
if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchId, false)
return false, sErr
end
end
-- se limite lunghezza di taglio e taglio lo supera
if WD.CUT_MAX_LENGTH and vFace[i].Len > WD.CUT_MAX_LENGTH then
@@ -1555,11 +1569,18 @@ local function MakeByCut( Proc, nRawId, b3Raw)
end
if vtExtr:getZ() < 0 then bNegZ = true end
end
-- altezza massima delle facce
local dWidth = 0
for i = 1, Proc.Fct do
local _, _, dFctW = WL.GetFaceHvRefDim( Proc.Id, i - 1)
dWidth = max( dWidth, dFctW)
end
-- lettura parametri (probabile/i parametro/i Q)
local nConeCut = VerifyCornerType( Proc)
-- recupero la lavorazione di taglio con lama e i suoi parametri
local sCutting, dSawDiam, dSawThick, dSawMaxDepth = WM.FindCutting( 'Standard')
-- recupero la lavorazione di taglio con lama e i suoi parametri (dapprima cerco quella che possa tagliare completamente)
local sCutting, dSawDiam, dSawThick, dSawMaxDepth = WM.FindCutting( 'Standard', dWidth)
if not sCutting then
sCutting, dSawDiam, dSawThick, dSawMaxDepth = WM.FindCutting( 'Standard')
local sErr = 'Error : cutting not found in library'
EgtOutLog( sErr)
return false, sErr
@@ -1767,7 +1788,7 @@ local function MakeByNail( Proc, nRawId, b3Raw)
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
end
-- assegno affondamento
EgtSetMachiningParam( MCH_MP.DEPTH, 2)
EgtSetMachiningParam( MCH_MP.DEPTH, 10)
-- assegno lato di lavoro
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.CENTER)
-- eseguo