DataBeam :
- varie correzioni e migliorie.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
-- ProcessMortise.lua by Egaltech s.r.l. 2020/03/18
|
||||
-- ProcessMortise.lua by Egaltech s.r.l. 2020/03/19
|
||||
-- Gestione calcolo mortase a coda di rondice per Travi
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
@@ -67,24 +67,25 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId)
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
local sMillingAs
|
||||
-- recupero la lavorazione
|
||||
local sMilling = ML.FindMilling( 'DtMortise')
|
||||
if not sMilling then
|
||||
local sErr = 'Milling not found in library : Error on DtMortise ' .. tostring( Proc.Id)
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- recupero il diametro dell'utensile
|
||||
local dToolDiam = 100
|
||||
local dMaxMat = 30
|
||||
if EgtMdbSetCurrMachining( sMilling) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiam
|
||||
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat
|
||||
end
|
||||
end
|
||||
-- se parametro interno abilitato e il percorso non è chiuso, aggiungo percorso e lavorazione antischeggia
|
||||
if bMakeAntiSplitPath and not EgtCurveIsClosed( AuxId) then
|
||||
-- recupero la lavorazione
|
||||
sMillingAs = ML.FindMilling( 'DtMortise')
|
||||
if not sMillingAs then
|
||||
local sErr = 'Milling not found in library : Error on DtMortise ' .. tostring( Proc.Id)
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- recupero il diametro dell'utensile
|
||||
local dToolDiam = 100
|
||||
if EgtMdbSetCurrMachining( sMillingAs) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiam
|
||||
end
|
||||
end
|
||||
-- recupero punto iniziale e finale del percorso
|
||||
local pStartP = EgtSP( AuxId, GDB_RT.GLOB)
|
||||
local pEndP = EgtEP( AuxId, GDB_RT.GLOB)
|
||||
@@ -146,14 +147,17 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId)
|
||||
end
|
||||
-- inserisco la lavorazione di contornatura anti splint
|
||||
local sNameF = 'DtMtAS_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchFId = EgtAddMachining( sNameF, sMillingAs)
|
||||
local nMchFId = EgtAddMachining( sNameF, sMilling)
|
||||
if not nMchFId then
|
||||
local sErr = 'Error adding machining ' .. sNameF .. '-' .. sMillingAs
|
||||
local sErr = 'Error adding machining ' .. sNameF .. '-' .. sMilling
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ nId1, -1}})
|
||||
-- dichiaro non si generano sfridi per VMill
|
||||
local sUserNotes = 'MaxElev='.. EgtNumToString( dMaxMat - 0.1, 1) .. 'VMRS=0;'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
if not EgtApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
@@ -166,21 +170,6 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId)
|
||||
return false, sErr
|
||||
end
|
||||
end
|
||||
-- recupero la lavorazione, se antischeggia già inserita prendo quella
|
||||
local sMilling = EgtIf( sMillingAs, sMillingAs, ML.FindMilling( 'DtMortise'))
|
||||
if not sMilling then
|
||||
local sErr = 'Milling not found in library : Error on DtMortise ' .. tostring( Proc.Id)
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- recupero il diametro dell'utensile
|
||||
local dToolDiam = 10
|
||||
if EgtMdbSetCurrMachining( sMilling) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiam
|
||||
end
|
||||
end
|
||||
dToolDiam = max( dToolDiam, 10)
|
||||
-- verifico se raggio troppo piccolo per l'utensile
|
||||
local nSt, nEnd = EgtCurveDomain( AuxId)
|
||||
@@ -219,6 +208,9 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, dOffs)
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- dichiaro non si generano sfridi per VMill
|
||||
local sUserNotes = 'MaxElev='.. EgtNumToString( dMaxMat - 0.1, 1) .. 'VMRS=0;'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
if not EgtApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
|
||||
Reference in New Issue
Block a user