DataWall :

- aggiunta gestione speciale forature orizzonatli per sort ad hoc
- in foratura aggiunta gestione flag Q01 per forzare solo contornatura.
This commit is contained in:
DarioS
2022-01-20 09:30:18 +01:00
parent 62077f616b
commit 248fce3758
2 changed files with 20 additions and 8 deletions
+12 -4
View File
@@ -1,8 +1,10 @@
-- WProcessDrill.lua by Egaltech s.r.l. 2022/01/12
-- WProcessDrill.lua by Egaltech s.r.l. 2022/01/20
-- Gestione calcolo forature per Pareti
-- 2021/08/29 DS Se foratura di fianco setto flag per farla dopo i tagli.
-- 2021/12/04 DS Modifiche per forature speciali lungo Y.
-- 2022/01/12 DS Se con fresatura richiedo che l'utensile possa lavorare di testa.
-- 2022/01/19 DS Forature orizzontali lunghe con nome LhDrill_.
-- 2022/01/20 DS Aggiunta gestione Q01 (flag forzatura solo contornatura).
-- Tabella per definizione modulo
local WPD = {}
@@ -16,6 +18,10 @@ EgtOutLog( ' WProcessDrill started', 1)
local WD = require( 'WallData')
local WM = require( 'WMachiningLib')
-- Parametri Q
local sContourOnly = 'Q01' -- 0=no, 1=si
---------------------------------------------------------------------
-- Riconoscimento della feature
function WPD.Identify( Proc)
@@ -252,10 +258,12 @@ function WPD.Make( Proc, nRawId, b3Raw)
if Proc.Fcs == 0 then bToInvert = true end
-- se richiesta inversione, inverto versore di riferimento
if bToInvert then vtExtr = - vtExtr end
-- recupero la lavorazione
-- recupero eventuale flag per fare sola contornatura
local nContourOnly = ( EgtGetInfo( Proc.Id, sContourOnly, 'i') or 0)
-- recupero la lavorazione (foratura/svuotatura oppure contornatura)
local sDrilling, nType
local sHead
if dDiam < 200 then
if nContourOnly ~= 1 then
if WD.HOR_DRILL_Y_SPLIT and AreSameOrOppositeVectorApprox( vtExtr, Y_AX()) then
local dExtrY = vtExtr:getY()
if not bOpen or abs( Proc.Flg) == 2 then
@@ -338,7 +346,7 @@ function WPD.Make( Proc, nRawId, b3Raw)
end
end
-- inserisco la lavorazione
local sName = '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)
if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sDrilling
+8 -4
View File
@@ -351,7 +351,7 @@ local function MoveMachiningsAtEnd( nPhase, nType, sStartName, sProperty)
end
------ Ordinamento dei tagli, delle fresature e delle forature -------
local function SortMach( nPhase, PrevMch, nPartId, nType, sStartName, bExistName, sInfo, bExistInfo)
local function SortMach( nPhase, PrevMch, nPartId, nType, sStartName, bExistName, sInfo, bExistInfo, bOneWay)
-- dichiarazione tabella
local TabCut = {}
-- Recupero gli identificativi delle lavorazioni e annullo eventuali allungamenti e Id di altre lavorazioni rappresentate
@@ -377,9 +377,9 @@ local function SortMach( nPhase, PrevMch, nPartId, nType, sStartName, bExistName
nOperId = EgtGetNextOperation( nOperId)
end
-- ordino le lavorazioni (in gruppi di max 1000 entità)
-- ordino le lavorazioni (in gruppi di max 1000 entità se 32bit 10000 se 64bit)
--EgtOutLog('Dati per ShortestPath :')
local SP_MAX_ENT = 10000
local SP_MAX_ENT = EgtIf( EgtIs64bit(), 10000, 1000)
local nBase = 0
while nBase < #TabCut do
-- calcolo ordinamento
@@ -395,7 +395,9 @@ local function SortMach( nPhase, PrevMch, nPartId, nType, sStartName, bExistName
if WD.BEAM_MACHINE and nType == MCH_OY.SAWING then
EgtSpSetOpenBound( false, SHP_OB.NEAR_PNT, -50000, 0, 0, 0, 0)
end
local vOrd = EgtSpCalculate( SHP_TY.OPEN)
EgtSpSetZzOwStep( 10)
local nType = EgtIf( bOneWay, SHP_TY.ONEWAY_YM, SHP_TY.OPEN)
local vOrd = EgtSpCalculate( nType)
EgtSpTerminate()
-- applico ordinamento calcolato
if vOrd then
@@ -417,6 +419,8 @@ local function SortMachinings( nPhase, PrevMch, nPartId)
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, 'Nail_', true)
-- Tagli con sega a catena che sono rifiniture di spigoli
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MORTISING, 'Csaw_', false)
-- Forature orizzontali con punte lunghe
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING, 'LhDrill_', true, 'MOVE_AFTER', false, true)
-- Forature
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING, nil, nil, 'MOVE_AFTER', false)
-- Svuotature