DataWall :

- modifiche per Tool_ID anche su lame
- correzioni su chiodature in doppio.
This commit is contained in:
DarioS
2021-10-24 22:45:05 +02:00
parent 0d2be74bff
commit f1f8f071f2
2 changed files with 18 additions and 10 deletions
+5 -3
View File
@@ -1,4 +1,4 @@
-- MachiningLib.lua by Egaltech s.r.l. 2021/10/18
-- MachiningLib.lua by Egaltech s.r.l. 2021/10/24
-- Libreria ricerca lavorazioni per Pareti
-- Tabella per definizione modulo
@@ -32,7 +32,7 @@ local function SetCurrMachiningAndTool( sMachName)
end
---------------------------------------------------------------------
function WMachiningLib.FindCutting( sType, dDepth)
function WMachiningLib.FindCutting( sType, dDepth, nTool_ID)
for i = 1, #Cuttings do
local Cutting = Cuttings[i]
if Cutting.On and Cutting.Type == sType and SetCurrMachiningAndTool( Cutting.Name) then
@@ -40,8 +40,10 @@ function WMachiningLib.FindCutting( sType, dDepth)
local dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or 0
local dSawThick = EgtTdbGetCurrToolParam( MCH_TP.THICK) or 0
local dSawMaxDepth = EgtTdbGetCurrToolMaxDepth() or 0
local nMyTool_ID = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'Tool_ID', 'i')
if nMchType == MCH_MY.SAWING and
not dDepth or dSawMaxDepth > dDepth - 10 * GEO.EPS_SMALL then
( not dDepth or dSawMaxDepth > dDepth - 10 * GEO.EPS_SMALL) and
( not nTool_ID or nTool_ID == 0 or nTool_ID == nMyTool_ID) then
return Cutting.Name, dSawDiam, dSawThick, dSawMaxDepth
end
end
+13 -7
View File
@@ -1,4 +1,4 @@
-- ProcessFreeContour.lua by Egaltech s.r.l. 2021/10/18
-- ProcessFreeContour.lua by Egaltech s.r.l. 2021/10/24
-- Gestione calcolo profilo libero per Pareti
-- Tabella per definizione modulo
@@ -1667,9 +1667,10 @@ local function MakeByCut( Proc, nRawId, b3Raw)
-- lettura parametri (probabile/i parametro/i Q)
local nConeCut = VerifyCornerType( Proc)
-- recupero la lavorazione di taglio con lama e i suoi parametri (dapprima cerco quella che possa tagliare completamente)
local sCutting, dSawDiam, dSawThick, dSawMaxDepth = WM.FindCutting( 'Standard', dWidth)
local nTool_ID = EgtGetInfo( Proc.Id, 'CNT_DATA', 'i')
local sCutting, dSawDiam, dSawThick, dSawMaxDepth = WM.FindCutting( 'Standard', dWidth, nTool_ID)
if not sCutting then
sCutting, dSawDiam, dSawThick, dSawMaxDepth = WM.FindCutting( 'Standard')
sCutting, dSawDiam, dSawThick, dSawMaxDepth = WM.FindCutting( 'Standard', nil, nTool_ID)
sWarn = 'Warning : elevation bigger than max sawcut depth'
end
if not sCutting then
@@ -1684,6 +1685,9 @@ local function MakeByCut( Proc, nRawId, b3Raw)
-- inserimento dei tagli di lama
local bCtOk, sCtErr = AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick)
if not bCtOk then return bCtOk, sCtErr end
-- se richiesta solo lama, esco
local nCntType = EgtGetInfo( Proc.Id, 'CNT_TYPE', 'i') or 0
if nCntType == 1 and nTool_ID ~= 0 then return true, sWarn end
-- se ci sono facce inclinate, escludo la sega a catena
local bSlanting = false
for i = 1, #vFace do
@@ -1905,18 +1909,20 @@ local function MakeByNail( Proc, nRawId, b3Raw)
-- assegno lato di lavoro
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.CENTER)
-- se in doppio lungo Y, devo dimezzare opportunamente la lavorazione
local dExtraDelta = 0
if Proc.Double == 2 then
dExtraDelta = 0.45 * dCntPar
if Proc.Delta > 0 then
EgtSetMachiningParam( MCH_MP.ENDADDLEN, -abs( Proc.Delta) - 0.9 * dCntPar)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, -abs( Proc.Delta) - dExtraDelta)
else
EgtSetMachiningParam( MCH_MP.STARTADDLEN, -abs( Proc.Delta) - 0.9 * dCntPar)
EgtSetMachiningParam( MCH_MP.STARTADDLEN, -abs( Proc.Delta) - dExtraDelta)
end
end
-- assegno parametro a note utente
-- assegno parametri a note utente
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) .. ';'
'Dlt=' .. EgtNumToString( abs( Proc.Delta) + dExtraDelta, 0) .. ';'
end
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- eseguo