DataWall :

- varie modifiche per cliente belga.
This commit is contained in:
DarioS
2021-12-07 11:05:58 +01:00
parent f7bba936ca
commit 943ccea2a8
7 changed files with 521 additions and 467 deletions
+3 -1
View File
@@ -21,7 +21,7 @@ EgtAddToPackagePath( sBaseDir .. 'LuaLibs\\?.lua')
local sMachDir = EgtGetCurrMachineDir()
if not EgtExistsFile( sMachDir .. '\\Wall\\WallData.lua') then
GWD.ERR = 12
GWD.MSG = 'Error not configured for walls machine : ' .. sMachine
GWD.MSG = 'Error not configured for walls machine : ' .. GWD.MACHINE
WriteErrToLogFile( GWD.ERR, GWD.MSG)
PostErrView( GWD.ERR, GWD.MSG)
return
@@ -35,7 +35,9 @@ EgtAddToPackagePath( sMachDir .. '\\Wall\\?.lua')
local WD = require( 'WallData')
-- Assegno valori di interesse
GWD.SIMUL_VIEW_DIR = WD.SIMUL_VIEW_DIR
GWD.ORIG_CORNER = WD.ORIG_CORNER
GWD.NESTING_CORNER = WD.NESTING_CORNER
-- Tutto ok
GWD.ERR = 0
+4 -3
View File
@@ -51,7 +51,7 @@ function WMachiningLib.FindCutting( sType, dDepth, nTool_ID)
end
---------------------------------------------------------------------
function WMachiningLib.FindMilling( sType, dDepth, sTuuid, nTool_ID, dMaxDiam)
function WMachiningLib.FindMilling( sType, dDepth, sTuuid, nTool_ID, dMaxDiam, dMaxMat)
for i = 1, #Millings do
local Milling = Millings[i]
if Milling.On and Milling.Type == sType and SetCurrMachiningAndTool( Milling.Name) then
@@ -65,6 +65,7 @@ function WMachiningLib.FindMilling( sType, dDepth, sTuuid, nTool_ID, dMaxDiam)
( not sTuuid or sTuuid == sMyTuuid) and
( not dDepth or dTMaxDepth > dDepth - GEO.EPS_SMALL) and
( not dMaxDiam or dTDiam < dMaxDiam + GEO.EPS_SMALL) and
( not dMaxMat or dTMaxMat < dMaxMat + GEO.EPS_SMALL) and
( not nTool_ID or nTool_ID == 0 or nTool_ID == nMyTool_ID) then
return Milling.Name, dTMaxDepth, dTMaxMat, dTDiam
end
@@ -132,7 +133,7 @@ function WMachiningLib.FindDrilling( dDiam, dDepth, sHead)
if nMchType == MCH_MY.DRILLING and
dTDiam < dDiam + 10 * GEO.EPS_SMALL and dTDiam > dDiam - WD.DRILL_TOL - 10 * GEO.EPS_SMALL and
( not dDepth or dTMaxMat > dDepth - GEO.EPS_SMALL) and
( not sHead or sHead == sMyHead) then
(( not sHead and sMyHead ~= 'H5' and sMyHead ~= 'H6') or sHead == sMyHead) then
return Drilling.Name, Drilling.Type, dTMaxMat
end
end
@@ -148,7 +149,7 @@ function WMachiningLib.FindDrilling( dDiam, dDepth, sHead)
if nMchType == MCH_MY.POCKETING and
dTDiam < dDiam - 10 * GEO.EPS_SMALL and
( not dDepth or dTMaxDepth > dDepth - GEO.EPS_SMALL) and
( not sHead or sHead == sMyHead) then
( ( not sHead and sMyHead ~= 'H5' and sMyHead ~= 'H6') or sHead == sMyHead) then
return Drilling.Name, Drilling.Type, dTMaxDepth
end
end
+2 -2
View File
@@ -48,7 +48,7 @@ function WPC.FlipClassify( Proc)
elseif vtNZ < -0.5 then
nFlip0 = 0
else
nFlip0 = 25
nFlip0 = 50
end
if - vtNZ > - GEO.EPS_SMALL then
@@ -56,7 +56,7 @@ function WPC.FlipClassify( Proc)
elseif - vtNZ < -0.5 then
nFlip1 = 0
else
nFlip1 = 25
nFlip1 = 50
end
--nFlip0 = EgtIf( vtN:getZ() < -0.5, 0, 100)
+42 -11
View File
@@ -1,6 +1,7 @@
-- WProcessDrill.lua by Egaltech s.r.l. 2021/11/11
-- WProcessDrill.lua by Egaltech s.r.l. 2021/12/04
-- 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.
-- Tabella per definizione modulo
local WPD = {}
@@ -122,7 +123,8 @@ end
---------------------------------------------------------------------
-- Classificazione della rotazione della feature per nesting
-- return nRot0, nRot90, nRot180, nRot270
function WPD.RotateClassify( Proc, ValidRotations)
function WPD.RotateClassify( Proc)
local nRot0 = -1
local nRot90 = -1
local nRot180 = -1
@@ -145,14 +147,14 @@ function WPD.RotateClassify( Proc, ValidRotations)
-- se orientato perpendicolare ad X
if AreSameOrOppositeVectorApprox( vtExtr, X_AX()) then
nRot0 = 0
nRot90 = EgtIf (ValidRotations.bRot90, 100, 0)
nRot90 = 100
nRot180 = 0
nRot270 = EgtIf (ValidRotations.bRot90, 100, 0)
nRot270 = 100
return nRot0, nRot90, nRot180, nRot270
elseif AreSameOrOppositeVectorApprox( vtExtr, Y_AX()) then
nRot0 = EgtIf (ValidRotations.bRot0, 100, 0)
nRot0 = 100
nRot90 = 0
nRot180 = EgtIf (ValidRotations.bRot0, 100, 0)
nRot180 = 100
nRot270 = 0
return nRot0, nRot90, nRot180, nRot270
end
@@ -219,11 +221,19 @@ function WPD.Make( Proc, nRawId, b3Raw)
local sDrilling, nType
local sHead
if dDiam < 200 then
if AreSameVectorApprox( vtExtr, Y_AX()) or
( bOpen and abs( Proc.Flg) ~= 2 and AreSameVectorApprox( vtExtr, -Y_AX())) then
sHead = 'H5'
elseif AreSameVectorApprox( vtExtr, -Y_AX()) then
sHead = 'H6'
if WD.HOR_DRILL_Y_SPLIT and AreSameOrOppositeVectorApprox( vtExtr, Y_AX()) then
local dExtrY = vtExtr:getY()
if abs( Proc.Flg) == 2 then
sHead = EgtIf( dExtrY > 0, 'H5', 'H6')
else
if Proc.Box:getMax():getY() > WD.HOR_DRILL_Y_SPLIT + 10 then
sHead = 'H5'
if vtExtr:getY() < 0 then bToInvert = true end
else
sHead = 'H6'
if vtExtr:getY() > 0 then bToInvert = true end
end
end
end
sDrilling, nType = WM.FindDrilling( dDiam, dLen, sHead)
if not sDrilling then
@@ -234,6 +244,7 @@ function WPD.Make( Proc, nRawId, b3Raw)
if not sDrilling then
sDrilling, nType = WM.FindDrilling( dDiam)
end
if sDrilling then sHead = '' end
end
else
sDrilling = WM.FindMilling( 'FreeContour', dLen)
@@ -244,6 +255,14 @@ function WPD.Make( Proc, nRawId, b3Raw)
EgtOutLog( sErr)
return false, sErr
end
-- controllo posizione Y inizio foro con testa H6
if WD.HOR_DRILL_YNEG_MAXMIN and sHead == 'H6' then
if b3Raw:getMin():getY() > WD.HOR_DRILL_YNEG_MAXMIN then
local sErr = 'Error : horizontal hole with Drilling2 starting too far'
EgtOutLog( sErr)
return false, sErr
end
end
-- recupero i dati dell'utensile
local dMaxDepth = 20
local dDiamTh = 35
@@ -316,6 +335,18 @@ function WPD.Make( Proc, nRawId, b3Raw)
end
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
end
-- per fori lungo Y con teste speciali aggiusto eventuale parte prima del foro ma nel grezzo
if sHead == 'H5' then
local dSafeStart = b3Raw:getMax():getY() - Proc.Box:getMax():getY() + 10
if dSafeStart > 20 then
EgtSetMachiningParam( MCH_MP.STARTPOS, dSafeStart)
end
elseif sHead == 'H6' then
local dSafeStart = Proc.Box:getMin():getY() - b3Raw:getMin():getY() + 10
if dSafeStart > 20 then
EgtSetMachiningParam( MCH_MP.STARTPOS, dSafeStart)
end
end
-- imposto posizione braccio porta testa
local nSCC = MCH_SCC.ADIR_ZP
if AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then
+44 -19
View File
@@ -1423,6 +1423,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
local bInvertMach
local nModifyLeadInOut = 0
local nFace2ndFace
local dMaxDistToOut = 1800 -- dMillDiamTh/2
-- se orientato lungo la Y
if abs( vtN:getX()) > 0.9 then
dExtraLongExtPlus = abs( Proc.Box:getMax():getY() - b3Raw:getMax():getY())
@@ -1430,12 +1431,13 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
if dLongGorge + dMillDiamTh < b3Raw:getDimY() then
nModifyLeadInOut = 1
-- se non può sbordare da nessuna parte do errore
if dExtraLongExtPlus > dMillDiamTh/2 and dExtraLongExtNeg > dMillDiamTh/2 and dElev > ( 0.5 * dMillDiam) then
if dExtraLongExtPlus > dMaxDistToOut and dExtraLongExtNeg > dMaxDistToOut and dElev > dMaxDistToOut then
local sErr = 'Error : Not possible insert SideMill groove machining'
EgtOutLog( sErr)
return false, sErr
end
-- se non sborda solo dai lati
elseif dExtraLongExtPlus > dMillDiamTh/2 and dExtraLongExtNeg > dMillDiamTh/2 then
if dElev < dExtraLongExtPlus and dElev < dExtraLongExtNeg then
nModifyLeadInOut = 2
end
end
@@ -1485,12 +1487,13 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
if dLongGorge + dMillDiamTh < b3Raw:getDimX() then
nModifyLeadInOut = 1
-- se non può sbordare da nessuna parte do errore
if dExtraLongExtPlus > dMillDiamTh/2 and dExtraLongExtNeg > dMillDiamTh/2 and dElev > ( 0.5 * dMillDiam) then
if dExtraLongExtPlus > dMaxDistToOut and dExtraLongExtNeg > dMaxDistToOut and dElev > dMaxDistToOut then
local sErr = 'Error : Not possible insert SideMill groove machining'
EgtOutLog( sErr)
return false, sErr
end
-- se non sborda solo dai lati
elseif dExtraLongExtPlus > dMillDiamTh/2 and dExtraLongExtNeg > dMillDiamTh/2 then
if dElev < dExtraLongExtPlus and dElev < dExtraLongExtNeg then
nModifyLeadInOut = 2
end
end
@@ -1547,7 +1550,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
-- calcolo extra allungamenti
local dExtraLongGorge = ( dMillDiamTh + 5) /2
-- recupero la lavorazione
local sMillingGorge = WM.FindMilling( 'FreeContour', nil, nil, nil, 30)
local sMillingGorge = WM.FindMilling( 'Gorge', nil, nil, nil, 80)
if not sMillingGorge then
local sErr = 'Error : FirstMill not found in library'
EgtOutLog( sErr)
@@ -1610,8 +1613,8 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
-- aggiungo l'offset laterale
EgtSetMachiningParam( MCH_MP.OFFSR, ( dElevToPiece + (dC * (i-1)) + 1))
-- aggiungo allungamenti iniziali e finali
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dExtraLongGorge)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dExtraLongGorge)
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dExtraLongIni + dExtraLongGorge)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dExtraLongEnd + dExtraLongGorge)
-- eseguo
if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
@@ -1696,8 +1699,10 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
EgtSetMachiningParam( MCH_MP.LOPERP, 0)
end
end
-- setto la nota per spostare la lavorazione alla fine
EgtSetInfo( nMchFId, 'MOVE_AFTER', 1)
-- se richiesto, setto la nota per spostare la lavorazione alla fine
if not WD.SIDEMILL_BEFORE then
EgtSetInfo( nMchFId, 'MOVE_AFTER', 1)
end
else
if nModifyLeadInOut > 0 then
-- Invece del numero di passi in sgrossatura confronto il raggio fresa con l'elevazione dalla normale
@@ -1716,8 +1721,10 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
-- setto allungamenti iniziali e finali
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dExtraLongIni)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dExtraLongEnd)
-- setto la nota per spostare la lavorazione alla fine
EgtSetInfo( nMchFId, 'MOVE_AFTER', 1)
-- 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
@@ -1799,8 +1806,10 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
EgtSetMachiningParam( MCH_MP.LOPERP, 0)
end
end
-- setto la nota per spostare la lavorazione alla fine
EgtSetInfo( nMchFId, 'MOVE_AFTER', 1)
-- se richiesto, setto la nota per spostare la lavorazione alla fine
if not WD.SIDEMILL_BEFORE then
EgtSetInfo( nMchFId, 'MOVE_AFTER', 1)
end
else
if nModifyLeadInOut > 0 then
-- Invece del numero di passi in sgrossatura confronto il raggio fresa con l'elevazione dalla normale
@@ -1823,8 +1832,10 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
-- setto allungamenti iniziali e finali
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dExtraLongIni)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dExtraLongEnd)
-- setto la nota per spostare la lavorazione alla fine
EgtSetInfo( nMchFId, 'MOVE_AFTER', 1)
-- 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
@@ -2026,7 +2037,13 @@ local function MakeTwoFaces( Proc, nRawId, b3Raw)
-- recupero la lavorazione di taglio con lama e i suoi parametri
local sCutting, dSawDiam, dSawThick, dSawMaxDepth = WM.FindCutting( 'Standard')
-- se abilitata lavorazione ribasso con fresa di fianco e parametro Q03 abilitato
local sMillOnSide, dTMaxDepth, dMaxMat, dDiam = WM.FindMilling( 'SideMill')
local dMaxThick
if vtN[1]:getZ() < -0.5 then
dMaxThick = dDimY[2]
elseif vtN[2]:getZ() < -0.5 then
dMaxThick = dDimY[1]
end
local sMillOnSide, dTMaxDepth, dMaxMat, dDiam = WM.FindMilling( 'SideMill', nil, nil, nil, nil, dMaxThick)
local _, nUseMillOnSide = EvaluateQParam( Proc)
local dMaxZVers, dMinZVers, bEnableMillOnSide
if sMillOnSide and nUseMillOnSide >= 1 then
@@ -2056,6 +2073,7 @@ local function MakeTwoFaces( Proc, nRawId, b3Raw)
if bEnableMillOnSide and dMaxDepthOnSide > 0 then
dMaxDist = dMaxDepthOnSide
end
dMaxDist = 1000
-- se vicino al bordo del grezzo e non troppo larga, provo con fresatura di fianco
local ptMid = ( ptP1 + ptP2) / 2
local bMakeFirstGroove
@@ -2239,7 +2257,7 @@ local function MakeMoreFaces( Proc, nRawId, b3Raw)
-- se di fianco
if not bPckt and Proc.Fct >= 3 and vtN:getZ() < WD.NZ_MINA then
-- se abilitata lavorazione ribasso con fresa di fianco e parametro Q03 abilitato
local sMillOnSide, dTMaxDepth, dMaxMat, dDiam = WM.FindMilling( 'SideMill')
local sMillOnSide, dTMaxDepth, dMaxMat, dDiam = WM.FindMilling( 'SideMill', nil, nil, nil, nil, min( dH, dV))
local _, nUseMillOnSide = EvaluateQParam( Proc)
-- se ho abilitata lavorazione di fresa di fianco
if Proc.Fct == 3 and sMillOnSide and nUseMillOnSide >= 1 then
@@ -2294,8 +2312,15 @@ local function MakeMoreFaces( Proc, nRawId, b3Raw)
end
end
local nFacet = EgtIf( bPckt or vtN:getZ() >= WD.NZ_MINA, nFacInd, nFacInd2)
-- eseguo la svuotatura
return MakeByPocketing( Proc, nFacet, nRawId, b3Raw, true)
if nFacet then
-- eseguo la svuotatura
return MakeByPocketing( Proc, nFacet, nRawId, b3Raw, true)
else
local sErr = 'Side milling not possible'
EgtOutLog( sErr)
return true, sErr
end
-- fessura verticale
elseif Proc.Stype == 3 then
-- riordino le facce come contorno libero da lavorare a destra (sono una U)
+2
View File
@@ -414,6 +414,8 @@ local function SortMachinings( nPhase, PrevMch, nPartId)
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.POCKETING, nil, nil, 'MOVE_AFTER', false)
-- Lavorazioni di superficie
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_MY.SURFFINISHING, nil, nil, 'MOVE_AFTER', false)
-- Fresature per gole
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, 'FirstMill_', true, 'MOVE_AFTER', false)
-- Fresature che sono rifiniture di spigoli
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, 'Clean_', false, 'MOVE_AFTER', false)
-- Fresature che sono puliture di spigoli
+424 -431
View File
File diff suppressed because it is too large Load Diff