DataWall :
- aggiunto controllo tipo lavorazione nelle ricerche - corretto controllo inclinazione tagli per essere lavorabili - in foratura nella ricerca dell'utensile/lavorazione si tiene conto della profondità del foro - in taglio con lama possibilità di demandare lato mandrino a funzione di macchina WallData.GetSawHeadSide - in chiodature aggiunta possibilità di lavorare in doppio con funzione di macchina WallData.FindFeaturesInDouble.
This commit is contained in:
+30
-10
@@ -1,4 +1,4 @@
|
||||
-- MachiningLib.lua by Egaltech s.r.l. 2021/09/17
|
||||
-- MachiningLib.lua by Egaltech s.r.l. 2021/10/18
|
||||
-- Libreria ricerca lavorazioni per Pareti
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
@@ -36,10 +36,12 @@ function WMachiningLib.FindCutting( sType, dDepth)
|
||||
for i = 1, #Cuttings do
|
||||
local Cutting = Cuttings[i]
|
||||
if Cutting.On and Cutting.Type == sType and SetCurrMachiningAndTool( Cutting.Name) then
|
||||
local nMchType = EgtMdbGetCurrMachiningParam( MCH_MP.TYPE)
|
||||
local dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or 0
|
||||
local dSawThick = EgtTdbGetCurrToolParam( MCH_TP.THICK) or 0
|
||||
local dSawMaxDepth = EgtTdbGetCurrToolMaxDepth() or 0
|
||||
if not dDepth or dSawMaxDepth > dDepth - 10 * GEO.EPS_SMALL then
|
||||
if nMchType == MCH_MY.SAWING and
|
||||
not dDepth or dSawMaxDepth > dDepth - 10 * GEO.EPS_SMALL then
|
||||
return Cutting.Name, dSawDiam, dSawThick, dSawMaxDepth
|
||||
end
|
||||
end
|
||||
@@ -51,12 +53,14 @@ function WMachiningLib.FindMilling( sType, dDepth, sTuuid, nTool_ID)
|
||||
for i = 1, #Millings do
|
||||
local Milling = Millings[i]
|
||||
if Milling.On and Milling.Type == sType and SetCurrMachiningAndTool( Milling.Name) then
|
||||
local nMchType = EgtMdbGetCurrMachiningParam( MCH_MP.TYPE)
|
||||
local sMyTuuid = EgtGetMachiningParam( MCH_MP.TUUID)
|
||||
local dTMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT)
|
||||
local dTMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, dTMaxMat, EgtTdbGetCurrToolMaxDepth())
|
||||
local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||
local nMyTool_ID = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'Tool_ID', 'i')
|
||||
if ( not sTuuid or sTuuid == sMyTuuid) and
|
||||
if nMchType == MCH_MY.MILLING and
|
||||
( not sTuuid or sTuuid == sMyTuuid) and
|
||||
( not dDepth or dTMaxDepth > dDepth - GEO.EPS_SMALL) and
|
||||
( not nTool_ID or nTool_ID == 0 or nTool_ID == nMyTool_ID) then
|
||||
return Milling.Name, dTMaxDepth, dTMaxMat, dTDiam
|
||||
@@ -70,8 +74,10 @@ function WMachiningLib.FindNailing( nType)
|
||||
for i = 1, #Millings do
|
||||
local Milling = Millings[i]
|
||||
if Milling.On and Milling.Type == 'Nailing' and SetCurrMachiningAndTool( Milling.Name) then
|
||||
local nMchType = EgtMdbGetCurrMachiningParam( MCH_MP.TYPE)
|
||||
local sTName = EgtTdbGetCurrToolParam( MCH_TP.NAME)
|
||||
if sTName == tostring( nType) then
|
||||
if nMchType == MCH_MY.MILLING and
|
||||
sTName == tostring( nType) then
|
||||
return Milling.Name
|
||||
end
|
||||
end
|
||||
@@ -83,10 +89,12 @@ function WMachiningLib.FindPocketing( sType, dMaxDiam, dDepth, nTool_ID)
|
||||
for i = 1, #Pocketings do
|
||||
local Pocketing = Pocketings[i]
|
||||
if Pocketing.On and Pocketing.Type == sType and SetCurrMachiningAndTool( Pocketing.Name) then
|
||||
local nMchType = EgtMdbGetCurrMachiningParam( MCH_MP.TYPE)
|
||||
local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||
local dTMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), EgtTdbGetCurrToolMaxDepth())
|
||||
local nMyTool_ID = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'Tool_ID', 'i')
|
||||
if ( not dMaxDiam or dTDiam < dMaxDiam + GEO.EPS_SMALL) and
|
||||
if nMchType == MCH_MY.POCKETING and
|
||||
( not dMaxDiam or dTDiam < dMaxDiam + GEO.EPS_SMALL) and
|
||||
( not dDepth or dTMaxDepth > dDepth - GEO.EPS_SMALL) and
|
||||
( not nTool_ID or nTool_ID == 0 or nTool_ID == nMyTool_ID) then
|
||||
return Pocketing.Name, dTDiam, dTMaxDepth
|
||||
@@ -100,20 +108,26 @@ function WMachiningLib.FindSawing( sType)
|
||||
for i = 1, #Sawings do
|
||||
local Sawing = Sawings[i]
|
||||
if Sawing.On and Sawing.Type == sType and SetCurrMachiningAndTool( Sawing.Name) then
|
||||
return Sawing.Name
|
||||
local nMchType = EgtMdbGetCurrMachiningParam( MCH_MP.TYPE)
|
||||
if nMchType == MCH_MY.MORTISING then
|
||||
return Sawing.Name
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function WMachiningLib.FindDrilling( dDiam)
|
||||
function WMachiningLib.FindDrilling( dDiam, dDepth)
|
||||
-- ricerca sulle forature, dal diametro maggiore al minore
|
||||
for i = #Drillings, 1, -1 do
|
||||
local Drilling = Drillings[i]
|
||||
if Drilling.On and Drilling.Type == 'Drill' and SetCurrMachiningAndTool( Drilling.Name) then
|
||||
local nMchType = EgtMdbGetCurrMachiningParam( MCH_MP.TYPE)
|
||||
local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||
local dTMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT)
|
||||
if dTDiam < dDiam + 10 * GEO.EPS_SMALL and dTDiam > dDiam - WD.DRILL_TOL - 10 * GEO.EPS_SMALL then
|
||||
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) then
|
||||
return Drilling.Name, Drilling.Type, dTMaxMat
|
||||
end
|
||||
end
|
||||
@@ -122,9 +136,12 @@ function WMachiningLib.FindDrilling( dDiam)
|
||||
for i = #Drillings, 1, -1 do
|
||||
local Drilling = Drillings[i]
|
||||
if Drilling.On and Drilling.Type == 'Pocket' and SetCurrMachiningAndTool( Drilling.Name) then
|
||||
local nMchType = EgtMdbGetCurrMachiningParam( MCH_MP.TYPE)
|
||||
local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||
local dTMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), EgtTdbGetCurrToolMaxDepth())
|
||||
if dTDiam < dDiam - 10 * GEO.EPS_SMALL then
|
||||
if nMchType == MCH_MY.POCKETING and
|
||||
dTDiam < dDiam - 10 * GEO.EPS_SMALL and
|
||||
( not dDepth or dTMaxDepth > dDepth - GEO.EPS_SMALL) then
|
||||
return Drilling.Name, Drilling.Type, dTMaxDepth
|
||||
end
|
||||
end
|
||||
@@ -137,7 +154,10 @@ function WMachiningLib.FindSurfacing( sType)
|
||||
for i = 1, #Surfacings do
|
||||
local Surfacing = Surfacings[i]
|
||||
if Surfacing.On and Surfacing.Type == sType and SetCurrMachiningAndTool( Surfacing.Name) then
|
||||
return Surfacing.Name
|
||||
local nMchType = EgtMdbGetCurrMachiningParam( MCH_MP.TYPE)
|
||||
if nMchType == MCH_MY.SURFFINISHING then
|
||||
return Surfacing.Name
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -30,7 +30,7 @@ function WPC.Classify( Proc, b3Raw)
|
||||
if Proc.Fct ~= 1 then return false end
|
||||
-- controllo la normale
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
|
||||
if abs( vtN:getZ()) < -0.5 then return false end
|
||||
if abs( vtN:getZ()) < WD.NZ_MINA then return false end
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
@@ -96,9 +96,9 @@ function WPD.Make( Proc, nRawId, b3Raw)
|
||||
-- recupero la lavorazione
|
||||
local sDrilling, nType
|
||||
if dDiam < 200 then
|
||||
sDrilling, nType = WM.FindDrilling( dDiam)
|
||||
sDrilling, nType = WM.FindDrilling( dDiam, dLen)
|
||||
else
|
||||
sDrilling = WM.FindMilling( 'FreeContour')
|
||||
sDrilling = WM.FindMilling( 'FreeContour', dLen)
|
||||
nType = 'Mill'
|
||||
end
|
||||
if not sDrilling then
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- ProcessFreeContour.lua by Egaltech s.r.l. 2021/10/05
|
||||
-- ProcessFreeContour.lua by Egaltech s.r.l. 2021/10/18
|
||||
-- Gestione calcolo profilo libero per Pareti
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
@@ -1555,6 +1555,7 @@ local function AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick)
|
||||
end
|
||||
EgtSetInfo( nMchId, 'Part', Proc.PartId)
|
||||
local dSpeed = EgtGetMachiningParam( MCH_MP.SPEED)
|
||||
local sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( { { Proc.Id, vFace[i].Fac}})
|
||||
-- assegno affondamento
|
||||
@@ -1570,8 +1571,10 @@ local function AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, bInvert)
|
||||
-- imposto lato di lavoro
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bInvert, MCH_SAW_WS.LEFT, MCH_SAW_WS.RIGHT))
|
||||
-- lato mandrino ( a sinistra se rotazione CCW, altrimenti a destra)
|
||||
EgtSetMachiningParam( MCH_MP.HEADSIDE, EgtIf( dSpeed < 0, MCH_SAW_HS.LEFT, MCH_SAW_HS.RIGHT))
|
||||
-- lato mandrino ( standard a sinistra se rotazione CCW, altrimenti a destra, oppure da funzione di macchina)
|
||||
local nHeadSide = EgtIf( dSpeed < 0, MCH_SAW_HS.LEFT, MCH_SAW_HS.RIGHT)
|
||||
if WD.GetSawHeadSide then nHeadSide = WD.GetSawHeadSide( dSpeed, sHead) end
|
||||
EgtSetMachiningParam( MCH_MP.HEADSIDE, nHeadSide)
|
||||
-- assegno i dati di attacco (sicurezza solo se angolo interno)
|
||||
local nLeadIn = MCH_SAW_LI.CENT
|
||||
if ( not bInvert and ( vFace[i].Type & 1) ~= 0) or ( bInvert and ( vFace[i].Type & 2) ~= 0) then
|
||||
@@ -1901,8 +1904,21 @@ local function MakeByNail( Proc, nRawId, b3Raw)
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, 10)
|
||||
-- assegno lato di lavoro
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.CENTER)
|
||||
-- se in doppio lungo Y, devo dimezzare opportunamente la lavorazione
|
||||
if Proc.Double == 2 then
|
||||
if Proc.Delta > 0 then
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, -abs( Proc.Delta) - 0.9 * dCntPar)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, -abs( Proc.Delta) - 0.9 * dCntPar)
|
||||
end
|
||||
end
|
||||
-- assegno parametro a note utente
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'Par='..dCntPar..';')
|
||||
local sUserNotes = 'Par=' .. EgtNumToString( dCntPar, 0) .. ';'
|
||||
if Proc.Double and Proc.Double > 0 then
|
||||
sUserNotes = sUserNotes .. 'Dbl=' .. EgtNumToString( Proc.Double, 0) .. ';' ..
|
||||
'Dlt=' .. EgtNumToString( Proc.Delta, 0) .. ';'
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
if not EgtApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- WallExec.lua by Egaltech s.r.l. 2021/09/20
|
||||
-- WallExec.lua by Egaltech s.r.l. 2021/10/18
|
||||
-- Libreria esecuzione lavorazioni per Pareti
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
@@ -229,9 +229,9 @@ local function PrintFeatures( vProc)
|
||||
EgtOutLog( ' *** Feature List ***')
|
||||
for i = 1, #vProc do
|
||||
local Proc = vProc[i]
|
||||
local sOut = string.format( 'Part=%3d Proc=%3d Grp=%1d Prc=%3d TC=%2d/%d Flg=%2d Fcse=%1d,%1d Diam=%.2f Fct=%2d Box=%s',
|
||||
local sOut = string.format( 'Part=%3d Proc=%3d Grp=%1d Prc=%3d TC=%2d/%d Flg=%2d Fcse=%1d,%1d Diam=%.2f Fct=%2d Dbl=%2d Dlt=%.1f Box=%s',
|
||||
Proc.PartId, Proc.Id, Proc.Grp, Proc.Prc, Proc.TaskId, Proc.CutId,
|
||||
Proc.Flg, Proc.Fcs, Proc.Fce, Proc.Diam, Proc.Fct, tostring( Proc.Box))
|
||||
Proc.Flg, Proc.Fcs, Proc.Fce, Proc.Diam, Proc.Fct, Proc.Double or 0, Proc.Delta or 0, tostring( Proc.Box))
|
||||
EgtOutLog( sOut)
|
||||
end
|
||||
end
|
||||
@@ -426,6 +426,11 @@ function WallExec.ProcessFeatures()
|
||||
end
|
||||
-- classifico le feature
|
||||
ClassifyFeatures( vProc, b3Raw)
|
||||
-- Eventuale determinazione delle feature lavorabili in parallelo (implementata nella configurazione macchina)
|
||||
-- si impostano i flag Double (nil/0=no, 1=su X, 2=su Y) e Delta (offset tra T14 e T12 positivo o negativo)
|
||||
if WD.FindFeaturesInDouble then
|
||||
WD.FindFeaturesInDouble( vProc, b3Raw)
|
||||
end
|
||||
-- debug
|
||||
if EgtGetDebugLevel() >= 1 then
|
||||
PrintFeatures( vProc)
|
||||
|
||||
Reference in New Issue
Block a user