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
|
||||
|
||||
Reference in New Issue
Block a user