Compare commits

...

54 Commits

Author SHA1 Message Date
luca.mazzoleni e1a5625f18 Merge branch 'release/2.5g3' 2023-07-26 18:26:16 +02:00
luca.mazzoleni 8225bc93d5 update log e versione 2023-07-26 18:26:00 +02:00
luca.mazzoleni 59c9e6d1cd In Freecontour->MakeByCut migliorata la scelta della fresa secondaria in caso non sia disponibile una fresa di lunghezza sufficiente 2023-07-26 16:31:14 +02:00
luca.mazzoleni eae34681f3 In ProcessCut angolo Z minimo ora gestito tramite costante da WallData CUT_VZ_MIN (default -0.5) 2023-07-26 15:11:59 +02:00
luca.mazzoleni 098ef8deaf Merge branch 'release/2.5g2' 2023-07-26 11:39:35 +02:00
luca.mazzoleni 7f10b7219a Merge tag '2.5g2' into develop
Finish Release: 2.5g2
2023-07-26 11:39:35 +02:00
luca.mazzoleni 8cfd505f81 update log e versione 2023-07-26 11:19:26 +02:00
luca.mazzoleni 7f29b951c8 Merge branch 'feature/SideStepOnGroove' into develop 2023-07-25 18:31:11 +02:00
luca.mazzoleni 75d0d7fd13 - piccola correzione alla ricerca utensile SideGroove 2023-07-25 18:30:57 +02:00
luca.mazzoleni 808536a3aa - in LapJoint aggiunte passate laterali per SideGroove, se specificato SIDESTEP nelle note utensile
- piccole correzioni minori
2023-07-25 12:56:22 +02:00
luca.mazzoleni d959e46f50 fix commenti 2023-07-10 15:19:07 +02:00
luca.mazzoleni a156b5d703 in ProcessLapJoint->SideGroove viene ora impedito di lavorare una groove se la testa deve scendere sotto al limite superiore del grezzo 2023-07-10 15:16:01 +02:00
luca.mazzoleni fe26308388 Merge branch 'master' into develop 2023-07-04 11:26:13 +02:00
luca.mazzoleni 9846bf2598 Merge branch 'develop' 2023-07-04 11:26:01 +02:00
luca.mazzoleni d3c43fdec1 update log 2023-07-04 11:25:43 +02:00
luca.mazzoleni cb26d23639 Merge tag '2.5g1' into develop
Finish Release: 2.5g1
2023-07-04 11:23:29 +02:00
luca.mazzoleni 7b991ddc7a Merge branch 'release/2.5g1' 2023-07-04 11:23:28 +02:00
luca.mazzoleni c685b0c4c5 Merge branch 'master' into develop 2023-07-04 11:22:34 +02:00
DarioS 62d1c3cb29 DataWall 2.5g1 :
- sistemazione versione.
2023-07-04 08:53:33 +02:00
DarioS ed05f04de6 Merge branch 'master' of https://gitlab.steamware.net/egaltech/DataWall 2023-07-04 08:49:03 +02:00
DarioS aa341ed2b3 DataWall :
- modifica per posizione default del grezzo (ora assegno 0 per lasciare il compito a WD.GetOrigCorner di macchina).
2023-07-04 08:48:17 +02:00
luca.mazzoleni 18fb6622f5 Merge tag '2.5f3' into develop
Finish Release: 2.5f3
2023-06-30 16:30:34 +02:00
luca.mazzoleni 7f3aba6d1d Merge branch 'release/2.5f3' 2023-06-30 16:30:34 +02:00
luca.mazzoleni abfee0334d update log e versione 2023-06-30 16:28:40 +02:00
luca.mazzoleni e34ac566e1 -In LapJoint aggiunta lettura delle note esistenti dalle lavorazioni per evitare di sovrascriverle
- Alcune piccole correzioni
2023-06-30 16:22:17 +02:00
luca.mazzoleni 9838bc7f31 Merge tag '2.5f2' into develop
Finish Release: 2.5f2
2023-06-28 11:35:36 +02:00
luca.mazzoleni dcc1e5b543 Merge branch 'release/2.5f2' 2023-06-28 11:35:35 +02:00
luca.mazzoleni 01260c7278 update log 2023-06-28 11:34:47 +02:00
luca.mazzoleni f2bdb23f9d Merge branch 'master' into develop 2023-06-28 11:33:58 +02:00
DarioS 1131948d33 DataWall 2.5f2 :
- aggiunte due nuove origini (TN e BN che come X usano WD.NEW_REF), in totale ora sono 8.
2023-06-28 10:50:00 +02:00
luca.mazzoleni be33225242 corretto update log 2023-06-19 18:26:16 +02:00
luca.mazzoleni 2db0e4b8a9 Merge tag '2.5f1' into develop
Finish Release: 2.5f1
2023-06-13 10:01:07 +02:00
luca.mazzoleni 8b3bb67710 Merge branch 'release/2.5f1' 2023-06-13 10:01:07 +02:00
luca.mazzoleni f9f6462dc2 update log e version 2023-06-13 10:00:51 +02:00
luca.mazzoleni 47b3298e89 modifica GetWallData per passare costante BTL_PRIORITY all'interfaccia 2023-06-13 09:55:28 +02:00
luca.mazzoleni 4f1c652dc0 - fix minore per priorità da btl 2023-06-08 15:01:18 +02:00
luca.mazzoleni de9fa79f8a - negli outline con priorità da btl aggiunta la rimozione sfridi per la lavorazione successiva 2023-06-07 18:28:12 +02:00
luca.mazzoleni f6caf21581 Merge branch 'feature/RecessedCounterbore' into develop 2023-06-06 12:57:00 +02:00
luca.mazzoleni b0b8e88c30 - Alcune correzioni minori
- Sistemati commenti
2023-06-06 12:54:35 +02:00
luca.mazzoleni d020fa143c - aggiunta gestione step verticale
- correzioni minori
2023-05-29 18:01:59 +02:00
luca.mazzoleni eeb34638cf - da testare funzionamento corretto
- da implementare step verticali
2023-05-26 18:12:53 +02:00
luca.mazzoleni 7f2d1895a1 Merge branch 'feature/OperationPriorityFromBtl' into develop 2023-05-26 13:03:54 +02:00
luca.mazzoleni 766bd61981 - sistemati commenti
- lettura costante BTL_PRIORITY da WallData
- altre piccole correzioni
2023-05-25 15:58:00 +02:00
luca.mazzoleni 1102a7c23a -aggiunta possibilità di scegliere l'ordine del sorting crescente o decrescente
-manca costante da WD
2023-05-24 17:45:28 +02:00
luca.mazzoleni 358df3cfdb prima versione funzionante completamente 2023-05-24 11:48:51 +02:00
luca.mazzoleni bd0dbbb41c modificata funzioni di sorting per gestire priorità 2023-05-23 18:25:16 +02:00
luca.mazzoleni 2606cf4f13 Merge branch 'develop' into feature/OperationPriorityFromBtl 2023-05-16 16:42:47 +02:00
luca.mazzoleni e63b498902 piccola correzione messaggio 2023-05-16 16:42:32 +02:00
luca.mazzoleni 63a3cfe698 primo implemento ciclo priorità 2023-05-15 13:31:33 +02:00
luca.mazzoleni 78cf115748 update gitignore 2023-05-09 09:02:27 +02:00
luca.mazzoleni ac853fc74c Merge remote-tracking branch 'origin/master' into develop 2023-05-04 12:53:19 +02:00
luca.mazzoleni 1a1d48a2c1 update log modifiche 2023-04-21 10:13:00 +02:00
luca.mazzoleni a05741f7be Merge remote-tracking branch 'origin/master' into develop 2023-04-18 09:00:39 +02:00
luca.mazzoleni d704e899a2 Merge remote-tracking branch 'origin/master' into develop 2023-04-17 10:26:42 +02:00
17 changed files with 427 additions and 204 deletions
+1
View File
@@ -19,3 +19,4 @@
/bin/*.ini /bin/*.ini
/bin/LuaLibs/*.lua /bin/LuaLibs/*.lua
/bin/Images/*.png /bin/Images/*.png
.vscode/settings.json
+1 -1
View File
@@ -245,7 +245,7 @@ if bToProcess then
end end
if #vWall == 0 then if #vWall == 0 then
WALL.ERR = 14 WALL.ERR = 14
WALL.MSG = 'Error no beams in the file : ' .. WALL.FILE WALL.MSG = 'Error no walls in the file : ' .. WALL.FILE
WriteErrToLogFile( WALL.ERR, WALL.MSG) WriteErrToLogFile( WALL.ERR, WALL.MSG)
PostErrView( WALL.ERR, WALL.MSG) PostErrView( WALL.ERR, WALL.MSG)
return return
+1 -1
View File
@@ -230,7 +230,7 @@ if bToProcess then
end end
if #vWall == 0 then if #vWall == 0 then
WALL.ERR = 14 WALL.ERR = 14
WALL.MSG = 'Error no beams in the file : ' .. WALL.FILE WALL.MSG = 'Error no walls in the file : ' .. WALL.FILE
WriteErrToLogFile( WALL.ERR, WALL.MSG) WriteErrToLogFile( WALL.ERR, WALL.MSG)
PostErrView( WALL.ERR, WALL.MSG) PostErrView( WALL.ERR, WALL.MSG)
return return
+1
View File
@@ -43,6 +43,7 @@ GWD.NESTING_CORNER = WD.NESTING_CORNER
GWD.HOR_DRILL_DIAM = WD.HOR_DRILL_DIAM GWD.HOR_DRILL_DIAM = WD.HOR_DRILL_DIAM
GWD.MIN_HEIGHT = WD.MIN_HEIGHT GWD.MIN_HEIGHT = WD.MIN_HEIGHT
GWD.MAX_HEIGHT = WD.MAX_HEIGHT GWD.MAX_HEIGHT = WD.MAX_HEIGHT
GWD.BTL_PRIORITY = WD.BTL_PRIORITY
-- Tutto ok -- Tutto ok
GWD.ERR = 0 GWD.ERR = 0
+14 -2
View File
@@ -1,9 +1,11 @@
-- MachiningLib.lua by Egaltech s.r.l. 2022/01/12 -- MachiningLib.lua by Egaltech s.r.l. 2022/01/12
-- Libreria ricerca lavorazioni per Pareti -- Libreria ricerca lavorazioni per Pareti
-- Tabella per definizione modulo
-- 2023/03/09 Piccola correzione alla SideDepth in FindMilling -- 2023/03/09 Piccola correzione alla SideDepth in FindMilling
-- In FindMilling aggiunta gestione spessore e massimo materiale nel caso di lam -- In FindMilling aggiunta gestione spessore e massimo materiale nel caso di lam
-- 2023/05/25 Aggiunta funzione AddMachining che incapsula EgtAddMachining trascrivendo le priorità btl dalle feature alle lavorazioni.
-- 2023/06/07 Alla funzione AddMachining aggiunta la scrittura dell'info ISOUTLINE alle lavorazioni.
-- Tabella per definizione modulo
local WMachiningLib = {} local WMachiningLib = {}
-- Include -- Include
@@ -180,5 +182,15 @@ function WMachiningLib.FindSurfacing( sType)
end end
end end
-- incapsulo EgtAddMachining e trascrivo alcune informazioni utili nelle note dell'operazione
---------------------------------------------------------------------
function WMachiningLib.AddMachining( Proc, sName, sMachining)
local nMchId, sFinalName = EgtAddMachining( sName, sMachining)
local nPriority = EgtGetInfo( Proc.Id, 'PRIORITY', 'i')
EgtSetInfo( nMchId, 'PRIORITY', nPriority)
EgtSetInfo( nMchId, 'ISOUTLINE', Proc.IsOutline)
return nMchId, sFinalName
end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
return WMachiningLib return WMachiningLib
+4 -3
View File
@@ -1,5 +1,6 @@
-- WProcessCut.lua by Egaltech s.r.l. 2020/11/25 -- WProcessCut.lua by Egaltech s.r.l. 2020/11/25
-- Gestione calcolo taglio di testa o longitudinale per Pareti -- Gestione calcolo taglio di testa o longitudinale per Pareti
-- 2023/07/26 Angolo Z minimo ora gestito tramite costante da WallData CUT_VZ_MIN (default sempre -0.5).
-- Tabella per definizione modulo -- Tabella per definizione modulo
local WPC = {} local WPC = {}
@@ -31,7 +32,7 @@ function WPC.Classify( Proc, b3Raw)
if Proc.Fct ~= 1 then return false end if Proc.Fct ~= 1 then return false end
-- controllo la normale -- controllo la normale
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, 0, GDB_ID.ROOT) local vtN = EgtSurfTmFacetNormVersor( Proc.Id, 0, GDB_ID.ROOT)
if vtN:getZ() < - 0.5 then return false end if vtN:getZ() < ( WD.CUT_VZ_MIN or - 0.5) then return false end
return true return true
end end
@@ -46,7 +47,7 @@ function WPC.FlipClassify( Proc)
local vtNZ = vtN:getZ() local vtNZ = vtN:getZ()
if vtNZ > - GEO.EPS_SMALL then if vtNZ > - GEO.EPS_SMALL then
nFlip0 = 100 nFlip0 = 100
elseif vtNZ < -0.5 then elseif vtNZ < ( WD.CUT_VZ_MIN or - 0.5) then
nFlip0 = 0 nFlip0 = 0
else else
nFlip0 = 50 nFlip0 = 50
@@ -54,7 +55,7 @@ function WPC.FlipClassify( Proc)
if - vtNZ > - GEO.EPS_SMALL then if - vtNZ > - GEO.EPS_SMALL then
nFlip1 = 100 nFlip1 = 100
elseif - vtNZ < -0.5 then elseif - vtNZ < ( WD.CUT_VZ_MIN or - 0.5) then
nFlip1 = 0 nFlip1 = 0
else else
nFlip1 = 50 nFlip1 = 50
+3 -2
View File
@@ -8,6 +8,7 @@
-- 2022/01/29 DS Corretta gestione ingombro portautensili per fori inclinati da sopra. -- 2022/01/29 DS Corretta gestione ingombro portautensili per fori inclinati da sopra.
-- 2022/02/22 ES Aggiunta gestione prefori. -- 2022/02/22 ES Aggiunta gestione prefori.
-- 2022/03/08 DS Vanno accettati fori orizzontali sul bordo anche senza foratori orizzontali speciali. -- 2022/03/08 DS Vanno accettati fori orizzontali sul bordo anche senza foratori orizzontali speciali.
-- 2023/05/25 Funzioni EgtAddMachining sostituite da WM.AddMachining in modo da trascrivere le priorità da btl alle lavorazioni.
-- Tabella per definizione modulo -- Tabella per definizione modulo
local WPD = {} local WPD = {}
@@ -375,7 +376,7 @@ function WPD.Make( Proc, nRawId, b3Raw)
end end
-- inserisco la lavorazione -- inserisco la lavorazione
local sName = EgtIf( sHead == 'H5' or sHead == 'H6', 'LhDrill_', 'Drill_') .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName = EgtIf( sHead == 'H5' or sHead == 'H6', 'LhDrill_', 'Drill_') .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchId = EgtAddMachining( sName, sDrilling) local nMchId = WM.AddMachining( Proc, sName, sDrilling)
if not nMchId then if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sDrilling local sErr = 'Error adding machining ' .. sName .. '-' .. sDrilling
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -505,7 +506,7 @@ function WPD.Make( Proc, nRawId, b3Raw)
-- inserisco la lavorazione -- inserisco la lavorazione
local sName = 'PreDrill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName = 'PreDrill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchId = EgtAddMachining( sName, sDrilling) local nMchId = WM.AddMachining( Proc, sName, sDrilling)
if not nMchId then if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sDrilling local sErr = 'Error adding machining ' .. sName .. '-' .. sDrilling
EgtOutLog( sErr) EgtOutLog( sErr)
+3 -2
View File
@@ -2,6 +2,7 @@
-- Gestione calcolo mortase a coda di rondine per Pareti -- Gestione calcolo mortase a coda di rondine per Pareti
-- Tabella per definizione modulo -- Tabella per definizione modulo
-- 2023/05/25 Funzioni EgtAddMachining sostituite da WM.AddMachining in modo da trascrivere le priorità da btl alle lavorazioni.
local WPDM= {} local WPDM= {}
-- Include -- Include
@@ -159,7 +160,7 @@ function WPDM.Make( Proc, nRawId, b3Raw)
end end
-- inserisco la lavorazione di svuotatura -- inserisco la lavorazione di svuotatura
local sName = 'DtMtPck_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName = 'DtMtPck_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sName, sPocketing) local nMchFId = WM.AddMachining( Proc, sName, sPocketing)
if not nMchFId then if not nMchFId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -189,7 +190,7 @@ function WPDM.Make( Proc, nRawId, b3Raw)
for i = nPass, 1, -1 do for i = nPass, 1, -1 do
-- inserisco la lavorazione di contornatura -- inserisco la lavorazione di contornatura
local sNameF = 'DtMt_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( nPass) local sNameF = 'DtMt_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( nPass)
local nMchFId = EgtAddMachining( sNameF, sMilling) local nMchFId = WM.AddMachining( Proc, sNameF, sMilling)
if not nMchFId then if not nMchFId then
local sErr = 'Error adding machining ' .. sNameF .. '-' .. sMilling local sErr = 'Error adding machining ' .. sNameF .. '-' .. sMilling
EgtOutLog( sErr) EgtOutLog( sErr)
+56 -15
View File
@@ -18,6 +18,9 @@
-- 2023/03/08 In lavorazione con fresa, se imposto Tool_ID non si controlla più possa lavorare di testa. -- 2023/03/08 In lavorazione con fresa, se imposto Tool_ID non si controlla più possa lavorare di testa.
-- 2023/04/14 Aggiunta pulitura spigoli Q05=1 anche su sole fresature. -- 2023/04/14 Aggiunta pulitura spigoli Q05=1 anche su sole fresature.
-- 2023/04/17 Lavorazione CleanCorner sempre forzata con lato di lavoro in centro. -- 2023/04/17 Lavorazione CleanCorner sempre forzata con lato di lavoro in centro.
-- 2023/05/25 Funzioni EgtAddMachining sostituite da WM.AddMachining in modo da trascrivere le priorità da btl alle lavorazioni.
-- 2023/06/06 Aggiunta gestione lavorazione per lamatura speciale affondata con Tool_ID specifico.
-- 2023/07/26 In MakeByCut migliorata la scelta della fresa secondaria nel caso non sia disponibile una fresa di lunghezza sufficiente.
-- Tabella per definizione modulo -- Tabella per definizione modulo
local WPF = {} local WPF = {}
@@ -66,6 +69,7 @@ function WPF.Classify( Proc, b3Raw)
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
-- recupero il tipo di lavorazione -- recupero il tipo di lavorazione
local nCntType = EgtGetInfo( Proc.Id, 'CNT_TYPE', 'i') or 0 local nCntType = EgtGetInfo( Proc.Id, 'CNT_TYPE', 'i') or 0
local nTool_ID = EgtGetInfo( Proc.Id, 'CNT_DATA', 'i')
-- se tasca -- se tasca
if bPocket then if bPocket then
-- cerco la faccia di fondo della superfice (deve avere direzione circa quella di estrusione della curva) -- cerco la faccia di fondo della superfice (deve avere direzione circa quella di estrusione della curva)
@@ -86,10 +90,10 @@ function WPF.Classify( Proc, b3Raw)
-- se penna o chiodatura va sempre bene (vengono sempre riportati sopra) -- se penna o chiodatura va sempre bene (vengono sempre riportati sopra)
elseif nCntType == 10 or nCntType == 20 then elseif nCntType == 10 or nCntType == 20 then
return true return true
-- se altrimenti profilo verticale che non interessa tutta la sezione -- se altrimenti profilo verticale che non interessa tutta la sezione e non caso speciale con lamatura affondata
elseif Proc.Box:getMax():getZ() < b3Raw:getMax():getZ() - 2 then elseif ( Proc.Box:getMax():getZ() < b3Raw:getMax():getZ() - 2) and ( not nTool_ID or ( nTool_ID ~= ( WD.RECESSED_COUNTERBORE_TOOLID or 0)) or ( not EgtCurveIsACircle( AuxId))) then
return false return false
-- altrimenti è profilo verticale che interessa tutta la sezione -- altrimenti è profilo verticale che interessa tutta la sezione o caso speciale con lamatura affondata
else else
return true return true
end end
@@ -1017,7 +1021,7 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
end end
-- inserisco la lavorazione -- inserisco la lavorazione
local sName = 'Clean_' .. ( EgtGetName( nNewProc) or tostring( nNewProc)) local sName = 'Clean_' .. ( EgtGetName( nNewProc) or tostring( nNewProc))
local nMchId = EgtAddMachining( sName, sMilling) local nMchId = WM.AddMachining( nNewProc, sName, sMilling)
if not nMchId then if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -1312,7 +1316,7 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
if ( vFace[i].Type & 1) ~= 0 and ( not j or vFace[j].Type == 0 or vFace[j].Type == 1 or abs( vFace[i].SideAng) > 0.1 or abs( vFace[j].SideAng) > 0.1) then if ( vFace[i].Type & 1) ~= 0 and ( not j or vFace[j].Type == 0 or vFace[j].Type == 1 or abs( vFace[i].SideAng) > 0.1 or abs( vFace[j].SideAng) > 0.1) then
-- inserisco la lavorazione -- inserisco la lavorazione
local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId))
local nMchId = EgtAddMachining( sName, sMilling) local nMchId = WM.AddMachining( Proc, sName, sMilling)
if not nMchId then if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -1406,7 +1410,7 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
if ( vFace[i].Type & 2) ~= 0 or ( vFace[i].Type == 4 and ( vFace[i].Edges > 3 and not vFace[i].Is3EdgesApprox)) then if ( vFace[i].Type & 2) ~= 0 or ( vFace[i].Type == 4 and ( vFace[i].Edges > 3 and not vFace[i].Is3EdgesApprox)) then
-- inserisco la lavorazione -- inserisco la lavorazione
local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId))
local nMchId = EgtAddMachining( sName, sMilling) local nMchId = WM.AddMachining( Proc, sName, sMilling)
if not nMchId then if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -1607,7 +1611,7 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
if vFace[i].Split then if vFace[i].Split then
-- inserisco la lavorazione -- inserisco la lavorazione
local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) .. '_M' local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) .. '_M'
local nMchId = EgtAddMachining( sName, sMilling) local nMchId = WM.AddMachining( Proc, sName, sMilling)
if not nMchId then if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -1698,7 +1702,7 @@ local function AddSawings( sSawing, vFace, Proc, nRawId, b3Raw)
if ( vFace[i].Type & 1) ~= 0 then if ( vFace[i].Type & 1) ~= 0 then
-- inserisco la lavorazione -- inserisco la lavorazione
local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId))
local nMchId = EgtAddMachining( sName, sSawing) local nMchId = WM.AddMachining( Proc, sName, sSawing)
if not nMchId then if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sSawing local sErr = 'Error adding machining ' .. sName .. '-' .. sSawing
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -1746,7 +1750,7 @@ local function AddSawings( sSawing, vFace, Proc, nRawId, b3Raw)
if ( vFace[i].Type & 2) ~= 0 or ( vFace[i].Type == 4 and ( vFace[i].Edges > 3 and not vFace[i].Is3EdgesApprox) and vFace[i].Len > dSawDiam + 1) then if ( vFace[i].Type & 2) ~= 0 or ( vFace[i].Type == 4 and ( vFace[i].Edges > 3 and not vFace[i].Is3EdgesApprox) and vFace[i].Len > dSawDiam + 1) then
-- inserisco la lavorazione -- inserisco la lavorazione
local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId))
local nMchId = EgtAddMachining( sName, sSawing) local nMchId = WM.AddMachining( Proc, sName, sSawing)
if not nMchId then if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sSawing local sErr = 'Error adding machining ' .. sName .. '-' .. sSawing
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -1817,7 +1821,7 @@ local function AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick)
local h = EgtIf( i > 1, i - 1, EgtIf( bClosed, #vFace, nil)) local h = EgtIf( i > 1, i - 1, EgtIf( bClosed, #vFace, nil))
-- inserisco la lavorazione -- inserisco la lavorazione
local sName = 'Cut_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) .. '_' .. tostring( i) local sName = 'Cut_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) .. '_' .. tostring( i)
local nMchId = EgtAddMachining( sName, sCutting) local nMchId = WM.AddMachining( Proc, sName, sCutting)
if not nMchId then if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sCutting local sErr = 'Error adding machining ' .. sName .. '-' .. sCutting
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -1996,7 +2000,13 @@ local function MakeByCut( Proc, nRawId, b3Raw)
local sMilling, dMillMaxDepth = WM.FindMilling( 'FreeContour', dMaxWidth + WD.CUT_EXTRA, nil, nil, nil, nil, true) local sMilling, dMillMaxDepth = WM.FindMilling( 'FreeContour', dMaxWidth + WD.CUT_EXTRA, nil, nil, nil, nil, true)
local sMilling2 = WM.FindMilling( 'FreeContour', nil, nil, nil, nil, nil, true) local sMilling2 = WM.FindMilling( 'FreeContour', nil, nil, nil, nil, nil, true)
if not sMilling and ( not sSawing or bSlanting) then if not sMilling and ( not sSawing or bSlanting) then
sMilling = sMilling2 -- se non trovo una fresa di lunghezza sufficiente, prendo la più lunga disponibile
local sMillingMaxLength = WM.FindMilling( 'FreeContour', 0.8 * ( dMaxWidth + WD.CUT_EXTRA), nil, nil, nil, nil, true) or
WM.FindMilling( 'FreeContour', 0.6 * ( dMaxWidth + WD.CUT_EXTRA), nil, nil, nil, nil, true) or
WM.FindMilling( 'FreeContour', 0.4 * ( dMaxWidth + WD.CUT_EXTRA), nil, nil, nil, nil, true) or
WM.FindMilling( 'FreeContour', 0.2 * ( dMaxWidth + WD.CUT_EXTRA), nil, nil, nil, nil, true) or
WM.FindMilling( 'FreeContour', nil, nil, nil, nil, nil, true)
sMilling = sMillingMaxLength
if not sMilling then if not sMilling then
local sErr = 'Error : milling not found in library' local sErr = 'Error : milling not found in library'
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -2157,7 +2167,7 @@ local function MakeByMill( Proc, nRawId, b3Raw)
end end
-- inserisco la lavorazione -- inserisco la lavorazione
local sName = 'Free_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName = 'Free_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchId = EgtAddMachining( sName, sMilling) local nMchId = WM.AddMachining( Proc, sName, sMilling)
if not nMchId then if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -2184,6 +2194,37 @@ local function MakeByMill( Proc, nRawId, b3Raw)
elseif ( Proc.Grp == 3 and bToolInv) or ( Proc.Grp == 4 and not bToolInv) then elseif ( Proc.Grp == 3 and bToolInv) or ( Proc.Grp == 4 and not bToolInv) then
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
end end
-- se lamatura affondata speciale, setto attacco e stacco al centro
local bIsRecessedCounterBore = ( Proc.Box:getMax():getZ() < b3Raw:getMax():getZ() + 10 * GEO.EPS_SMALL) and
( nTool_ID == WD.RECESSED_COUNTERBORE_TOOLID or 0) and
( EgtCurveIsACircle( AuxId))
if bIsRecessedCounterBore then
local _, _, _, dContourRadius = EgtCurveIsACircle( AuxId)
-- setto attacco
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.TANGENT)
EgtSetMachiningParam( MCH_MP.STARTADDLEN, 0)
EgtSetMachiningParam( MCH_MP.LITANG, 0)
EgtSetMachiningParam( MCH_MP.LIPERP, dContourRadius - 0.5 * dMillDiam)
EgtSetMachiningParam( MCH_MP.LIELEV, 0)
-- setto stacco
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.LINEAR)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 0)
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
EgtSetMachiningParam( MCH_MP.LOPERP, dContourRadius - 0.5 * dMillDiam)
EgtSetMachiningParam( MCH_MP.LOELEV, 0)
-- imposto step
local dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or 0
local dStep = EgtGetMachiningParam( MCH_MP.STEP)
if dStep < GEO.EPS_SMALL then dStep = 0.75 * dMaxMat end
local nStep = ceil( ( dDepth - dMaxMat) / dStep)
dStep = max( ( dDepth - dMaxMat) / max( nStep, 1), 0)
local dMaxElev = max( ( nStep + 1) * dStep - GEO.EPS_SMALL, 0)
EgtSetMachiningParam( MCH_MP.STEP, dStep)
-- imposto elevazione e forzo attacco dal lato aperto
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMaxElev, 1) .. ';OutRaw=3;')
end
-- posizione braccio porta testa -- posizione braccio porta testa
local nSCC = MCH_SCC.ADIR_ZP local nSCC = MCH_SCC.ADIR_ZP
if AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then if AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then
@@ -2259,7 +2300,7 @@ local function MakeByMark( Proc, nRawId, b3Raw)
end end
-- inserisco la lavorazione -- inserisco la lavorazione
local sName = 'FreeMark_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName = 'FreeMark_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchId = EgtAddMachining( sName, sMilling) local nMchId = WM.AddMachining( Proc, sName, sMilling)
if not nMchId then if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -2324,7 +2365,7 @@ local function MakeByNail( Proc, nRawId, b3Raw)
end end
-- inserisco la lavorazione -- inserisco la lavorazione
local sName = 'Nail_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName = 'Nail_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchId = EgtAddMachining( sName, sNailing) local nMchId = WM.AddMachining( Proc, sName, sNailing)
if not nMchId then if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sNailing local sErr = 'Error adding machining ' .. sName .. '-' .. sNailing
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -2463,7 +2504,7 @@ local function MakeByPocket( Proc, nRawId, b3Raw)
end end
-- inserisco la lavorazione di svuotatura -- inserisco la lavorazione di svuotatura
local sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sName, sPocketing) local nMchFId = WM.AddMachining( Proc, sName, sPocketing)
if not nMchFId then if not nMchFId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing
EgtOutLog( sErr) EgtOutLog( sErr)
+193 -135
View File
@@ -20,6 +20,10 @@
-- 2023/04/15 Corretta scelta tipo lavorazione 'SideGroove' aggiungendo massimo spessore. -- 2023/04/15 Corretta scelta tipo lavorazione 'SideGroove' aggiungendo massimo spessore.
-- 2023/04/17 Sistemata gestione parametri Q, eliminando quello non usato di forzatura lama e abilitandoli anche per DoubleCut. -- 2023/04/17 Sistemata gestione parametri Q, eliminando quello non usato di forzatura lama e abilitandoli anche per DoubleCut.
-- Lavorazione CleanCorner sempre forzata con lato di lavoro in centro. -- Lavorazione CleanCorner sempre forzata con lato di lavoro in centro.
-- 2023/05/25 Funzioni EgtAddMachining sostituite da WM.AddMachining in modo da trascrivere le priorità da btl alle lavorazioni.
-- 2023/06/30 Aggiunta lettura delle note esistenti dalle lavorazioni per evitare di sovrascriverle.
-- 2023/07/10 In MakeSideGrooveByMill si impedisce ora di lavorare una groove se la testa deve scendere sotto al limite superiore del grezzo.
-- 2023/07/25 Aggiunte passate laterali per SideGroove, se specificato SIDESTEP nelle note utensile.
-- Tabella per definizione modulo -- Tabella per definizione modulo
local WPL = {} local WPL = {}
@@ -810,7 +814,7 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
-- riordino le facce -- riordino le facce
nNewProcLoc = ReorderFacesFromTab( nNewProcLoc, vFace) nNewProcLoc = ReorderFacesFromTab( nNewProcLoc, vFace)
-- acquisisco il numero della faccia -- acquisisco il numero della faccia
nFacCnt = EgtSurfTmFacetCount( nNewProcLoc) local nFacCnt = EgtSurfTmFacetCount( nNewProcLoc)
nFacInd = nFacCnt - 1 nFacInd = nFacCnt - 1
else else
local sErr = 'Cannot make local bottom surface' local sErr = 'Cannot make local bottom surface'
@@ -984,7 +988,7 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
end end
-- inserisco la lavorazione -- inserisco la lavorazione
local sName = 'Clean_' .. ( EgtGetName( nNewProc) or tostring( nNewProc)) local sName = 'Clean_' .. ( EgtGetName( nNewProc) or tostring( nNewProc))
local nMchId = EgtAddMachining( sName, sMilling) local nMchId = WM.AddMachining( nNewProc, sName, sMilling)
if not nMchId then if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -1012,10 +1016,13 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
EgtSetMachiningParam( MCH_MP.DEPTH, 0) EgtSetMachiningParam( MCH_MP.DEPTH, 0)
-- forzo lato correzione a centrato -- forzo lato correzione a centrato
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.CENTER) EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.CENTER)
-- leggo eventuali note esistenti della lavorazione
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill -- Note utente con dichiarazione nessuna generazione sfridi per Vmill
local sUserNotes = 'VMRS=0;' sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
-- aggiungo alle note massima elevazione -- aggiungo alle note massima elevazione
sUserNotes = sUserNotes .. 'MaxElev=' .. EgtNumToString( 0.0, 1) .. ';' sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( 0.0, 1))
-- scrivo le note della lavorazione
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes) EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
if not EgtApplyMachining( true, false) then if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
@@ -1275,7 +1282,7 @@ local function MakeByChainSaw( Proc, nFacet, nRawId, b3Raw, dElev, dH, dV)
for i = 1, nStep do for i = 1, nStep do
-- Applico la lavorazione con sega a catena a questa faccia -- Applico la lavorazione con sega a catena a questa faccia
local sName = 'Csaw_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( i) local sName = 'Csaw_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( i)
local nMchFId = EgtAddMachining( sName, sSawing) local nMchFId = WM.AddMachining( Proc, sName, sSawing)
if not nMchFId then if not nMchFId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sSawing local sErr = 'Error adding machining ' .. sName .. '-' .. sSawing
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -1301,13 +1308,16 @@ local function MakeByChainSaw( Proc, nFacet, nRawId, b3Raw, dElev, dH, dV)
-- se necessario, limito l'affondamento -- se necessario, limito l'affondamento
if dElev > dMaxDepth + 10 * GEO.EPS_SMALL then if dElev > dMaxDepth + 10 * GEO.EPS_SMALL then
sWarn = 'Warning in LapJoint : elevation (' .. EgtNumToString( dElev, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth, 1) .. ')' sWarn = 'Warning in LapJoint : elevation (' .. EgtNumToString( dElev, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth, 1) .. ')'
dDepth = dMaxDepth - dElev local dDepth = dMaxDepth - dElev
EgtOutLog( sWarn) EgtOutLog( sWarn)
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH '..EgtNumToString( dDepth, 1)) EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH '..EgtNumToString( dDepth, 1))
end end
-- leggo eventuali note esistenti della lavorazione
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
-- imposto elevazione -- imposto elevazione
local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 2) .. ';' sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dElev, 2))
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes) -- scrivo le note della lavorazione
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- eseguo -- eseguo
if not EgtApplyMachining( true, false) then if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
@@ -1362,7 +1372,7 @@ local function MakeByMill( Proc, nFacet, nOthFac, nRawId, b3Raw, dSideDist)
end end
-- inserisco la lavorazione di contornatura -- inserisco la lavorazione di contornatura
local sName = 'Mill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName = 'Mill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sName, sMilling) local nMchFId = WM.AddMachining( Proc, sName, sMilling)
if not nMchFId then if not nMchFId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -1435,6 +1445,8 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
EgtOutLog( sErr) EgtOutLog( sErr)
return false, sErr return false, sErr
end end
local dGrooveMinZ = max( b3Raw:getMin():getZ(), Proc.Box:getMin():getZ())
local dRawMaxZ = b3Raw:getMax():getZ()
-- recupero i dati dell'utensile -- recupero i dati dell'utensile
local dMillDiam = 20 local dMillDiam = 20
local dMillLen = 10 local dMillLen = 10
@@ -1443,6 +1455,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
local dMillDiamTh = 999 local dMillDiamTh = 999
local dMillDiamThStem = 0 local dMillDiamThStem = 0
local dMillLenTh = 0 local dMillLenTh = 0
local dSideStep = 0
if EgtMdbSetCurrMachining( sMilling) then if EgtMdbSetCurrMachining( sMilling) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
@@ -1453,6 +1466,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
dMillDiamTh = EgtTdbGetCurrToolThDiam() or dMillDiamTh dMillDiamTh = EgtTdbGetCurrToolThDiam() or dMillDiamTh
dMillDiamThStem = EgtTdbGetCurrToolParam( MCH_TP.STEMDIAM) or dMillDiamThStem dMillDiamThStem = EgtTdbGetCurrToolParam( MCH_TP.STEMDIAM) or dMillDiamThStem
dMillLenTh = EgtTdbGetCurrToolThLength() or dMillLenTh dMillLenTh = EgtTdbGetCurrToolThLength() or dMillLenTh
dSideStep = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDESTEP', 'd') or dSideStep
if ( EgtTdbGetCurrToolParam( MCH_TP.TYPE) & MCH_TF.SAWBLADE) ~= 0 then if ( EgtTdbGetCurrToolParam( MCH_TP.TYPE) & MCH_TF.SAWBLADE) ~= 0 then
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dMaxMat dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dMaxMat
if not dMaxDepthOnSide or dMaxDepthOnSide < 0.1 then if not dMaxDepthOnSide or dMaxDepthOnSide < 0.1 then
@@ -1464,8 +1478,6 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
dMaxDepthOnSide = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDEDEPTH', 'd') dMaxDepthOnSide = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDEDEPTH', 'd')
end end
end end
local dGrooveMinZ = max( b3Raw:getMin():getZ(), Proc.Box:getMin():getZ())
local dRawMaxZ = b3Raw:getMax():getZ()
-- se riesco a lavorare il sottosquadro senza arrivare alla parte larga del portautensile uso la sidedepth o il diametro stretto del portautensile come diametro del gambo -- se riesco a lavorare il sottosquadro senza arrivare alla parte larga del portautensile uso la sidedepth o il diametro stretto del portautensile come diametro del gambo
if ( dMillTotLen - dMillLenTh) > ( abs( dRawMaxZ - dGrooveMinZ) + 1) then if ( dMillTotLen - dMillLenTh) > ( abs( dRawMaxZ - dGrooveMinZ) + 1) then
if dMaxDepthOnSide and dMaxDepthOnSide > 0 then if dMaxDepthOnSide and dMaxDepthOnSide > 0 then
@@ -1477,7 +1489,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
end end
end end
-- se profondità ribasso è maggiore della capacità di sottosquadro dell'utensile -- se profondità ribasso è maggiore della capacità di sottosquadro dell'utensile
if ( not bEnablePreMill and bMachFromDn) and ( dElev >= ( 0.5 * ( dMillDiam - dMillDiamTh))) then if ( not bEnablePreMill and bMachFromDn) and ( dElev > 0.5 * ( dMillDiam - dMillDiamTh) - 10 * GEO.EPS_SMALL) then
local sErr = 'Error : Side Elevation (' .. dElev .. ') bigger than max tool side depth (' .. ( 0.5 * ( dMillDiam - dMillDiamTh)) ..')' local sErr = 'Error : Side Elevation (' .. dElev .. ') bigger than max tool side depth (' .. ( 0.5 * ( dMillDiam - dMillDiamTh)) ..')'
EgtOutLog( sErr) EgtOutLog( sErr)
return false, sErr return false, sErr
@@ -1489,7 +1501,14 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
return false, sErr return false, sErr
end end
if Proc.Fct == 2 and Proc.Box:getMin():getZ() < b3Raw:getMin():getZ() + 100 * GEO.EPS_SMALL and dMaxMat > dThick + 10 * GEO.EPS_SMALL then if Proc.Fct == 2 and Proc.Box:getMin():getZ() < b3Raw:getMin():getZ() + 100 * GEO.EPS_SMALL and dMaxMat > dThick + 10 * GEO.EPS_SMALL then
local sErr = 'Error : Tool thickness is too big' local sErr = 'Error : Tool thickness is too big'
EgtOutLog( sErr)
return false, sErr
end
-- se la testa scende sotto al limite superiore del grezzo e non c'è sufficiente capacità di sottosquadro
local dHeadMaxWidth = 250
if dMillTotLen < ( abs( dRawMaxZ - dGrooveMinZ) + 1) and ( dElev > 0.5 * ( dMillDiam - dHeadMaxWidth) - 10 * GEO.EPS_SMALL) then
local sErr = 'Error : Tool too short, head will collide with rawpart'
EgtOutLog( sErr) EgtOutLog( sErr)
return false, sErr return false, sErr
end end
@@ -1731,8 +1750,8 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
end end
end end
-- inserisco la lavorazione di fresatura -- inserisco la lavorazione di fresatura
local sNameGorge = 'Gorge_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. tostring( nFacet) .. '_' .. tostring( nNm) local sNameGorge = 'Gorge_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. tostring( nFacet)
local nMchFId = EgtAddMachining( sNameGorge, sMillingGorge) local nMchFId = WM.AddMachining( Proc, sNameGorge, sMillingGorge)
if not nMchFId then if not nMchFId then
local sErr = 'Error adding machining ' .. sNameGorge .. '-' .. sMillingGorge local sErr = 'Error adding machining ' .. sNameGorge .. '-' .. sMillingGorge
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -1747,7 +1766,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
end end
EgtSetMachiningParam( MCH_MP.SCC, nSCC) EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- imposto modo di lavorare la faccia -- imposto modo di lavorare la faccia
local nFaceUse = WL.GetNearestParalOpposite( Z_AX(), vtN) local nFaceUse = WL.GetNearestParalOpposite( Z_AX())
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse) EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
-- imposto elevazione e step -- imposto elevazione e step
local dStep = EgtGetMachiningParam( MCH_MP.STEP) local dStep = EgtGetMachiningParam( MCH_MP.STEP)
@@ -1783,7 +1802,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
nNm = nNm + 1 nNm = nNm + 1
-- inserisco la lavorazione di taglio sfrido gorge -- inserisco la lavorazione di taglio sfrido gorge
local sNameGorge = 'GorgeCut_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. tostring( nFacet) .. '_' .. tostring( nNm) local sNameGorge = 'GorgeCut_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. tostring( nFacet) .. '_' .. tostring( nNm)
local nMchFId = EgtAddMachining( sNameGorge, sCuttingGorge) local nMchFId = WM.AddMachining( Proc, sNameGorge, sCuttingGorge)
if not nMchFId then if not nMchFId then
local sErr = 'Error adding machining ' .. sNameGorge .. '-' .. sCuttingGorge local sErr = 'Error adding machining ' .. sNameGorge .. '-' .. sCuttingGorge
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -1840,121 +1859,147 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
local dStepOri local dStepOri
if not bExcludeSideMill then if not bExcludeSideMill then
-- inserisco la lavorazione di ribasso o gola local nSideStep = 1
local sName = EgtIf( bEnablePreMill ~= nil, 'SideMill_', 'Mill_') .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) if dSideStep > 0 and not ( bEnablePreMill or bAsEnablePreMill) and nModifyLeadInOut < 1 then
local nMchFId = EgtAddMachining( sName, sMilling) nSideStep = ceil( dElev / dSideStep)
if not nMchFId then dSideStep = max( dElev / nSideStep, 0)
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
EgtOutLog( sErr)
return false, sErr
end end
EgtSetInfo( nMchFId, 'Part', Proc.PartId) for i = 1, nSideStep do
-- se ho abilitato la lavorazione di lama per garantire passaggio utensile, setto la nota per spostare la fresatura dopo i tagli di lama -- inserisco la lavorazione di ribasso o gola
if bEnablePreMill or bAsEnablePreMill then local sName = EgtIf( bEnablePreMill ~= nil, 'SideMill_', 'Mill_') .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
EgtSetInfo( nMchFId, 'MOVE_AFTER', 1) local nMchFId = WM.AddMachining( Proc, sName, sMilling)
end if not nMchFId then
-- aggiungo geometria local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
EgtSetMachiningGeometry( {{ Proc.Id, nFacet}}) EgtOutLog( sErr)
-- imposto posizione braccio porta testa return false, sErr
local nSCC = MCH_SCC.ADIR_NEAR
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- imposto modo di lavorare la faccia
local nFaceUse = WL.GetNearestParalOpposite( Z_AX(), vtN)
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
-- imposto elevazione e step
local dStep = EgtGetMachiningParam( MCH_MP.STEP)
dStepOri = dStep
if dStep < GEO.EPS_SMALL then dStep = 0.75 * dMaxMat end
local nStep = ceil( ( dThick - dMaxMat) / dStep)
dStep = max( ( dThick - dMaxMat) / max( nStep, 1), 0)
local dMaxElev = max( ( nStep + 1) * dStep - GEO.EPS_SMALL, 0)
if nSinglePass and nSinglePass > 0 then
dStep = 0
if nSinglePass == 1 then
EgtSetMachiningParam( MCH_MP.DEPTH, dMaxMat)
end end
end EgtSetInfo( nMchFId, 'Part', Proc.PartId)
if bUpwardMilling then -- se ho abilitato la lavorazione di lama per garantire passaggio utensile, setto la nota per spostare la fresatura dopo i tagli di lama
dStep = -dStep if bEnablePreMill or bAsEnablePreMill then
end EgtSetInfo( nMchFId, 'MOVE_AFTER', 1)
EgtSetMachiningParam( MCH_MP.STEP, dStep) end
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMaxElev, 3) .. ';') -- aggiungo geometria
-- setto il lato di lavoro standard EgtSetMachiningGeometry( {{ Proc.Id, nFacet}})
EgtSetMachiningParam( MCH_MP.INVERT, true) -- imposto posizione braccio porta testa
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) local nSCC = MCH_SCC.ADIR_NEAR
-- modifico ingressi e uscita EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- se ho inserito il pretaglio modifico -- imposto modo di lavorare la faccia
if bEnablePreMill or bAsEnablePreMill then local nFaceUse = WL.GetNearestParalOpposite( Z_AX())
if nModifyLeadInOut > 0 then EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
-- Confronto il raggio fresa con l'elevazione dalla normale per vedere se devo modificare l'uscita -- imposto elevazione e step
if dElev > ( 0.5 * dMillDiam) then local dStep = EgtGetMachiningParam( MCH_MP.STEP)
if nModifyLeadInOut == 1 then dStepOri = dStep
-- setto il tipo di passo a una via if dStep < GEO.EPS_SMALL then dStep = 0.75 * dMaxMat end
EgtSetMachiningParam( MCH_MP.STEPTYPE, MCH_MILL_ST.ONEWAY) local nStep = ceil( ( dThick - dMaxMat) / dStep)
-- modifico il tipo di uscita dStep = max( ( dThick - dMaxMat) / max( nStep, 1), 0)
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.PERP_TG) local dMaxElev = max( ( nStep + 1) * dStep - GEO.EPS_SMALL, 0)
if nSinglePass and nSinglePass > 0 then
dStep = 0
if nSinglePass == 1 then
EgtSetMachiningParam( MCH_MP.DEPTH, dMaxMat)
end
end
if bUpwardMilling then
dStep = -dStep
end
EgtSetMachiningParam( MCH_MP.STEP, dStep)
-- leggo eventuali note esistenti della lavorazione
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
-- aggiungo alle note massima elevazione
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxElev, 3))
-- scrivo le note della lavorazione
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- setto il lato di lavoro standard
EgtSetMachiningParam( MCH_MP.INVERT, true)
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
-- setto offset radiale per gestire le eventuali passate in orizzontale
local dRadialOffset = dSideStep * ( nSideStep - i)
EgtSetMachiningParam( MCH_MP.OFFSR, dRadialOffset)
-- modifico ingressi e uscita
-- se ho inserito il pretaglio modifico
if bEnablePreMill or bAsEnablePreMill then
if nModifyLeadInOut > 0 then
-- Confronto il raggio fresa con l'elevazione dalla normale per vedere se devo modificare l'uscita
if dElev > ( 0.5 * dMillDiam) then
if nModifyLeadInOut == 1 then
-- setto il tipo di passo a una via
EgtSetMachiningParam( MCH_MP.STEPTYPE, MCH_MILL_ST.ONEWAY)
-- modifico il tipo di uscita
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.PERP_TG)
EgtSetMachiningParam( MCH_MP.LIPERP, 0)
-- modifico dati supplementari uscita
EgtSetMachiningParam( MCH_MP.LOPERP, 0.5)
EgtSetMachiningParam( MCH_MP.LOTANG, -( dLongGorge + dExtraLongIni + dExtraLongEnd))
else
EgtSetMachiningParam( MCH_MP.LIPERP, dElev)
EgtSetMachiningParam( MCH_MP.LOPERP, dElev)
end
end
-- setto allungamenti iniziali e finali
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dExtraLongIni)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dExtraLongEnd)
if bInvertMach then
-- setto il lato di lavoro invertito
EgtSetMachiningParam( MCH_MP.INVERT, false)
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
end
else
-- setto allungamenti iniziali e finali
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dExtraLongIni)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dExtraLongEnd)
-- Confronto il raggio fresa con l'elevazione dalla normale per vedere se devo modificare l'uscita
if dElev > ( 0.5 * dMillDiam) then
-- setto allungamenti perpendicolari
EgtSetMachiningParam( MCH_MP.LIPERP, 0) EgtSetMachiningParam( MCH_MP.LIPERP, 0)
-- modifico dati supplementari uscita EgtSetMachiningParam( MCH_MP.LOPERP, 0)
EgtSetMachiningParam( MCH_MP.LOPERP, 0.5) end
EgtSetMachiningParam( MCH_MP.LOTANG, -( dLongGorge + dExtraLongIni + dExtraLongEnd)) end
else -- se richiesto, setto la nota per spostare la lavorazione alla fine
EgtSetMachiningParam( MCH_MP.LIPERP, dElev) if not WD.SIDEMILL_BEFORE then
EgtSetMachiningParam( MCH_MP.LOPERP, dElev) EgtSetInfo( nMchFId, 'MOVE_AFTER', 1)
end
else
if nModifyLeadInOut > 0 then
-- Confronto il raggio fresa con l'elevazione dalla normale per vedere se devo modificare l'uscita
if dElev > ( 0.5 * dMillDiam) then
-- setto il tipo di passo a una via
EgtSetMachiningParam( MCH_MP.STEPTYPE, 1)
end
if bInvertMach then
-- setto il lato di lavoro invertito
EgtSetMachiningParam( MCH_MP.INVERT, false)
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
end end
end end
-- setto allungamenti iniziali e finali -- setto allungamenti iniziali e finali
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dExtraLongIni) EgtSetMachiningParam( MCH_MP.STARTADDLEN, dExtraLongIni)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dExtraLongEnd) EgtSetMachiningParam( MCH_MP.ENDADDLEN, dExtraLongEnd)
if bInvertMach then -- se ho passate orizzontali riduco l'eventuale allungamento settato dall'utente
-- setto il lato di lavoro invertito local dLiPerp = EgtGetMachiningParam( MCH_MP.LIPERP)
EgtSetMachiningParam( MCH_MP.INVERT, false) local dLoPerp = EgtGetMachiningParam( MCH_MP.LOPERP)
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) if dLiPerp > 0 then
dLiPerp = dLiPerp - dRadialOffset
end end
else if dLoPerp > 0 then
-- setto allungamenti iniziali e finali dLoPerp = dLoPerp - dRadialOffset
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dExtraLongIni) end
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dExtraLongEnd) EgtSetMachiningParam( MCH_MP.LIPERP, dLiPerp)
-- Confronto il raggio fresa con l'elevazione dalla normale per vedere se devo modificare l'uscita EgtSetMachiningParam( MCH_MP.LOPERP, dLoPerp)
if dElev > ( 0.5 * dMillDiam) then -- se richiesto, setto la nota per spostare la lavorazione alla fine
-- setto allungamenti perpendicolari if not WD.SIDEMILL_BEFORE then
EgtSetMachiningParam( MCH_MP.LIPERP, 0) EgtSetInfo( nMchFId, 'MOVE_AFTER', 1)
EgtSetMachiningParam( MCH_MP.LOPERP, 0)
end end
end end
-- se richiesto, setto la nota per spostare la lavorazione alla fine -- eseguo
if not WD.SIDEMILL_BEFORE then
EgtSetInfo( nMchFId, 'MOVE_AFTER', 1)
end
else
if nModifyLeadInOut > 0 then
-- Confronto il raggio fresa con l'elevazione dalla normale per vedere se devo modificare l'uscita
if dElev > ( 0.5 * dMillDiam) then
-- setto il tipo di passo a una via
EgtSetMachiningParam( MCH_MP.STEPTYPE, 1)
end
if bInvertMach then
-- setto il lato di lavoro invertito
EgtSetMachiningParam( MCH_MP.INVERT, false)
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
end
end
-- setto allungamenti iniziali e finali
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dExtraLongIni)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dExtraLongEnd)
-- se richiesto, setto la nota per spostare la lavorazione alla fine
if not WD.SIDEMILL_BEFORE then
EgtSetInfo( nMchFId, 'MOVE_AFTER', 1)
end
end
-- eseguo
if not EgtApplyMachining( true, false) then
-- provo a invertire posizione braccio porta testa
nSCC = MCH_SCC.ADIR_FAR
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
if not EgtApplyMachining( true, false) then if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() -- provo a invertire posizione braccio porta testa
EgtSetOperationMode( nMchFId, false) nSCC = MCH_SCC.ADIR_FAR
return false, sErr EgtSetMachiningParam( MCH_MP.SCC, nSCC)
if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchFId, false)
return false, sErr
end
end end
end end
else else
@@ -1966,7 +2011,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
if dAng and dAng > -90 + 10 * GEO.EPS_SMALL and not bExcludeFinishing then if dAng and dAng > -90 + 10 * GEO.EPS_SMALL and not bExcludeFinishing then
-- inserisco la lavorazione di contornatura -- inserisco la lavorazione di contornatura
local sName = 'Mill_Oth_Fac_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName = 'Mill_Oth_Fac_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sName, sMilling) local nMchFId = WM.AddMachining( Proc, sName, sMilling)
if not nMchFId then if not nMchFId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -1998,7 +2043,12 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
dStepOtherFace = -dStepOtherFace dStepOtherFace = -dStepOtherFace
end end
EgtSetMachiningParam( MCH_MP.STEP, dStepOtherFace) EgtSetMachiningParam( MCH_MP.STEP, dStepOtherFace)
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMaxElev, 3) .. ';') -- leggo eventuali note esistenti della lavorazione
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
-- aggiungo alle note massima elevazione
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxElev, 3))
-- scrivo le note della lavorazione
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
if bMachFromDn then if bMachFromDn then
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
EgtSetMachiningParam( MCH_MP.DEPTH, dDepthOtherFace) EgtSetMachiningParam( MCH_MP.DEPTH, dDepthOtherFace)
@@ -2154,7 +2204,7 @@ local function MakeByPocketing( Proc, nFacet, nRawId, b3Raw, bCheckQPar)
end end
-- inserisco la lavorazione di svuotatura -- inserisco la lavorazione di svuotatura
local sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sName, sPocketing) local nMchFId = WM.AddMachining( Proc, sName, sPocketing)
if not nMchFId then if not nMchFId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -2183,8 +2233,12 @@ local function MakeByPocketing( Proc, nFacet, nRawId, b3Raw, bCheckQPar)
EgtOutLog( sWarn) EgtOutLog( sWarn)
end end
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth) EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
-- leggo eventuali note della lavorazione
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
-- imposto elevazione -- imposto elevazione
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( min( dElev, dMaxDepth), 1) .. ';') sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( min( dElev, dMaxDepth), 1))
-- scrivo le note della lavorazione
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- eseguo -- eseguo
if not EgtApplyMachining( true, false) then if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
@@ -2231,7 +2285,7 @@ local function MakeOneFace( Proc, nRawId, b3Raw)
end end
-- eseguo il taglio di lama -- eseguo il taglio di lama
local sName = 'Cut_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) .. '_' .. tostring( Proc.Id) local sName = 'Cut_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) .. '_' .. tostring( Proc.Id)
local nMchId = EgtAddMachining( sName, sCutting) local nMchId = WM.AddMachining( Proc, sName, sCutting)
if not nMchId then if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sCutting local sErr = 'Error adding machining ' .. sName .. '-' .. sCutting
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -2509,7 +2563,7 @@ local function MakeTwoFaces( Proc, nRawId, b3Raw)
for i = 1, 2 do for i = 1, 2 do
-- inserisco la lavorazione -- inserisco la lavorazione
local sName = 'Cut_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) .. '_' .. tostring( Proc.Id) .. '_' .. tostring( i) local sName = 'Cut_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) .. '_' .. tostring( Proc.Id) .. '_' .. tostring( i)
local nMchId = EgtAddMachining( sName, sCutting) local nMchId = WM.AddMachining( Proc, sName, sCutting)
if not nMchId then if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sCutting local sErr = 'Error adding machining ' .. sName .. '-' .. sCutting
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -2604,8 +2658,12 @@ local function MakeMoreFaces( Proc, nRawId, b3Raw)
return MakeSideGrooveByMill( Proc, nFacInd, nRawId, b3Raw, EgtIf( dMaxDepthOnSide, sMillOnSide, nil), dMaxDepthOnSide, bMakeFirstGroove, nil, nil, bLikeAsMakeFirstGroove, nSinglePass) return MakeSideGrooveByMill( Proc, nFacInd, nRawId, b3Raw, EgtIf( dMaxDepthOnSide, sMillOnSide, nil), dMaxDepthOnSide, bMakeFirstGroove, nil, nil, bLikeAsMakeFirstGroove, nSinglePass)
end end
else else
-- fresatura (se definita) -- fresatura (se definita); se disponibile, cerco di usare un utensile che non lavori al limite della capacità di sottosquadro
local sMilling = WM.FindMilling( 'SideGroove', nil, nil, nil, nil, min( dH, dV)) local sMilling = WM.FindMilling( 'SideGroove', nil, nil, nil, nil, min( dH, dV), nil, 1.2 * dSideElev)
-- se non ho trovato un utensile un po' più grande del sottosquadro richiesto, passo alla ricerca standard
if not sMilling then
sMilling = WM.FindMilling( 'SideGroove', nil, nil, nil, nil, min( dH, dV), nil, dSideElev)
end
-- recupero i dati dell'utensile -- recupero i dati dell'utensile
local dMaxMat = 1000 local dMaxMat = 1000
local dMaxDepthOnSide = 0 local dMaxDepthOnSide = 0
@@ -2613,7 +2671,7 @@ local function MakeMoreFaces( Proc, nRawId, b3Raw)
if sMilling and EgtMdbSetCurrMachining( sMilling) then if sMilling and EgtMdbSetCurrMachining( sMilling) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
local dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam local dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or 0
bIsBlade = EgtTdbGetCurrToolParam( MCH_TP.TYPE) & MCH_TF.SAWBLADE ~= 0 bIsBlade = EgtTdbGetCurrToolParam( MCH_TP.TYPE) & MCH_TF.SAWBLADE ~= 0
if bIsBlade then if bIsBlade then
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dMaxMat dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dMaxMat
@@ -2628,12 +2686,12 @@ local function MakeMoreFaces( Proc, nRawId, b3Raw)
end end
end end
end end
if sMilling and dElev < dMaxDepthOnSide then if sMilling and dElev < dMaxDepthOnSide then
return MakeSideGrooveByMill( Proc, nFacInd, nRawId, b3Raw, sMilling) return MakeSideGrooveByMill( Proc, nFacInd, nRawId, b3Raw, sMilling)
-- altrimenti sega a catena -- altrimenti sega a catena
else else
return MakeByChainSaw( Proc, nFacInd, nRawId, b3Raw, dElev, dH, dV) return MakeByChainSaw( Proc, nFacInd, nRawId, b3Raw, dElev, dH, dV)
end end
end end
end end
local nFacet = EgtIf( bPckt or vtN:getZ() >= WD.NZ_MINA, nFacInd, nFacInd2) local nFacet = EgtIf( bPckt or vtN:getZ() >= WD.NZ_MINA, nFacInd, nFacInd2)
+3 -2
View File
@@ -1,6 +1,7 @@
-- WProcessMark.lua by Egaltech s.r.l. 2021/04/20 -- WProcessMark.lua by Egaltech s.r.l. 2021/04/20
-- Gestione calcolo marcatura per Pareti -- Gestione calcolo marcatura per Pareti
-- 2023/01/05 Permesse le marcature laterali in presenza di offset Z, tra grezzo e tavola, di almeno 100 mm -- 2023/01/05 Permesse le marcature laterali in presenza di offset Z, tra grezzo e tavola, di almeno 100 mm
-- 2023/05/25 Funzioni EgtAddMachining sostituite da WM.AddMachining in modo da trascrivere le priorità da btl alle lavorazioni.
-- Tabella per definizione modulo -- Tabella per definizione modulo
local WPMK = {} local WPMK = {}
@@ -107,7 +108,7 @@ function WPMK.Make( Proc, nRawId, b3Raw)
end end
-- inserisco la lavorazione di fresatura -- inserisco la lavorazione di fresatura
local sName = 'Decor_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName = 'Decor_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sName, sMilling) local nMchFId = WM.AddMachining( Proc, sName, sMilling)
if not nMchFId then if not nMchFId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -131,7 +132,7 @@ function WPMK.Make( Proc, nRawId, b3Raw)
if AuxId then if AuxId then
-- inserisco la lavorazione di fresatura -- inserisco la lavorazione di fresatura
local sName2 = 'Decor2_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName2 = 'Decor2_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchF2Id = EgtAddMachining( sName, sMilling) local nMchF2Id = WM.AddMachining( Proc, sName, sMilling)
if not nMchF2Id then if not nMchF2Id then
local sErr = 'Error adding machining ' .. sName2 .. '-' .. sMilling local sErr = 'Error adding machining ' .. sName2 .. '-' .. sMilling
EgtOutLog( sErr) EgtOutLog( sErr)
+2 -1
View File
@@ -1,6 +1,7 @@
-- WProcessMortise.lua by Egaltech s.r.l. 2021/07/30 -- WProcessMortise.lua by Egaltech s.r.l. 2021/07/30
-- Gestione calcolo mortase per Pareti -- Gestione calcolo mortase per Pareti
-- 2023/01/05 Permesse le mortase laterali in presenza di offset Z, tra grezzo e tavola, di almeno 100 mm -- 2023/01/05 Permesse le mortase laterali in presenza di offset Z, tra grezzo e tavola, di almeno 100 mm
-- 2023/05/25 Funzioni EgtAddMachining sostituite da WM.AddMachining in modo da trascrivere le priorità da btl alle lavorazioni.
-- Tabella per definizione modulo -- Tabella per definizione modulo
local WPM = {} local WPM = {}
@@ -250,7 +251,7 @@ function WPM.Make( Proc, nRawId, b3Raw)
end end
-- inserisco la lavorazione di svuotatura -- inserisco la lavorazione di svuotatura
local sName = 'Mort_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName = 'Mort_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sName, sPocketing) local nMchFId = WM.AddMachining( Proc, sName, sPocketing)
if not nMchFId then if not nMchFId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing
EgtOutLog( sErr) EgtOutLog( sErr)
+2 -1
View File
@@ -1,5 +1,6 @@
-- WProcessText.lua by Egaltech s.r.l. 2021/04/20 -- WProcessText.lua by Egaltech s.r.l. 2021/04/20
-- Gestione calcolo testi per Travi -- Gestione calcolo testi per Travi
-- 2023/05/25 Funzioni EgtAddMachining sostituite da WM.AddMachining in modo da trascrivere le priorità da btl alle lavorazioni.
-- Tabella per definizione modulo -- Tabella per definizione modulo
local WPT = {} local WPT = {}
@@ -77,7 +78,7 @@ function WPT.Make( Proc, nRawId, b3Raw)
end end
-- inserisco la lavorazione di fresatura -- inserisco la lavorazione di fresatura
local sName = 'Text_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName = 'Text_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sName, sMilling) local nMchFId = WM.AddMachining( Proc, sName, sMilling)
if not nMchFId then if not nMchFId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
EgtOutLog( sErr) EgtOutLog( sErr)
+2 -1
View File
@@ -1,5 +1,6 @@
-- WProcessVariant.lua by Egaltech s.r.l. 2021/08/27 -- WProcessVariant.lua by Egaltech s.r.l. 2021/08/27
-- Gestione calcolo Feature Custom (Variant) per Pareti -- Gestione calcolo Feature Custom (Variant) per Pareti
-- 2023/05/25 Funzioni EgtAddMachining sostituite da WM.AddMachining in modo da trascrivere le priorità da btl alle lavorazioni.
-- Tabella per definizione modulo -- Tabella per definizione modulo
local WPV = {} local WPV = {}
@@ -71,7 +72,7 @@ local function MakeCode_1( Proc, nRawId, b3Raw)
end end
-- inserisco la lavorazione di finitura superficie -- inserisco la lavorazione di finitura superficie
local sName = 'SurfFin_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName = 'SurfFin_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sName, sSurfFin) local nMchFId = WM.AddMachining( Proc, sName, sSurfFin)
if not nMchFId then if not nMchFId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sSurfFin local sErr = 'Error adding machining ' .. sName .. '-' .. sSurfFin
EgtOutLog( sErr) EgtOutLog( sErr)
+98 -27
View File
@@ -1,5 +1,9 @@
-- WallExec.lua by Egaltech s.r.l. 2023/03/06 -- WallExec.lua by Egaltech s.r.l. 2023/07/04
-- Libreria esecuzione lavorazioni per Pareti -- Libreria esecuzione lavorazioni per Pareti
-- 2023/05/25 Aggiunto ordinamento in base a priorità da btl.
-- 2023/06/07 Nel caso di outline con priorità aggiunta la rimozione degli sfridi nella lavorazione successiva.
-- 2023/06/27 Aggiunte origini TN e BN.
-- 2023/07/04 Se c'è funzione di macchina WD.GetOrigCorner si lascia scegliere posizione default a questa impostando 0 se non c'è 'REFPOS'.
-- Tabella per definizione modulo -- Tabella per definizione modulo
local WallExec = {} local WallExec = {}
@@ -71,7 +75,7 @@ function WallExec.ProcessWalls( dRawL, dRawW, dRawH, vWall, bMachGroupOk, bNewPr
local nCorner local nCorner
local sOrigCorner = WD.ORIG_CORNER or 'BR' local sOrigCorner = WD.ORIG_CORNER or 'BR'
if WD.GetOrigCorner then if WD.GetOrigCorner then
sOrigCorner = WD.GetOrigCorner( EgtGetInfo( EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or GDB_ID.NULL, 'REFPOS', 'i') or 1) sOrigCorner = WD.GetOrigCorner( EgtGetInfo( EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or GDB_ID.NULL, 'REFPOS', 'i') or 0)
end end
if sOrigCorner == 'TL' then if sOrigCorner == 'TL' then
nCorner = MCH_CR.TL nCorner = MCH_CR.TL
@@ -91,6 +95,12 @@ function WallExec.ProcessWalls( dRawL, dRawW, dRawH, vWall, bMachGroupOk, bNewPr
elseif sOrigCorner == 'BM' then elseif sOrigCorner == 'BM' then
nCorner = MCH_CR.BR nCorner = MCH_CR.BR
OrigOnTab = Point3d( WD.MID_REF - abs( WD.DELTA_X or 0), abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0)) OrigOnTab = Point3d( WD.MID_REF - abs( WD.DELTA_X or 0), abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0))
elseif sOrigCorner == 'TN' then
nCorner = MCH_CR.TL
OrigOnTab = Point3d( WD.NEW_REF + abs( WD.DELTA_X or 0), b3Tab:getDimY() - abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0))
elseif sOrigCorner == 'BN' then
nCorner = MCH_CR.BL
OrigOnTab = Point3d( WD.NEW_REF + abs( WD.DELTA_X or 0), abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0))
end end
-- Impostazione dell'attrezzaggio di default -- Impostazione dell'attrezzaggio di default
EgtImportSetup() EgtImportSetup()
@@ -179,6 +189,7 @@ function WallExec.CollectFeatures( PartId, b3Raw)
Proc.CutId = nCutId Proc.CutId = nCutId
Proc.TaskId = nTaskId Proc.TaskId = nTaskId
Proc.Box = EgtGetBBoxGlob( ProcId, GDB_BB.STANDARD) Proc.Box = EgtGetBBoxGlob( ProcId, GDB_BB.STANDARD)
Proc.IsOutline = ( Proc.Prc == 251 or Proc.Prc == 252)
if Proc.Box and not Proc.Box:isEmpty() then if Proc.Box and not Proc.Box:isEmpty() then
table.insert( vProc, Proc) table.insert( vProc, Proc)
-- se foro -- se foro
@@ -409,7 +420,7 @@ local function ContainsStartName( nOperId, StartNames)
end end
------ Ordinamento dei tagli, delle fresature e delle forature ------- ------ Ordinamento dei tagli, delle fresature e delle forature -------
local function SortMach( nPhase, PrevMch, nPartId, nType, StartNames, bExistName, sInfo, bExistInfo, bOneWay, bByTool, bByToolAngle) local function SortMach( nPhase, PrevMch, nPartId, nType, StartNames, bExistName, sInfo, bExistInfo, bOneWay, bByTool, bByToolAngle, nPriority)
-- dichiarazione tabella -- dichiarazione tabella
local TabCut = {} local TabCut = {}
-- Recupero gli identificativi delle lavorazioni e annullo eventuali allungamenti e Id di altre lavorazioni rappresentate -- Recupero gli identificativi delle lavorazioni e annullo eventuali allungamenti e Id di altre lavorazioni rappresentate
@@ -419,6 +430,7 @@ local function SortMach( nPhase, PrevMch, nPartId, nType, StartNames, bExistName
-- Se appartiene alla fase corrente e taglio con lama non da sopra (sempre su 1 sola entità) -- Se appartiene alla fase corrente e taglio con lama non da sopra (sempre su 1 sola entità)
if EgtGetOperationPhase( nOperId) == nPhase and ( nType & nOperType) == nOperType and if EgtGetOperationPhase( nOperId) == nPhase and ( nType & nOperType) == nOperType and
( not nPartId or EgtGetInfo( nOperId, 'Part', 'i') == nPartId) and ( not nPartId or EgtGetInfo( nOperId, 'Part', 'i') == nPartId) and
( not nPriority or EgtGetInfo( nOperId, 'PRIORITY', 'i') == nPriority ) and
( not StartNames or ( bExistName and ContainsStartName( nOperId, StartNames)) or ( not StartNames or ( bExistName and ContainsStartName( nOperId, StartNames)) or
( not bExistName and not ContainsStartName( nOperId, StartNames))) and ( not bExistName and not ContainsStartName( nOperId, StartNames))) and
( not sInfo or ( bExistInfo and EgtGetInfo( nOperId, sInfo, 'i') == 1) or ( not sInfo or ( bExistInfo and EgtGetInfo( nOperId, sInfo, 'i') == 1) or
@@ -535,17 +547,17 @@ local function SortMach( nPhase, PrevMch, nPartId, nType, StartNames, bExistName
end end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
local function SortMachinings( nPhase, PrevMch, nPartId) local function SortMachinings( nPhase, PrevMch, nPartId, nPriority)
-- Chiodature -- Chiodature
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Nail_'}, true, nil, nil, nil, true) PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Nail_'}, true, nil, nil, nil, true, nil, nPriority)
-- Tagli con sega a catena che sono rifiniture di spigoli -- Tagli con sega a catena che sono rifiniture di spigoli
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MORTISING, { 'Csaw_'}, false) PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MORTISING, { 'Csaw_'}, false, nil, nil, nil, nil, nil, nPriority)
-- Forature orizzontali con punte lunghe -- Forature orizzontali con punte lunghe
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING, { 'LhDrill_'}, true, 'MOVE_AFTER', false, true) PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING, { 'LhDrill_'}, true, 'MOVE_AFTER', false, true, nil, nil, nPriority)
-- Preforature per fori inclinati -- Preforature per fori inclinati
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.POCKETING, { 'PreDrill_'}, true) PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.POCKETING, { 'PreDrill_'}, true, nil, nil, nil, nil, nil, nPriority)
-- Forature e Svuotature -- Forature e Svuotature
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING + MCH_OY.POCKETING + MCH_OY.MILLING, { 'SideMill_', 'Clean_'}, false, 'MOVE_AFTER', false, false, true) PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING + MCH_OY.POCKETING + MCH_OY.MILLING, { 'SideMill_', 'Clean_'}, false, 'MOVE_AFTER', false, false, true, nil, nPriority)
-- -- Forature *** -- -- Forature ***
-- PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING, nil, nil, 'MOVE_AFTER', false) -- PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING, nil, nil, 'MOVE_AFTER', false)
-- -- Svuotature *** -- -- Svuotature ***
@@ -553,33 +565,56 @@ local function SortMachinings( nPhase, PrevMch, nPartId)
-- -- Fresature che sono rifiniture di spigoli -- -- Fresature che sono rifiniture di spigoli
-- PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Clean_'}, false, 'MOVE_AFTER', false, false, true) -- PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Clean_'}, false, 'MOVE_AFTER', false, false, true)
-- Lavorazioni di superficie -- Lavorazioni di superficie
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_MY.SURFFINISHING, nil, nil, 'MOVE_AFTER', false) PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_MY.SURFFINISHING, nil, nil, 'MOVE_AFTER', false, nil, nil, nil, nPriority)
-- Fresature per gole -- Fresature per gole
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Gorge_'}, true, 'MOVE_AFTER', false) PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Gorge_'}, true, 'MOVE_AFTER', false, nil, nil, nil, nPriority)
-- Fresature che sono rifiniture di spigoli -- Fresature che sono rifiniture di spigoli
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'SideMill_'}, true, 'MOVE_AFTER', false, false, true, true) PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'SideMill_'}, true, 'MOVE_AFTER', false, false, true, true, nPriority)
-- Fresature che sono puliture di spigoli -- Fresature che sono puliture di spigoli
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Clean_'}, true, 'MOVE_AFTER', false, false, true) PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Clean_'}, true, 'MOVE_AFTER', false, false, true, nil, nPriority)
-- Tagli per gole -- Tagli per gole
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.SAWING, { 'GorgeCut_'}, true) PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.SAWING, { 'GorgeCut_'}, true, nil, nil, nil, nil, nil, nPriority)
-- Tagli con lama -- Tagli con lama
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.SAWING) PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.SAWING, nil, nil, nil, nil, nil, nil, nil, nPriority)
-- Qui rimozione sfridi (se ci sono lavorazioni successive) -- Qui rimozione sfridi (se ci sono lavorazioni successive)
-- Fresature dei lapjoint che necessitano di gorge if not nPriority then
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'SideMill_'}, true, 'MOVE_AFTER', true, false, true, true) -- Fresature dei lapjoint che necessitano di gorge
-- Tagli con sega a catena che vanno fatti dopo i tagli con lama PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'SideMill_'}, true, 'MOVE_AFTER', true, false, true, true)
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MORTISING, { 'Csaw_'}, true) -- Tagli con sega a catena che vanno fatti dopo i tagli con lama
-- Fresature (puliture di spigoli) che vanno fatte dopo i tagli con lama PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MORTISING, { 'Csaw_'}, true)
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, nil, nil, 'MOVE_AFTER', true) -- Fresature (puliture di spigoli) che vanno fatte dopo i tagli con lama
-- Forature che vanno fatte dopo i tagli con lama PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, nil, nil, 'MOVE_AFTER', true)
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING, nil, nil, 'MOVE_AFTER', true) -- Forature che vanno fatte dopo i tagli con lama
-- Svuotature che vanno fatte dopo i tagli con lama PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING, nil, nil, 'MOVE_AFTER', true)
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.POCKETING, nil, nil, 'MOVE_AFTER', true) -- Svuotature che vanno fatte dopo i tagli con lama
-- Lavorazioni di superficie che vanno fatte dopo i tagli con lama PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.POCKETING, nil, nil, 'MOVE_AFTER', true)
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_MY.SURFFINISHING, nil, nil, 'MOVE_AFTER', true) -- Lavorazioni di superficie che vanno fatte dopo i tagli con lama
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_MY.SURFFINISHING, nil, nil, 'MOVE_AFTER', true)
end
return PrevMch return PrevMch
end end
-------------------------------------------------------------------------------------------------------------
-- setto la rimozione sfridi dopo le lavorazioni di outline
function InsertScrapRemoval( nPhase)
local nCurrentOperationId = EgtGetNextOperation( EgtGetPhaseDisposition( nPhase))
local nActiveMachiningId = EgtGetCurrMachining()
while nCurrentOperationId do
local bIsCurrentOperationOutline = ( EgtGetInfo( nCurrentOperationId or GDB_ID.NULL, 'ISOUTLINE', 'b' ) == true)
local bIsCurrentOperationWithPriority = ( ( EgtGetInfo( nCurrentOperationId or GDB_ID.NULL, 'PRIORITY', 'i' ) or 0) > 0)
local nNextOperationId = EgtGetNextOperation (nCurrentOperationId)
local bIsNextOperationOutline = ( EgtGetInfo( nNextOperationId or GDB_ID.NULL, 'ISOUTLINE', 'b' ) == true)
if bIsCurrentOperationOutline and bIsCurrentOperationWithPriority and nNextOperationId and not bIsNextOperationOutline then
EgtSetCurrMachining( nNextOperationId)
local sMachiningNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
sMachiningNotes = sMachiningNotes .. 'ScrapRemove=1;'
EgtSetMachiningParam( MCH_MP.USERNOTES, sMachiningNotes)
end
nCurrentOperationId = EgtGetNextOperation( nCurrentOperationId)
end
EgtSetCurrMachining( nActiveMachiningId or GDB_ID.NULL)
end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
function WallExec.ProcessFeatures() function WallExec.ProcessFeatures()
-- errori e stato -- errori e stato
@@ -641,8 +676,44 @@ function WallExec.ProcessFeatures()
-- riordino le lavorazioni tra tutti i pezzi -- riordino le lavorazioni tra tutti i pezzi
local nPhase = 1 local nPhase = 1
local PrevMch = EgtGetPhaseDisposition( nPhase) local PrevMch = EgtGetPhaseDisposition( nPhase)
-- abilitazione ordinamento con priorità da btl: 0 = no, 1 = ordine crescente, 2 = ordine decrescente
-- le lavorazioni con priorità 0 o senza priorità saranno lasciate per ultime
local nGetPriorityFromBtl = WD.BTL_PRIORITY or 0
if nGetPriorityFromBtl > 0 then
local vPriority = {}
local nOperId = EgtGetNextOperation( PrevMch)
local nCurrentPriorityId = 1
while nOperId do
local nPriority = EgtGetInfo( nOperId or GDB_ID.NULL, 'PRIORITY', 'i')
if nPriority and nPriority ~= 0 then
vPriority[nCurrentPriorityId] = nPriority
nCurrentPriorityId = nCurrentPriorityId + 1
end
nOperId = EgtGetNextOperation( nOperId)
end
-- sorting delle priorità
-- ordine crescente
if nGetPriorityFromBtl == 1 then
table.sort( vPriority)
-- ordine decrescente
else
table.sort( vPriority, function( a, b) return a > b end)
end
-- riordino le lavorazioni per priorità
for i = 1, #vPriority do
if i == 1 or ( vPriority[i] ~= vPriority[i - 1]) then
PrevMch = SortMachinings( nPhase, PrevMch, nil, vPriority[i])
end
end
end
-- ordinamento standard
SortMachinings( nPhase, PrevMch) SortMachinings( nPhase, PrevMch)
-- Aggiornamento finale di tutto -- Aggiornamento finale di tutto
if nGetPriorityFromBtl > 0 then
InsertScrapRemoval( nPhase)
end
EgtSetCurrPhase( 1) EgtSetCurrPhase( 1)
EgtApplyAllMachinings() EgtApplyAllMachinings()
-- altrimenti macchina travi -- altrimenti macchina travi
+32
View File
@@ -1,4 +1,36 @@
==== Wall Update Log ==== ==== Wall Update Log ====
Versione 2.5g3 (26/07/2023)
- Modif : Nei tagli di lama angolo Z minimo ora gestito tramite costante da WallData CUT_VZ_MIN (default -0.5)
- Modif : Nelle fresature di ripresa angoli dei contorni migliorata la scelta della fresa secondaria in caso non sia disponibile una fresa di lunghezza sufficiente.
Versione 2.5g2 (25/07/2023)
- Added : aggiunte passate laterali per SideGroove, se specificato SIDESTEP nelle note utensile.
Versione 2.5g1 (04/07/2023)
- Modif : per posizione default del grezzo ora si assegna 0 per lasciare il compito a WD.GetOrigCorner di macchina.
Versione 2.5f3 (30/06/2023)
- Modif : in LapJoint aggiunta lettura di eventuali note di lavorazione esistenti.
Versione 2.5f2 (28/06/2023)
- Added : aggiunte due nuove origini (TN e BN che come X usano WD.NEW_REF), in totale ora sono 8.
Versione 2.5f1 (13/06/2023)
- Added : aggiunta gestione priorità da btl
- Added : aggiunta gestione lavorazione per lamatura speciale affondata con Tool_ID specifico.
Versione 2.5e1 (04/05/2023)
- Modif : modifiche per gestione traduzione messaggi
Versione 2.5d2 (20/04/2023)
- Added : in TS3v7 aggiunta gestione flag per taglio feature con outline (da parametro macchina WD.CUT_WITH_OUTLINE)
- Added : in TS3v7 aggiunta gestione flag per rotazione grezzo di 180deg (da parametro macchina WD.RAWPART_ROT)
- Modif : in LapJoint con lavorazione di lato se MCH_SCC.ADIR_NEAR fallisce si riprova con MCH_SCC.ADIR_FAR
- Fixed : in FreeContour e assimilati aggiunta pulitura spigoli Q05=1 anche su sole fresature
- Fixed : in LapJoint e assimilati corretta ricerca utensile in lavorazione 'SideGroove'
- Fixed : in FreeContour e LapJoint la lavorazione CleanCorner viene sempre forzata con lato di lavoro in centro
- Fixed : in LapJoint razionalizzata gestione parametri Q ed eliminta gestione forzatura lama non usata.
Versione 2.5d1 (06/04/23) Versione 2.5d1 (06/04/23)
- Added : in nesting aggiunti valori di default per alcuni parametri letti dal WallData. - Added : in nesting aggiunti valori di default per alcuni parametri letti dal WallData.
+2 -2
View File
@@ -1,6 +1,6 @@
-- Version.lua by Egalware s.r.l. 2023/05/04 -- Version.lua by Egalware s.r.l. 2023/07/04
-- Gestione della versione di Wall -- Gestione della versione di Wall
NAME = 'Wall' NAME = 'Wall'
VERSION = '2.5e1' VERSION = '2.5g3'
MIN_EXE = '2.5b3' MIN_EXE = '2.5b3'