From 1a1d48a2c1e842d074628bd464a1fa499c11ed36 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Fri, 21 Apr 2023 10:13:00 +0200 Subject: [PATCH 01/15] update log modifiche --- UpdateLog.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/UpdateLog.txt b/UpdateLog.txt index 56f580d..74b47a6 100644 --- a/UpdateLog.txt +++ b/UpdateLog.txt @@ -1,4 +1,13 @@ ==== Wall Update Log ==== +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) - Added : in nesting aggiunti valori di default per alcuni parametri letti dal WallData. \ No newline at end of file From 78cf1157481a9fb0df94beee8a5b5a6d14827be7 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Tue, 9 May 2023 09:02:27 +0200 Subject: [PATCH 02/15] update gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index aece050..4789404 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ /bin/*.ini /bin/LuaLibs/*.lua /bin/Images/*.png +.vscode/settings.json From 63a3cfe698fe5b6e4e6ace19f34775ed181d521a Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Mon, 15 May 2023 13:31:33 +0200 Subject: [PATCH 03/15] =?UTF-8?q?primo=20implemento=20ciclo=20priorit?= =?UTF-8?q?=C3=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/WallExec.lua | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/LuaLibs/WallExec.lua b/LuaLibs/WallExec.lua index 839fb75..c296188 100644 --- a/LuaLibs/WallExec.lua +++ b/LuaLibs/WallExec.lua @@ -535,7 +535,7 @@ local function SortMach( nPhase, PrevMch, nPartId, nType, StartNames, bExistName end ------------------------------------------------------------------------------------------------------------- -local function SortMachinings( nPhase, PrevMch, nPartId) +local function SortMachinings( nPhase, PrevMch, nPartId, bOnlyPriority) -- Chiodature PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Nail_'}, true, nil, nil, nil, true) -- Tagli con sega a catena che sono rifiniture di spigoli @@ -641,6 +641,19 @@ function WallExec.ProcessFeatures() -- riordino le lavorazioni tra tutti i pezzi local nPhase = 1 local PrevMch = EgtGetPhaseDisposition( nPhase) + + 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 end + nCurrentPriorityId = nCurrentPriorityId + 1 + end + for i = 1, #vPriority do + PrevMch = SortMachinings( nPhase, PrevMch, nil, vPriority[i]) + end + SortMachinings( nPhase, PrevMch) -- Aggiornamento finale di tutto EgtSetCurrPhase( 1) From e63b498902921390755219c1c1d5d0f94b0351ab Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Tue, 16 May 2023 16:42:32 +0200 Subject: [PATCH 04/15] piccola correzione messaggio --- BatchProcess.lua | 2 +- BatchProcessNew.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/BatchProcess.lua b/BatchProcess.lua index a6c3a54..2d424f1 100644 --- a/BatchProcess.lua +++ b/BatchProcess.lua @@ -245,7 +245,7 @@ if bToProcess then end if #vWall == 0 then 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) PostErrView( WALL.ERR, WALL.MSG) return diff --git a/BatchProcessNew.lua b/BatchProcessNew.lua index 1e69484..469c827 100644 --- a/BatchProcessNew.lua +++ b/BatchProcessNew.lua @@ -230,7 +230,7 @@ if bToProcess then end if #vWall == 0 then 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) PostErrView( WALL.ERR, WALL.MSG) return From bd0dbbb41cfef2f8af0945d8641020da3af90ff0 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Tue, 23 May 2023 18:25:16 +0200 Subject: [PATCH 05/15] =?UTF-8?q?modificata=20funzioni=20di=20sorting=20pe?= =?UTF-8?q?r=20gestire=20priorit=C3=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/WallExec.lua | 53 +++++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/LuaLibs/WallExec.lua b/LuaLibs/WallExec.lua index c296188..4ffae3d 100644 --- a/LuaLibs/WallExec.lua +++ b/LuaLibs/WallExec.lua @@ -409,7 +409,7 @@ local function ContainsStartName( nOperId, StartNames) end ------ 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 local TabCut = {} -- Recupero gli identificativi delle lavorazioni e annullo eventuali allungamenti e Id di altre lavorazioni rappresentate @@ -419,6 +419,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à) if EgtGetOperationPhase( nOperId) == nPhase and ( nType & nOperType) == nOperType 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 bExistName and not ContainsStartName( nOperId, StartNames))) and ( not sInfo or ( bExistInfo and EgtGetInfo( nOperId, sInfo, 'i') == 1) or @@ -535,17 +536,17 @@ local function SortMach( nPhase, PrevMch, nPartId, nType, StartNames, bExistName end ------------------------------------------------------------------------------------------------------------- -local function SortMachinings( nPhase, PrevMch, nPartId, bOnlyPriority) +local function SortMachinings( nPhase, PrevMch, nPartId, nPriority) -- 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 - 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 - 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 - 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 - 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 *** -- PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING, nil, nil, 'MOVE_AFTER', false) -- -- Svuotature *** @@ -553,30 +554,32 @@ local function SortMachinings( nPhase, PrevMch, nPartId, bOnlyPriority) -- -- Fresature che sono rifiniture di spigoli -- PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Clean_'}, false, 'MOVE_AFTER', false, false, true) -- 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 - 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 - 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 - 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 - 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 - 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) - -- Fresature dei lapjoint che necessitano di gorge - PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'SideMill_'}, true, 'MOVE_AFTER', true, false, true, true) - -- Tagli con sega a catena che vanno fatti dopo i tagli con lama - PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MORTISING, { 'Csaw_'}, true) - -- Fresature (puliture di spigoli) che vanno fatte dopo i tagli con lama - PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, nil, nil, 'MOVE_AFTER', true) - -- Forature che vanno fatte dopo i tagli con lama - PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING, nil, nil, 'MOVE_AFTER', true) - -- Svuotature che vanno fatte dopo i tagli con lama - PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.POCKETING, 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) + if not nPriority then + -- Fresature dei lapjoint che necessitano di gorge + PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'SideMill_'}, true, 'MOVE_AFTER', true, false, true, true) + -- Tagli con sega a catena che vanno fatti dopo i tagli con lama + PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MORTISING, { 'Csaw_'}, true) + -- Fresature (puliture di spigoli) che vanno fatte dopo i tagli con lama + PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, nil, nil, 'MOVE_AFTER', true) + -- Forature che vanno fatte dopo i tagli con lama + PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING, nil, nil, 'MOVE_AFTER', true) + -- Svuotature che vanno fatte dopo i tagli con lama + PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.POCKETING, 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 end From 358df3cfdbf9ca39d0c36fc2867076766452a563 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Wed, 24 May 2023 11:48:51 +0200 Subject: [PATCH 06/15] prima versione funzionante completamente --- LuaLibs/WMachiningLib.lua | 8 ++++++++ LuaLibs/WProcessDrill.lua | 4 ++-- LuaLibs/WProcessDtMortise.lua | 4 ++-- LuaLibs/WProcessFreeContour.lua | 22 +++++++++++----------- LuaLibs/WProcessLapJoint.lua | 20 ++++++++++---------- LuaLibs/WProcessMark.lua | 4 ++-- LuaLibs/WProcessMortise.lua | 2 +- LuaLibs/WProcessText.lua | 2 +- LuaLibs/WProcessVariant.lua | 2 +- LuaLibs/WallExec.lua | 1 + 10 files changed, 39 insertions(+), 30 deletions(-) diff --git a/LuaLibs/WMachiningLib.lua b/LuaLibs/WMachiningLib.lua index cb1fd70..ced5592 100644 --- a/LuaLibs/WMachiningLib.lua +++ b/LuaLibs/WMachiningLib.lua @@ -180,5 +180,13 @@ function WMachiningLib.FindSurfacing( sType) end end +--------------------------------------------------------------------- +function WMachiningLib.AddMachining( nProcId, sName, sMachining) + local nMchId, sFinalName = EgtAddMachining( sName, sMachining) + local nPriority = EgtGetInfo( nProcId, 'PRIORITY', 'i') + EgtSetInfo( nMchId, 'PRIORITY', nPriority) + return nMchId, sFinalName +end + ------------------------------------------------------------------------------------------------------------- return WMachiningLib diff --git a/LuaLibs/WProcessDrill.lua b/LuaLibs/WProcessDrill.lua index bd01bb7..92ca899 100644 --- a/LuaLibs/WProcessDrill.lua +++ b/LuaLibs/WProcessDrill.lua @@ -375,7 +375,7 @@ function WPD.Make( Proc, nRawId, b3Raw) end -- inserisco la lavorazione 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.Id, sName, sDrilling) if not nMchId then local sErr = 'Error adding machining ' .. sName .. '-' .. sDrilling EgtOutLog( sErr) @@ -505,7 +505,7 @@ function WPD.Make( Proc, nRawId, b3Raw) -- inserisco la lavorazione local sName = 'PreDrill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - local nMchId = EgtAddMachining( sName, sDrilling) + local nMchId = WM.AddMachining( Proc.Id, sName, sDrilling) if not nMchId then local sErr = 'Error adding machining ' .. sName .. '-' .. sDrilling EgtOutLog( sErr) diff --git a/LuaLibs/WProcessDtMortise.lua b/LuaLibs/WProcessDtMortise.lua index 811e74a..5fc0609 100644 --- a/LuaLibs/WProcessDtMortise.lua +++ b/LuaLibs/WProcessDtMortise.lua @@ -159,7 +159,7 @@ function WPDM.Make( Proc, nRawId, b3Raw) end -- inserisco la lavorazione di svuotatura local sName = 'DtMtPck_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - local nMchFId = EgtAddMachining( sName, sPocketing) + local nMchFId = WM.AddMachining( Proc.Id, sName, sPocketing) if not nMchFId then local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing EgtOutLog( sErr) @@ -189,7 +189,7 @@ function WPDM.Make( Proc, nRawId, b3Raw) for i = nPass, 1, -1 do -- inserisco la lavorazione di contornatura local sNameF = 'DtMt_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( nPass) - local nMchFId = EgtAddMachining( sNameF, sMilling) + local nMchFId = WM.AddMachining( Proc.Id, sNameF, sMilling) if not nMchFId then local sErr = 'Error adding machining ' .. sNameF .. '-' .. sMilling EgtOutLog( sErr) diff --git a/LuaLibs/WProcessFreeContour.lua b/LuaLibs/WProcessFreeContour.lua index d72f34b..2ddf6be 100644 --- a/LuaLibs/WProcessFreeContour.lua +++ b/LuaLibs/WProcessFreeContour.lua @@ -1017,7 +1017,7 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp end -- inserisco la lavorazione local sName = 'Clean_' .. ( EgtGetName( nNewProc) or tostring( nNewProc)) - local nMchId = EgtAddMachining( sName, sMilling) + local nMchId = WM.AddMachining( nNewProc.Id, sName, sMilling) if not nMchId then local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling EgtOutLog( sErr) @@ -1312,7 +1312,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 -- inserisco la lavorazione local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) - local nMchId = EgtAddMachining( sName, sMilling) + local nMchId = WM.AddMachining( Proc.Id, sName, sMilling) if not nMchId then local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling EgtOutLog( sErr) @@ -1406,7 +1406,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 -- inserisco la lavorazione local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) - local nMchId = EgtAddMachining( sName, sMilling) + local nMchId = WM.AddMachining( Proc.Id, sName, sMilling) if not nMchId then local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling EgtOutLog( sErr) @@ -1607,7 +1607,7 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd if vFace[i].Split then -- inserisco la lavorazione local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) .. '_M' - local nMchId = EgtAddMachining( sName, sMilling) + local nMchId = WM.AddMachining( Proc.Id, sName, sMilling) if not nMchId then local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling EgtOutLog( sErr) @@ -1698,7 +1698,7 @@ local function AddSawings( sSawing, vFace, Proc, nRawId, b3Raw) if ( vFace[i].Type & 1) ~= 0 then -- inserisco la lavorazione local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) - local nMchId = EgtAddMachining( sName, sSawing) + local nMchId = WM.AddMachining( Proc.Id, sName, sSawing) if not nMchId then local sErr = 'Error adding machining ' .. sName .. '-' .. sSawing EgtOutLog( sErr) @@ -1746,7 +1746,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 -- inserisco la lavorazione local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) - local nMchId = EgtAddMachining( sName, sSawing) + local nMchId = WM.AddMachining( Proc.Id, sName, sSawing) if not nMchId then local sErr = 'Error adding machining ' .. sName .. '-' .. sSawing EgtOutLog( sErr) @@ -1817,7 +1817,7 @@ local function AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick) local h = EgtIf( i > 1, i - 1, EgtIf( bClosed, #vFace, nil)) -- inserisco la lavorazione local sName = 'Cut_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) .. '_' .. tostring( i) - local nMchId = EgtAddMachining( sName, sCutting) + local nMchId = WM.AddMachining( Proc.Id, sName, sCutting) if not nMchId then local sErr = 'Error adding machining ' .. sName .. '-' .. sCutting EgtOutLog( sErr) @@ -2157,7 +2157,7 @@ local function MakeByMill( Proc, nRawId, b3Raw) end -- inserisco la lavorazione local sName = 'Free_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - local nMchId = EgtAddMachining( sName, sMilling) + local nMchId = WM.AddMachining( Proc.Id, sName, sMilling) if not nMchId then local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling EgtOutLog( sErr) @@ -2259,7 +2259,7 @@ local function MakeByMark( Proc, nRawId, b3Raw) end -- inserisco la lavorazione local sName = 'FreeMark_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - local nMchId = EgtAddMachining( sName, sMilling) + local nMchId = WM.AddMachining( Proc.Id, sName, sMilling) if not nMchId then local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling EgtOutLog( sErr) @@ -2324,7 +2324,7 @@ local function MakeByNail( Proc, nRawId, b3Raw) end -- inserisco la lavorazione local sName = 'Nail_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - local nMchId = EgtAddMachining( sName, sNailing) + local nMchId = WM.AddMachining( Proc.Id, sName, sNailing) if not nMchId then local sErr = 'Error adding machining ' .. sName .. '-' .. sNailing EgtOutLog( sErr) @@ -2463,7 +2463,7 @@ local function MakeByPocket( Proc, nRawId, b3Raw) end -- inserisco la lavorazione di svuotatura local sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - local nMchFId = EgtAddMachining( sName, sPocketing) + local nMchFId = WM.AddMachining( Proc.Id, sName, sPocketing) if not nMchFId then local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing EgtOutLog( sErr) diff --git a/LuaLibs/WProcessLapJoint.lua b/LuaLibs/WProcessLapJoint.lua index 3df915d..8acec71 100644 --- a/LuaLibs/WProcessLapJoint.lua +++ b/LuaLibs/WProcessLapJoint.lua @@ -984,7 +984,7 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp end -- inserisco la lavorazione local sName = 'Clean_' .. ( EgtGetName( nNewProc) or tostring( nNewProc)) - local nMchId = EgtAddMachining( sName, sMilling) + local nMchId = WM.AddMachining( nNewProc.Id, sName, sMilling) if not nMchId then local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling EgtOutLog( sErr) @@ -1275,7 +1275,7 @@ local function MakeByChainSaw( Proc, nFacet, nRawId, b3Raw, dElev, dH, dV) for i = 1, nStep do -- Applico la lavorazione con sega a catena a questa faccia local sName = 'Csaw_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( i) - local nMchFId = EgtAddMachining( sName, sSawing) + local nMchFId = WM.AddMachining( Proc.Id, sName, sSawing) if not nMchFId then local sErr = 'Error adding machining ' .. sName .. '-' .. sSawing EgtOutLog( sErr) @@ -1362,7 +1362,7 @@ local function MakeByMill( Proc, nFacet, nOthFac, nRawId, b3Raw, dSideDist) end -- inserisco la lavorazione di contornatura local sName = 'Mill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - local nMchFId = EgtAddMachining( sName, sMilling) + local nMchFId = WM.AddMachining( Proc.Id, sName, sMilling) if not nMchFId then local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling EgtOutLog( sErr) @@ -1732,7 +1732,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d end -- inserisco la lavorazione di fresatura local sNameGorge = 'Gorge_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. tostring( nFacet) .. '_' .. tostring( nNm) - local nMchFId = EgtAddMachining( sNameGorge, sMillingGorge) + local nMchFId = WM.AddMachining( Proc.Id, sNameGorge, sMillingGorge) if not nMchFId then local sErr = 'Error adding machining ' .. sNameGorge .. '-' .. sMillingGorge EgtOutLog( sErr) @@ -1783,7 +1783,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d nNm = nNm + 1 -- inserisco la lavorazione di taglio sfrido gorge local sNameGorge = 'GorgeCut_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. tostring( nFacet) .. '_' .. tostring( nNm) - local nMchFId = EgtAddMachining( sNameGorge, sCuttingGorge) + local nMchFId = WM.AddMachining( Proc.Id, sNameGorge, sCuttingGorge) if not nMchFId then local sErr = 'Error adding machining ' .. sNameGorge .. '-' .. sCuttingGorge EgtOutLog( sErr) @@ -1842,7 +1842,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d if not bExcludeSideMill then -- inserisco la lavorazione di ribasso o gola local sName = EgtIf( bEnablePreMill ~= nil, 'SideMill_', 'Mill_') .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - local nMchFId = EgtAddMachining( sName, sMilling) + local nMchFId = WM.AddMachining( Proc.Id, sName, sMilling) if not nMchFId then local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling EgtOutLog( sErr) @@ -1966,7 +1966,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d if dAng and dAng > -90 + 10 * GEO.EPS_SMALL and not bExcludeFinishing then -- inserisco la lavorazione di contornatura local sName = 'Mill_Oth_Fac_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - local nMchFId = EgtAddMachining( sName, sMilling) + local nMchFId = WM.AddMachining( Proc.Id, sName, sMilling) if not nMchFId then local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling EgtOutLog( sErr) @@ -2154,7 +2154,7 @@ local function MakeByPocketing( Proc, nFacet, nRawId, b3Raw, bCheckQPar) end -- inserisco la lavorazione di svuotatura local sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - local nMchFId = EgtAddMachining( sName, sPocketing) + local nMchFId = WM.AddMachining( Proc.Id, sName, sPocketing) if not nMchFId then local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing EgtOutLog( sErr) @@ -2231,7 +2231,7 @@ local function MakeOneFace( Proc, nRawId, b3Raw) end -- eseguo il taglio di lama local sName = 'Cut_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) .. '_' .. tostring( Proc.Id) - local nMchId = EgtAddMachining( sName, sCutting) + local nMchId = WM.AddMachining( Proc.Id, sName, sCutting) if not nMchId then local sErr = 'Error adding machining ' .. sName .. '-' .. sCutting EgtOutLog( sErr) @@ -2509,7 +2509,7 @@ local function MakeTwoFaces( Proc, nRawId, b3Raw) for i = 1, 2 do -- inserisco la lavorazione 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.Id, sName, sCutting) if not nMchId then local sErr = 'Error adding machining ' .. sName .. '-' .. sCutting EgtOutLog( sErr) diff --git a/LuaLibs/WProcessMark.lua b/LuaLibs/WProcessMark.lua index c39556c..c4e90db 100644 --- a/LuaLibs/WProcessMark.lua +++ b/LuaLibs/WProcessMark.lua @@ -107,7 +107,7 @@ function WPMK.Make( Proc, nRawId, b3Raw) end -- inserisco la lavorazione di fresatura local sName = 'Decor_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - local nMchFId = EgtAddMachining( sName, sMilling) + local nMchFId = WM.AddMachining( Proc.Id, sName, sMilling) if not nMchFId then local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling EgtOutLog( sErr) @@ -131,7 +131,7 @@ function WPMK.Make( Proc, nRawId, b3Raw) if AuxId then -- inserisco la lavorazione di fresatura local sName2 = 'Decor2_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - local nMchF2Id = EgtAddMachining( sName, sMilling) + local nMchF2Id = WM.AddMachining( Proc.Id, sName, sMilling) if not nMchF2Id then local sErr = 'Error adding machining ' .. sName2 .. '-' .. sMilling EgtOutLog( sErr) diff --git a/LuaLibs/WProcessMortise.lua b/LuaLibs/WProcessMortise.lua index 5082c74..2eb5d09 100644 --- a/LuaLibs/WProcessMortise.lua +++ b/LuaLibs/WProcessMortise.lua @@ -250,7 +250,7 @@ function WPM.Make( Proc, nRawId, b3Raw) end -- inserisco la lavorazione di svuotatura local sName = 'Mort_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - local nMchFId = EgtAddMachining( sName, sPocketing) + local nMchFId = WM.AddMachining( Proc.Id, sName, sPocketing) if not nMchFId then local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing EgtOutLog( sErr) diff --git a/LuaLibs/WProcessText.lua b/LuaLibs/WProcessText.lua index a67651e..2434bdd 100644 --- a/LuaLibs/WProcessText.lua +++ b/LuaLibs/WProcessText.lua @@ -77,7 +77,7 @@ function WPT.Make( Proc, nRawId, b3Raw) end -- inserisco la lavorazione di fresatura local sName = 'Text_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - local nMchFId = EgtAddMachining( sName, sMilling) + local nMchFId = WM.AddMachining( Proc.Id, sName, sMilling) if not nMchFId then local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling EgtOutLog( sErr) diff --git a/LuaLibs/WProcessVariant.lua b/LuaLibs/WProcessVariant.lua index 303be65..8df69c3 100644 --- a/LuaLibs/WProcessVariant.lua +++ b/LuaLibs/WProcessVariant.lua @@ -71,7 +71,7 @@ local function MakeCode_1( Proc, nRawId, b3Raw) end -- inserisco la lavorazione di finitura superficie local sName = 'SurfFin_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - local nMchFId = EgtAddMachining( sName, sSurfFin) + local nMchFId = WM.AddMachining( Proc.Id, sName, sSurfFin) if not nMchFId then local sErr = 'Error adding machining ' .. sName .. '-' .. sSurfFin EgtOutLog( sErr) diff --git a/LuaLibs/WallExec.lua b/LuaLibs/WallExec.lua index 4ffae3d..c96a022 100644 --- a/LuaLibs/WallExec.lua +++ b/LuaLibs/WallExec.lua @@ -652,6 +652,7 @@ function WallExec.ProcessFeatures() local nPriority = EgtGetInfo( nOperId or GDB_ID.NULL, 'PRIORITY', 'i') if nPriority and nPriority ~= 0 then vPriority[nCurrentPriorityId] = nPriority end nCurrentPriorityId = nCurrentPriorityId + 1 + nOperId = EgtGetNextOperation( nOperId) end for i = 1, #vPriority do PrevMch = SortMachinings( nPhase, PrevMch, nil, vPriority[i]) From 1102a7c23a86117a19ab8f8367a835796b3a6a88 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Wed, 24 May 2023 17:45:28 +0200 Subject: [PATCH 07/15] =?UTF-8?q?-aggiunta=20possibilit=C3=A0=20di=20scegl?= =?UTF-8?q?iere=20l'ordine=20del=20sorting=20crescente=20o=20decrescente?= =?UTF-8?q?=20-manca=20costante=20da=20WD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/WallExec.lua | 40 +++++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/LuaLibs/WallExec.lua b/LuaLibs/WallExec.lua index c96a022..7fa059a 100644 --- a/LuaLibs/WallExec.lua +++ b/LuaLibs/WallExec.lua @@ -645,17 +645,35 @@ function WallExec.ProcessFeatures() local nPhase = 1 local PrevMch = EgtGetPhaseDisposition( nPhase) - 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 end - nCurrentPriorityId = nCurrentPriorityId + 1 - nOperId = EgtGetNextOperation( nOperId) - end - for i = 1, #vPriority do - PrevMch = SortMachinings( nPhase, PrevMch, nil, vPriority[i]) + -- 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 = 2 -- TEMP qua costante da WallData!! + 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 SortMachinings( nPhase, PrevMch) From 766bd61981cf6164d07d681320033e75177fff56 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Thu, 25 May 2023 15:58:00 +0200 Subject: [PATCH 08/15] - sistemati commenti - lettura costante BTL_PRIORITY da WallData - altre piccole correzioni --- LuaLibs/WMachiningLib.lua | 6 ++++-- LuaLibs/WProcessDrill.lua | 1 + LuaLibs/WProcessDtMortise.lua | 1 + LuaLibs/WProcessFreeContour.lua | 1 + LuaLibs/WProcessLapJoint.lua | 1 + LuaLibs/WProcessMark.lua | 1 + LuaLibs/WProcessMortise.lua | 1 + LuaLibs/WProcessText.lua | 1 + LuaLibs/WProcessVariant.lua | 1 + LuaLibs/WallExec.lua | 7 ++++--- 10 files changed, 16 insertions(+), 5 deletions(-) diff --git a/LuaLibs/WMachiningLib.lua b/LuaLibs/WMachiningLib.lua index ced5592..5194bc0 100644 --- a/LuaLibs/WMachiningLib.lua +++ b/LuaLibs/WMachiningLib.lua @@ -1,9 +1,10 @@ -- MachiningLib.lua by Egaltech s.r.l. 2022/01/12 -- Libreria ricerca lavorazioni per Pareti - --- Tabella per definizione modulo -- 2023/03/09 Piccola correzione alla SideDepth in FindMilling -- 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. + +-- Tabella per definizione modulo local WMachiningLib = {} -- Include @@ -180,6 +181,7 @@ function WMachiningLib.FindSurfacing( sType) end end +-- incapsulo EgtAddMachining e trascrivo le priorità all'interno delle note della lavorazione --------------------------------------------------------------------- function WMachiningLib.AddMachining( nProcId, sName, sMachining) local nMchId, sFinalName = EgtAddMachining( sName, sMachining) diff --git a/LuaLibs/WProcessDrill.lua b/LuaLibs/WProcessDrill.lua index 92ca899..6ea83a8 100644 --- a/LuaLibs/WProcessDrill.lua +++ b/LuaLibs/WProcessDrill.lua @@ -8,6 +8,7 @@ -- 2022/01/29 DS Corretta gestione ingombro portautensili per fori inclinati da sopra. -- 2022/02/22 ES Aggiunta gestione prefori. -- 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 local WPD = {} diff --git a/LuaLibs/WProcessDtMortise.lua b/LuaLibs/WProcessDtMortise.lua index 5fc0609..b46e387 100644 --- a/LuaLibs/WProcessDtMortise.lua +++ b/LuaLibs/WProcessDtMortise.lua @@ -2,6 +2,7 @@ -- Gestione calcolo mortase a coda di rondine per Pareti -- 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= {} -- Include diff --git a/LuaLibs/WProcessFreeContour.lua b/LuaLibs/WProcessFreeContour.lua index 2ddf6be..1c3c0a7 100644 --- a/LuaLibs/WProcessFreeContour.lua +++ b/LuaLibs/WProcessFreeContour.lua @@ -18,6 +18,7 @@ -- 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/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. -- Tabella per definizione modulo local WPF = {} diff --git a/LuaLibs/WProcessLapJoint.lua b/LuaLibs/WProcessLapJoint.lua index 8acec71..a5ca104 100644 --- a/LuaLibs/WProcessLapJoint.lua +++ b/LuaLibs/WProcessLapJoint.lua @@ -20,6 +20,7 @@ -- 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. -- 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. -- Tabella per definizione modulo local WPL = {} diff --git a/LuaLibs/WProcessMark.lua b/LuaLibs/WProcessMark.lua index c4e90db..507d56b 100644 --- a/LuaLibs/WProcessMark.lua +++ b/LuaLibs/WProcessMark.lua @@ -1,6 +1,7 @@ -- WProcessMark.lua by Egaltech s.r.l. 2021/04/20 -- 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/05/25 Funzioni EgtAddMachining sostituite da WM.AddMachining in modo da trascrivere le priorità da btl alle lavorazioni. -- Tabella per definizione modulo local WPMK = {} diff --git a/LuaLibs/WProcessMortise.lua b/LuaLibs/WProcessMortise.lua index 2eb5d09..3f1bd96 100644 --- a/LuaLibs/WProcessMortise.lua +++ b/LuaLibs/WProcessMortise.lua @@ -1,6 +1,7 @@ -- WProcessMortise.lua by Egaltech s.r.l. 2021/07/30 -- 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/05/25 Funzioni EgtAddMachining sostituite da WM.AddMachining in modo da trascrivere le priorità da btl alle lavorazioni. -- Tabella per definizione modulo local WPM = {} diff --git a/LuaLibs/WProcessText.lua b/LuaLibs/WProcessText.lua index 2434bdd..9d450b9 100644 --- a/LuaLibs/WProcessText.lua +++ b/LuaLibs/WProcessText.lua @@ -1,5 +1,6 @@ -- WProcessText.lua by Egaltech s.r.l. 2021/04/20 -- 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 local WPT = {} diff --git a/LuaLibs/WProcessVariant.lua b/LuaLibs/WProcessVariant.lua index 8df69c3..51dff18 100644 --- a/LuaLibs/WProcessVariant.lua +++ b/LuaLibs/WProcessVariant.lua @@ -1,5 +1,6 @@ -- WProcessVariant.lua by Egaltech s.r.l. 2021/08/27 -- 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 local WPV = {} diff --git a/LuaLibs/WallExec.lua b/LuaLibs/WallExec.lua index 7fa059a..6ec9912 100644 --- a/LuaLibs/WallExec.lua +++ b/LuaLibs/WallExec.lua @@ -1,5 +1,6 @@ -- WallExec.lua by Egaltech s.r.l. 2023/03/06 -- Libreria esecuzione lavorazioni per Pareti +-- 2023/05/25 Aggiunto ordinamento in base a prioritò da btl. -- Tabella per definizione modulo local WallExec = {} @@ -647,7 +648,7 @@ function WallExec.ProcessFeatures() -- 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 = 2 -- TEMP qua costante da WallData!! + local nGetPriorityFromBtl = WD.BTL_PRIORITY or 0 if nGetPriorityFromBtl > 0 then local vPriority = {} local nOperId = EgtGetNextOperation( PrevMch) @@ -670,9 +671,9 @@ function WallExec.ProcessFeatures() end -- riordino le lavorazioni per priorità for i = 1, #vPriority do - -- if i == 1 or ( vPriority[i] ~= vPriority[i - 1]) then + if i == 1 or ( vPriority[i] ~= vPriority[i - 1]) then PrevMch = SortMachinings( nPhase, PrevMch, nil, vPriority[i]) - -- end + end end end From eeb34638cf981433e92a4983c6599a35eb534586 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Fri, 26 May 2023 18:12:53 +0200 Subject: [PATCH 09/15] - da testare funzionamento corretto - da implementare step verticali --- LuaLibs/WProcessFreeContour.lua | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/LuaLibs/WProcessFreeContour.lua b/LuaLibs/WProcessFreeContour.lua index 1c3c0a7..df6a386 100644 --- a/LuaLibs/WProcessFreeContour.lua +++ b/LuaLibs/WProcessFreeContour.lua @@ -67,6 +67,7 @@ function WPF.Classify( Proc, b3Raw) local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) -- recupero il tipo di lavorazione local nCntType = EgtGetInfo( Proc.Id, 'CNT_TYPE', 'i') or 0 + local nTool_ID = EgtGetInfo( Proc.Id, 'CNT_DATA', 'i') or 0 -- se tasca if bPocket then -- cerco la faccia di fondo della superfice (deve avere direzione circa quella di estrusione della curva) @@ -87,10 +88,10 @@ function WPF.Classify( Proc, b3Raw) -- se penna o chiodatura va sempre bene (vengono sempre riportati sopra) elseif nCntType == 10 or nCntType == 20 then return true - -- se altrimenti profilo verticale che non interessa tutta la sezione - elseif Proc.Box:getMax():getZ() < b3Raw:getMax():getZ() - 2 then + -- 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) and ( ( not nTool_ID == WD.RECESSED_COUNTERBORE_TOOLID) or ( not EgtCurveIsACircle( AuxId))) then 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 return true end @@ -2185,6 +2186,25 @@ local function MakeByMill( Proc, nRawId, b3Raw) elseif ( Proc.Grp == 3 and bToolInv) or ( Proc.Grp == 4 and not bToolInv) then EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) 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) 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) + end -- posizione braccio porta testa local nSCC = MCH_SCC.ADIR_ZP if AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then From d020fa143c4e76716cbc7834cb17024abf5a2f2a Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Mon, 29 May 2023 18:01:59 +0200 Subject: [PATCH 10/15] - aggiunta gestione step verticale - correzioni minori --- LuaLibs/WProcessFreeContour.lua | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/LuaLibs/WProcessFreeContour.lua b/LuaLibs/WProcessFreeContour.lua index df6a386..17a2fd2 100644 --- a/LuaLibs/WProcessFreeContour.lua +++ b/LuaLibs/WProcessFreeContour.lua @@ -89,7 +89,7 @@ function WPF.Classify( Proc, b3Raw) elseif nCntType == 10 or nCntType == 20 then return true -- 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) and ( ( not nTool_ID == WD.RECESSED_COUNTERBORE_TOOLID) or ( not EgtCurveIsACircle( AuxId))) then + elseif ( Proc.Box:getMax():getZ() < b3Raw:getMax():getZ() - 2) and ( ( not nTool_ID == ( WD.RECESSED_COUNTERBORE_TOOLID or 0)) or ( not EgtCurveIsACircle( AuxId))) then return false -- altrimenti è profilo verticale che interessa tutta la sezione o caso speciale con lamatura affondata else @@ -101,8 +101,8 @@ end -- Classificazione del flip della feature per nesting -- return nFlip0, nFlip1 function WPF.FlipClassify( Proc, b3Raw) - local nFlip0 = 0 - local nFlip1 = 0 + local nFlip0 = 0 + local nFlip1 = 0 -- verifico se di tipo pocket local bPocket = ( EgtGetInfo( Proc.Id, 'PCKT', 'i') == 1) @@ -2187,8 +2187,8 @@ local function MakeByMill( Proc, nRawId, b3Raw) EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) 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) and + 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) @@ -2204,6 +2204,16 @@ local function MakeByMill( Proc, nRawId, b3Raw) 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 + EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMaxElev, 1) .. ';') end -- posizione braccio porta testa local nSCC = MCH_SCC.ADIR_ZP From b0b8e88c30c639343f2929b1d5a07ea6404be43f Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Tue, 6 Jun 2023 12:54:35 +0200 Subject: [PATCH 11/15] - Alcune correzioni minori - Sistemati commenti --- LuaLibs/WProcessFreeContour.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/LuaLibs/WProcessFreeContour.lua b/LuaLibs/WProcessFreeContour.lua index 17a2fd2..1a08ea3 100644 --- a/LuaLibs/WProcessFreeContour.lua +++ b/LuaLibs/WProcessFreeContour.lua @@ -19,6 +19,7 @@ -- 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/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. -- Tabella per definizione modulo local WPF = {} @@ -67,7 +68,7 @@ function WPF.Classify( Proc, b3Raw) local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) -- recupero il tipo di lavorazione local nCntType = EgtGetInfo( Proc.Id, 'CNT_TYPE', 'i') or 0 - local nTool_ID = EgtGetInfo( Proc.Id, 'CNT_DATA', 'i') or 0 + local nTool_ID = EgtGetInfo( Proc.Id, 'CNT_DATA', 'i') -- se tasca if bPocket then -- cerco la faccia di fondo della superfice (deve avere direzione circa quella di estrusione della curva) @@ -89,7 +90,7 @@ function WPF.Classify( Proc, b3Raw) elseif nCntType == 10 or nCntType == 20 then return true -- 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) and ( ( not nTool_ID == ( WD.RECESSED_COUNTERBORE_TOOLID or 0)) or ( not EgtCurveIsACircle( AuxId))) 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 -- altrimenti è profilo verticale che interessa tutta la sezione o caso speciale con lamatura affondata else @@ -2186,6 +2187,7 @@ local function MakeByMill( Proc, nRawId, b3Raw) elseif ( Proc.Grp == 3 and bToolInv) or ( Proc.Grp == 4 and not bToolInv) then EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) 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 @@ -2215,6 +2217,7 @@ local function MakeByMill( Proc, nRawId, b3Raw) -- imposto elevazione EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMaxElev, 1) .. ';') end + -- posizione braccio porta testa local nSCC = MCH_SCC.ADIR_ZP if AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then From de9fa79f8ad2715b079bdd3fd279ffb21bf7b76e Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Wed, 7 Jun 2023 18:28:12 +0200 Subject: [PATCH 12/15] =?UTF-8?q?-=20negli=20outline=20con=20priorit=C3=A0?= =?UTF-8?q?=20da=20btl=20aggiunta=20la=20rimozione=20sfridi=20per=20la=20l?= =?UTF-8?q?avorazione=20successiva?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/WMachiningLib.lua | 8 +++++--- LuaLibs/WProcessDrill.lua | 4 ++-- LuaLibs/WProcessDtMortise.lua | 4 ++-- LuaLibs/WProcessFreeContour.lua | 26 +++++++++++++------------- LuaLibs/WProcessLapJoint.lua | 20 ++++++++++---------- LuaLibs/WProcessMark.lua | 4 ++-- LuaLibs/WProcessMortise.lua | 2 +- LuaLibs/WProcessText.lua | 2 +- LuaLibs/WProcessVariant.lua | 2 +- LuaLibs/WallExec.lua | 33 ++++++++++++++++++++++++++++++--- 10 files changed, 67 insertions(+), 38 deletions(-) diff --git a/LuaLibs/WMachiningLib.lua b/LuaLibs/WMachiningLib.lua index 5194bc0..d5a346c 100644 --- a/LuaLibs/WMachiningLib.lua +++ b/LuaLibs/WMachiningLib.lua @@ -3,6 +3,7 @@ -- 2023/03/09 Piccola correzione alla SideDepth in FindMilling -- 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 = {} @@ -181,12 +182,13 @@ function WMachiningLib.FindSurfacing( sType) end end --- incapsulo EgtAddMachining e trascrivo le priorità all'interno delle note della lavorazione +-- incapsulo EgtAddMachining e trascrivo alcune informazioni utili nelle note dell'operazione --------------------------------------------------------------------- -function WMachiningLib.AddMachining( nProcId, sName, sMachining) +function WMachiningLib.AddMachining( Proc, sName, sMachining) local nMchId, sFinalName = EgtAddMachining( sName, sMachining) - local nPriority = EgtGetInfo( nProcId, 'PRIORITY', 'i') + local nPriority = EgtGetInfo( Proc.Id, 'PRIORITY', 'i') EgtSetInfo( nMchId, 'PRIORITY', nPriority) + EgtSetInfo( nMchId, 'ISOUTLINE', Proc.IsOutline) return nMchId, sFinalName end diff --git a/LuaLibs/WProcessDrill.lua b/LuaLibs/WProcessDrill.lua index 6ea83a8..6865dc9 100644 --- a/LuaLibs/WProcessDrill.lua +++ b/LuaLibs/WProcessDrill.lua @@ -376,7 +376,7 @@ function WPD.Make( Proc, nRawId, b3Raw) end -- inserisco la lavorazione local sName = EgtIf( sHead == 'H5' or sHead == 'H6', 'LhDrill_', 'Drill_') .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - local nMchId = WM.AddMachining( Proc.Id, sName, sDrilling) + local nMchId = WM.AddMachining( Proc, sName, sDrilling) if not nMchId then local sErr = 'Error adding machining ' .. sName .. '-' .. sDrilling EgtOutLog( sErr) @@ -506,7 +506,7 @@ function WPD.Make( Proc, nRawId, b3Raw) -- inserisco la lavorazione local sName = 'PreDrill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - local nMchId = WM.AddMachining( Proc.Id, sName, sDrilling) + local nMchId = WM.AddMachining( Proc, sName, sDrilling) if not nMchId then local sErr = 'Error adding machining ' .. sName .. '-' .. sDrilling EgtOutLog( sErr) diff --git a/LuaLibs/WProcessDtMortise.lua b/LuaLibs/WProcessDtMortise.lua index b46e387..360565b 100644 --- a/LuaLibs/WProcessDtMortise.lua +++ b/LuaLibs/WProcessDtMortise.lua @@ -160,7 +160,7 @@ function WPDM.Make( Proc, nRawId, b3Raw) end -- inserisco la lavorazione di svuotatura local sName = 'DtMtPck_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - local nMchFId = WM.AddMachining( Proc.Id, sName, sPocketing) + local nMchFId = WM.AddMachining( Proc, sName, sPocketing) if not nMchFId then local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing EgtOutLog( sErr) @@ -190,7 +190,7 @@ function WPDM.Make( Proc, nRawId, b3Raw) for i = nPass, 1, -1 do -- inserisco la lavorazione di contornatura local sNameF = 'DtMt_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( nPass) - local nMchFId = WM.AddMachining( Proc.Id, sNameF, sMilling) + local nMchFId = WM.AddMachining( Proc, sNameF, sMilling) if not nMchFId then local sErr = 'Error adding machining ' .. sNameF .. '-' .. sMilling EgtOutLog( sErr) diff --git a/LuaLibs/WProcessFreeContour.lua b/LuaLibs/WProcessFreeContour.lua index 1a08ea3..52e3dc8 100644 --- a/LuaLibs/WProcessFreeContour.lua +++ b/LuaLibs/WProcessFreeContour.lua @@ -1020,7 +1020,7 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp end -- inserisco la lavorazione local sName = 'Clean_' .. ( EgtGetName( nNewProc) or tostring( nNewProc)) - local nMchId = WM.AddMachining( nNewProc.Id, sName, sMilling) + local nMchId = WM.AddMachining( nNewProc, sName, sMilling) if not nMchId then local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling EgtOutLog( sErr) @@ -1315,7 +1315,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 -- inserisco la lavorazione local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) - local nMchId = WM.AddMachining( Proc.Id, sName, sMilling) + local nMchId = WM.AddMachining( Proc, sName, sMilling) if not nMchId then local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling EgtOutLog( sErr) @@ -1409,7 +1409,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 -- inserisco la lavorazione local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) - local nMchId = WM.AddMachining( Proc.Id, sName, sMilling) + local nMchId = WM.AddMachining( Proc, sName, sMilling) if not nMchId then local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling EgtOutLog( sErr) @@ -1610,7 +1610,7 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd if vFace[i].Split then -- inserisco la lavorazione local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) .. '_M' - local nMchId = WM.AddMachining( Proc.Id, sName, sMilling) + local nMchId = WM.AddMachining( Proc, sName, sMilling) if not nMchId then local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling EgtOutLog( sErr) @@ -1701,7 +1701,7 @@ local function AddSawings( sSawing, vFace, Proc, nRawId, b3Raw) if ( vFace[i].Type & 1) ~= 0 then -- inserisco la lavorazione local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) - local nMchId = WM.AddMachining( Proc.Id, sName, sSawing) + local nMchId = WM.AddMachining( Proc, sName, sSawing) if not nMchId then local sErr = 'Error adding machining ' .. sName .. '-' .. sSawing EgtOutLog( sErr) @@ -1749,7 +1749,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 -- inserisco la lavorazione local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) - local nMchId = WM.AddMachining( Proc.Id, sName, sSawing) + local nMchId = WM.AddMachining( Proc, sName, sSawing) if not nMchId then local sErr = 'Error adding machining ' .. sName .. '-' .. sSawing EgtOutLog( sErr) @@ -1820,7 +1820,7 @@ local function AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick) local h = EgtIf( i > 1, i - 1, EgtIf( bClosed, #vFace, nil)) -- inserisco la lavorazione local sName = 'Cut_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) .. '_' .. tostring( i) - local nMchId = WM.AddMachining( Proc.Id, sName, sCutting) + local nMchId = WM.AddMachining( Proc, sName, sCutting) if not nMchId then local sErr = 'Error adding machining ' .. sName .. '-' .. sCutting EgtOutLog( sErr) @@ -2160,7 +2160,7 @@ local function MakeByMill( Proc, nRawId, b3Raw) end -- inserisco la lavorazione local sName = 'Free_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - local nMchId = WM.AddMachining( Proc.Id, sName, sMilling) + local nMchId = WM.AddMachining( Proc, sName, sMilling) if not nMchId then local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling EgtOutLog( sErr) @@ -2214,8 +2214,8 @@ local function MakeByMill( Proc, nRawId, b3Raw) 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 - EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMaxElev, 1) .. ';') + -- imposto elevazione e forzo attacco dal lato aperto + EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMaxElev, 1) .. ';OutRaw=3;') end -- posizione braccio porta testa @@ -2293,7 +2293,7 @@ local function MakeByMark( Proc, nRawId, b3Raw) end -- inserisco la lavorazione local sName = 'FreeMark_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - local nMchId = WM.AddMachining( Proc.Id, sName, sMilling) + local nMchId = WM.AddMachining( Proc, sName, sMilling) if not nMchId then local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling EgtOutLog( sErr) @@ -2358,7 +2358,7 @@ local function MakeByNail( Proc, nRawId, b3Raw) end -- inserisco la lavorazione local sName = 'Nail_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - local nMchId = WM.AddMachining( Proc.Id, sName, sNailing) + local nMchId = WM.AddMachining( Proc, sName, sNailing) if not nMchId then local sErr = 'Error adding machining ' .. sName .. '-' .. sNailing EgtOutLog( sErr) @@ -2497,7 +2497,7 @@ local function MakeByPocket( Proc, nRawId, b3Raw) end -- inserisco la lavorazione di svuotatura local sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - local nMchFId = WM.AddMachining( Proc.Id, sName, sPocketing) + local nMchFId = WM.AddMachining( Proc, sName, sPocketing) if not nMchFId then local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing EgtOutLog( sErr) diff --git a/LuaLibs/WProcessLapJoint.lua b/LuaLibs/WProcessLapJoint.lua index a5ca104..64f92f3 100644 --- a/LuaLibs/WProcessLapJoint.lua +++ b/LuaLibs/WProcessLapJoint.lua @@ -985,7 +985,7 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp end -- inserisco la lavorazione local sName = 'Clean_' .. ( EgtGetName( nNewProc) or tostring( nNewProc)) - local nMchId = WM.AddMachining( nNewProc.Id, sName, sMilling) + local nMchId = WM.AddMachining( nNewProc, sName, sMilling) if not nMchId then local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling EgtOutLog( sErr) @@ -1276,7 +1276,7 @@ local function MakeByChainSaw( Proc, nFacet, nRawId, b3Raw, dElev, dH, dV) for i = 1, nStep do -- Applico la lavorazione con sega a catena a questa faccia local sName = 'Csaw_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( i) - local nMchFId = WM.AddMachining( Proc.Id, sName, sSawing) + local nMchFId = WM.AddMachining( Proc, sName, sSawing) if not nMchFId then local sErr = 'Error adding machining ' .. sName .. '-' .. sSawing EgtOutLog( sErr) @@ -1363,7 +1363,7 @@ local function MakeByMill( Proc, nFacet, nOthFac, nRawId, b3Raw, dSideDist) end -- inserisco la lavorazione di contornatura local sName = 'Mill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - local nMchFId = WM.AddMachining( Proc.Id, sName, sMilling) + local nMchFId = WM.AddMachining( Proc, sName, sMilling) if not nMchFId then local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling EgtOutLog( sErr) @@ -1733,7 +1733,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d end -- inserisco la lavorazione di fresatura local sNameGorge = 'Gorge_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. tostring( nFacet) .. '_' .. tostring( nNm) - local nMchFId = WM.AddMachining( Proc.Id, sNameGorge, sMillingGorge) + local nMchFId = WM.AddMachining( Proc, sNameGorge, sMillingGorge) if not nMchFId then local sErr = 'Error adding machining ' .. sNameGorge .. '-' .. sMillingGorge EgtOutLog( sErr) @@ -1784,7 +1784,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d nNm = nNm + 1 -- inserisco la lavorazione di taglio sfrido gorge local sNameGorge = 'GorgeCut_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. tostring( nFacet) .. '_' .. tostring( nNm) - local nMchFId = WM.AddMachining( Proc.Id, sNameGorge, sCuttingGorge) + local nMchFId = WM.AddMachining( Proc, sNameGorge, sCuttingGorge) if not nMchFId then local sErr = 'Error adding machining ' .. sNameGorge .. '-' .. sCuttingGorge EgtOutLog( sErr) @@ -1843,7 +1843,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d if not bExcludeSideMill then -- inserisco la lavorazione di ribasso o gola local sName = EgtIf( bEnablePreMill ~= nil, 'SideMill_', 'Mill_') .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - local nMchFId = WM.AddMachining( Proc.Id, sName, sMilling) + local nMchFId = WM.AddMachining( Proc, sName, sMilling) if not nMchFId then local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling EgtOutLog( sErr) @@ -1967,7 +1967,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d if dAng and dAng > -90 + 10 * GEO.EPS_SMALL and not bExcludeFinishing then -- inserisco la lavorazione di contornatura local sName = 'Mill_Oth_Fac_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - local nMchFId = WM.AddMachining( Proc.Id, sName, sMilling) + local nMchFId = WM.AddMachining( Proc, sName, sMilling) if not nMchFId then local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling EgtOutLog( sErr) @@ -2155,7 +2155,7 @@ local function MakeByPocketing( Proc, nFacet, nRawId, b3Raw, bCheckQPar) end -- inserisco la lavorazione di svuotatura local sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - local nMchFId = WM.AddMachining( Proc.Id, sName, sPocketing) + local nMchFId = WM.AddMachining( Proc, sName, sPocketing) if not nMchFId then local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing EgtOutLog( sErr) @@ -2232,7 +2232,7 @@ local function MakeOneFace( Proc, nRawId, b3Raw) end -- eseguo il taglio di lama local sName = 'Cut_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) .. '_' .. tostring( Proc.Id) - local nMchId = WM.AddMachining( Proc.Id, sName, sCutting) + local nMchId = WM.AddMachining( Proc, sName, sCutting) if not nMchId then local sErr = 'Error adding machining ' .. sName .. '-' .. sCutting EgtOutLog( sErr) @@ -2510,7 +2510,7 @@ local function MakeTwoFaces( Proc, nRawId, b3Raw) for i = 1, 2 do -- inserisco la lavorazione local sName = 'Cut_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) .. '_' .. tostring( Proc.Id) .. '_' .. tostring( i) - local nMchId = WM.AddMachining( Proc.Id, sName, sCutting) + local nMchId = WM.AddMachining( Proc, sName, sCutting) if not nMchId then local sErr = 'Error adding machining ' .. sName .. '-' .. sCutting EgtOutLog( sErr) diff --git a/LuaLibs/WProcessMark.lua b/LuaLibs/WProcessMark.lua index 507d56b..d54c802 100644 --- a/LuaLibs/WProcessMark.lua +++ b/LuaLibs/WProcessMark.lua @@ -108,7 +108,7 @@ function WPMK.Make( Proc, nRawId, b3Raw) end -- inserisco la lavorazione di fresatura local sName = 'Decor_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - local nMchFId = WM.AddMachining( Proc.Id, sName, sMilling) + local nMchFId = WM.AddMachining( Proc, sName, sMilling) if not nMchFId then local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling EgtOutLog( sErr) @@ -132,7 +132,7 @@ function WPMK.Make( Proc, nRawId, b3Raw) if AuxId then -- inserisco la lavorazione di fresatura local sName2 = 'Decor2_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - local nMchF2Id = WM.AddMachining( Proc.Id, sName, sMilling) + local nMchF2Id = WM.AddMachining( Proc, sName, sMilling) if not nMchF2Id then local sErr = 'Error adding machining ' .. sName2 .. '-' .. sMilling EgtOutLog( sErr) diff --git a/LuaLibs/WProcessMortise.lua b/LuaLibs/WProcessMortise.lua index 3f1bd96..27d9e99 100644 --- a/LuaLibs/WProcessMortise.lua +++ b/LuaLibs/WProcessMortise.lua @@ -251,7 +251,7 @@ function WPM.Make( Proc, nRawId, b3Raw) end -- inserisco la lavorazione di svuotatura local sName = 'Mort_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - local nMchFId = WM.AddMachining( Proc.Id, sName, sPocketing) + local nMchFId = WM.AddMachining( Proc, sName, sPocketing) if not nMchFId then local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing EgtOutLog( sErr) diff --git a/LuaLibs/WProcessText.lua b/LuaLibs/WProcessText.lua index 9d450b9..cbc6c4b 100644 --- a/LuaLibs/WProcessText.lua +++ b/LuaLibs/WProcessText.lua @@ -78,7 +78,7 @@ function WPT.Make( Proc, nRawId, b3Raw) end -- inserisco la lavorazione di fresatura local sName = 'Text_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - local nMchFId = WM.AddMachining( Proc.Id, sName, sMilling) + local nMchFId = WM.AddMachining( Proc, sName, sMilling) if not nMchFId then local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling EgtOutLog( sErr) diff --git a/LuaLibs/WProcessVariant.lua b/LuaLibs/WProcessVariant.lua index 51dff18..2de64a0 100644 --- a/LuaLibs/WProcessVariant.lua +++ b/LuaLibs/WProcessVariant.lua @@ -72,7 +72,7 @@ local function MakeCode_1( Proc, nRawId, b3Raw) end -- inserisco la lavorazione di finitura superficie local sName = 'SurfFin_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - local nMchFId = WM.AddMachining( Proc.Id, sName, sSurfFin) + local nMchFId = WM.AddMachining( Proc, sName, sSurfFin) if not nMchFId then local sErr = 'Error adding machining ' .. sName .. '-' .. sSurfFin EgtOutLog( sErr) diff --git a/LuaLibs/WallExec.lua b/LuaLibs/WallExec.lua index 6ec9912..a75e33f 100644 --- a/LuaLibs/WallExec.lua +++ b/LuaLibs/WallExec.lua @@ -1,6 +1,7 @@ -- WallExec.lua by Egaltech s.r.l. 2023/03/06 -- Libreria esecuzione lavorazioni per Pareti --- 2023/05/25 Aggiunto ordinamento in base a prioritò da btl. +-- 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. -- Tabella per definizione modulo local WallExec = {} @@ -180,7 +181,8 @@ function WallExec.CollectFeatures( PartId, b3Raw) Proc.CutId = nCutId Proc.TaskId = nTaskId Proc.Box = EgtGetBBoxGlob( ProcId, GDB_BB.STANDARD) - if Proc.Box and not Proc.Box:isEmpty() then + Proc.IsOutline = ( Proc.Prc == 251 or Proc.Prc == 252) + if Proc.Box and not Proc.Box:isEmpty() then table.insert( vProc, Proc) -- se foro if Drill.Identify( Proc) then @@ -584,6 +586,27 @@ local function SortMachinings( nPhase, PrevMch, nPartId, nPriority) return PrevMch 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' ) > 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) +end + ------------------------------------------------------------------------------------------------------------- function WallExec.ProcessFeatures() -- errori e stato @@ -676,9 +699,13 @@ function WallExec.ProcessFeatures() end end end - + -- ordinamento standard SortMachinings( nPhase, PrevMch) + -- Aggiornamento finale di tutto + if nGetPriorityFromBtl > 0 then + InsertScrapRemoval( nPhase) + end EgtSetCurrPhase( 1) EgtApplyAllMachinings() -- altrimenti macchina travi From 4f1c652dc0b815c2f191a65e004b584e227a32b8 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Thu, 8 Jun 2023 15:01:18 +0200 Subject: [PATCH 13/15] =?UTF-8?q?-=20fix=20minore=20per=20priorit=C3=A0=20?= =?UTF-8?q?da=20btl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/WallExec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LuaLibs/WallExec.lua b/LuaLibs/WallExec.lua index a75e33f..72c9bfe 100644 --- a/LuaLibs/WallExec.lua +++ b/LuaLibs/WallExec.lua @@ -593,7 +593,7 @@ function InsertScrapRemoval( 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' ) > 0) + 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 From 47b3298e89894b15b18ad1938158f54b196543bf Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Tue, 13 Jun 2023 09:55:28 +0200 Subject: [PATCH 14/15] modifica GetWallData per passare costante BTL_PRIORITY all'interfaccia --- GetWallData.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/GetWallData.lua b/GetWallData.lua index a67dc67..f7ce4a3 100644 --- a/GetWallData.lua +++ b/GetWallData.lua @@ -43,6 +43,7 @@ GWD.NESTING_CORNER = WD.NESTING_CORNER GWD.HOR_DRILL_DIAM = WD.HOR_DRILL_DIAM GWD.MIN_HEIGHT = WD.MIN_HEIGHT GWD.MAX_HEIGHT = WD.MAX_HEIGHT +GWD.BTL_PRIORITY = WD.BTL_PRIORITY -- Tutto ok GWD.ERR = 0 From f9f6462dc2492cbde1d9b76d15d91c7a8ec11670 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Tue, 13 Jun 2023 10:00:51 +0200 Subject: [PATCH 15/15] update log e version --- UpdateLog.txt | 7 +++++++ Version.lua | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/UpdateLog.txt b/UpdateLog.txt index 74b47a6..7c5db0c 100644 --- a/UpdateLog.txt +++ b/UpdateLog.txt @@ -1,5 +1,12 @@ ==== Wall Update Log ==== +Versione 2.5f1 (13/03/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) diff --git a/Version.lua b/Version.lua index c8d92f7..fe1ce2d 100644 --- a/Version.lua +++ b/Version.lua @@ -2,5 +2,5 @@ -- Gestione della versione di Wall NAME = 'Wall' -VERSION = '2.5e1' +VERSION = '2.5f1' MIN_EXE = '2.5b3'