90e5e940c1
- Prima bozza gestione pezzo con cambio-profilo
77 lines
2.7 KiB
Lua
77 lines
2.7 KiB
Lua
-- FeatureData.lua by Egalware s.r.l. 2024/06/18
|
|
-- Libreria lettura o calcolo dati e proprietà della feature
|
|
|
|
-- Tabella per definizione modulo
|
|
local FeatureData = {}
|
|
|
|
-- Carico i dati globali
|
|
local WinData = require( 'WinData')
|
|
|
|
-------------------------------------------------------------------------------------------------------------
|
|
-- Recupero dati foro
|
|
function FeatureData.GetDrillingData( Proc)
|
|
local bOk, ptCentre, vtDir, dRadius = EgtCurveIsACircle( Proc.id)
|
|
|
|
vtDir = EgtCurveExtrusion( Proc.id)
|
|
local Frame = EgtGetGlobFrame( Proc.id)
|
|
-- trasformo punti e vettori in globale
|
|
ptCentre:toGlob( Frame)
|
|
vtDir:toGlob( Frame)
|
|
|
|
Proc.dDiameter = dRadius * 2
|
|
Proc.dLength = abs( EgtCurveThickness( Proc.id)) or 0
|
|
Proc.ptCentre = ptCentre
|
|
Proc.vtDir = vtDir
|
|
Proc.sReferenceSide = EgtGetInfo( Proc.id, 'REFERENCE_SIDE', 's') or nil
|
|
|
|
return Proc
|
|
end
|
|
|
|
-------------------------------------------------------------------------------------------------------------
|
|
-- Recupero dati taglio
|
|
function FeatureData.GetCuttingData( Proc)
|
|
|
|
return Proc
|
|
end
|
|
|
|
-------------------------------------------------------------------------------------------------------------
|
|
-- Recupero dati svuotatura
|
|
function FeatureData.GetPocketingData( Proc)
|
|
|
|
return Proc
|
|
end
|
|
|
|
-------------------------------------------------------------------------------------------------------------
|
|
-- Recupero dati per fresatura
|
|
function FeatureData.GetMillingData( Proc)
|
|
|
|
return Proc
|
|
end
|
|
|
|
-------------------------------------------------------------------------------------------------------------
|
|
-- Recupero dati profilatura
|
|
function FeatureData.GetProfilingData( Proc)
|
|
-- recupero utensili
|
|
Proc.nToolsToUse = EgtGetInfo( Proc.id, 'NTOOLS', 'i') or 0
|
|
Proc.sEntityName = EgtGetInfo( Proc.id, 'N', 's') or nil
|
|
Proc.Tools = {}
|
|
for t = 1, Proc.nToolsToUse do
|
|
local Data = {}
|
|
Data.sName = EgtGetInfo( Proc.id, 'TOOL_NAME_' .. tostring(t), 's') or 0
|
|
Data.dRadialOffset = EgtGetInfo( Proc.id, 'OFFR_' .. tostring(t), 'd') or 0
|
|
Data.dLongitudinalOffset = EgtGetInfo( Proc.id, 'OFFL_' .. tostring(t), 'd') or 0
|
|
table.insert( Proc.Tools, Data)
|
|
end
|
|
|
|
Proc.sProfileInfo = EgtGetInfo( Proc.id, 'PROFILE_INFO', 's') or nil
|
|
|
|
Proc.sReferenceSide = EgtGetInfo( Proc.id, 'REFERENCE_SIDE', 's') or ''
|
|
Proc.bHeadProfile = Proc.sReferenceSide == 'Head' or Proc.sEntityName == 'Left' or Proc.sEntityName == 'Right'
|
|
Proc.bLongitudinalProfile = Proc.sReferenceSide == 'Longitudinal' or Proc.sEntityName == 'In' or Proc.sEntityName == 'Out'
|
|
|
|
return Proc
|
|
end
|
|
|
|
-------------------------------------------------------------------------------------------------------------
|
|
|
|
return FeatureData |