- implementata parzialmente GetMainFaces e funzioni accessorie
- migliorie stilistiche e refactoring parziale
This commit is contained in:
+16
-11
@@ -12,10 +12,11 @@ require( 'EgtBase')
|
||||
local BD = require( 'BeamData')
|
||||
|
||||
-- carico librerie
|
||||
local BL = require( 'BeamLib')
|
||||
local BeamLib = require( 'BeamLib')
|
||||
local ID = require( 'Identity')
|
||||
local BCS = require( 'BasicCustomerStrategies')
|
||||
local FD = require( 'FeatureData')
|
||||
local FeatureData = require( 'FeatureData')
|
||||
local FaceData = require( 'FaceData')
|
||||
|
||||
|
||||
EgtOutLog( ' BeamExec started', 1)
|
||||
@@ -72,6 +73,7 @@ local function IsToolOk( Tool)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
@@ -290,12 +292,12 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam, b
|
||||
Cnt = Cnt + 1
|
||||
EgtSetInfo( nRaw, 'ORD', Cnt)
|
||||
-- creo o pulisco gruppo geometrie aggiuntive
|
||||
if not BL.CreateOrEmptyAddGroup( Pz) then
|
||||
if not BeamLib.CreateOrEmptyAddGroup( Pz) then
|
||||
local sOut = 'Error creating Additional Group in Part ' .. tostring( Pz)
|
||||
return false, sOut
|
||||
end
|
||||
-- aggiungo faccia per taglio iniziale al pezzo
|
||||
BL.AddPartStartFace( Pz, b3Solid)
|
||||
BeamLib.AddPartStartFace( Pz, b3Solid)
|
||||
-- se sovramateriale di testa, lo notifico
|
||||
if DeltaS > 0.09 then
|
||||
EgtSetInfo( nRaw, 'HOVM', DeltaS)
|
||||
@@ -307,7 +309,7 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam, b
|
||||
EgtSetInfo( nRaw, 'TOVM', DeltaE)
|
||||
end
|
||||
-- aggiungo faccia per taglio finale al pezzo
|
||||
BL.AddPartEndFace( Pz, b3Solid)
|
||||
BeamLib.AddPartEndFace( Pz, b3Solid)
|
||||
-- inserisco il pezzo nel grezzo
|
||||
EgtDeselectPartObjs( Pz)
|
||||
local ptPos = b3Part:getMin() - b3Solid:getMin() + Vector3d( Delta, ( dRawW - PartWidth) / 2, ( dRawH - PartHeight) / 2)
|
||||
@@ -466,7 +468,7 @@ local function CollectFeatures( PartId, b3Raw)
|
||||
-- recupero le feature
|
||||
local vProc = {}
|
||||
local LayerId = {}
|
||||
LayerId[1] = BL.GetAddGroup( PartId)
|
||||
LayerId[1] = BeamLib.GetAddGroup( PartId)
|
||||
LayerId[2] = EgtGetFirstNameInGroup( PartId or GDB_ID.NULL, 'Processings')
|
||||
for nInd = 1, 2 do
|
||||
local ProcId = EgtGetFirstInGroup( LayerId[nInd] or GDB_ID.NULL)
|
||||
@@ -495,6 +497,7 @@ local function CollectFeatures( PartId, b3Raw)
|
||||
Proc.CutId = nCutId
|
||||
Proc.TaskId = nTaskId
|
||||
-- se ci sono feature collegate ne scrivo il riferimento nella Proc
|
||||
-- TODO AdjId e MainId servono a qualcosa???
|
||||
if nAddAdjId then
|
||||
Proc.AdjId = Proc.Id + nAddAdjId
|
||||
elseif nAddMainId then
|
||||
@@ -507,14 +510,16 @@ local function CollectFeatures( PartId, b3Raw)
|
||||
-- se foro calcolo altri dati
|
||||
if ID.IsDrilling( Proc) then
|
||||
-- assegno diametro e facce di ingresso e uscita (dati tabelle sempre per riferimento)
|
||||
Proc.Diam, Proc.Len, Proc.Fcs, Proc.Fce = FD.GetDataDrill( Proc)
|
||||
Proc.Diam, Proc.Len, Proc.Fcs, Proc.Fce = FeatureData.GetDrillingData( Proc)
|
||||
end
|
||||
-- si recupera la topologia della feature
|
||||
Proc.Topology = FD.GetTopology( Proc, b3Raw)
|
||||
-- informazioni facce e topologia
|
||||
Proc.AdjacencyMatrix = FaceData.GetAdjacencyMatrix( Proc)
|
||||
Proc.Faces = FaceData.GetFacesInfo( Proc, b3Raw)
|
||||
Proc.Topology = FeatureData.GetTopology( Proc, b3Raw)
|
||||
-- se topologia feature riconosciuta, oppure da non calcolare perchè il riconoscimento topologico è basato sulla feature stessa
|
||||
if Proc.Topology.Name ~= 'NOT_IMPLEMENTED' then
|
||||
-- TODO Funzione 'GetMainFaces' da scrivere
|
||||
Proc.MainFaces = FD.GetMainFaces( Proc)
|
||||
Proc.MainFaces = FaceData.GetMainFaces( Proc)
|
||||
-- se la processing ha una strategia forzata, riporto tutto nella proc
|
||||
local vForcedStrategy = GetFeatureForcedStrategy( Proc)
|
||||
if vForcedStrategy then
|
||||
@@ -591,7 +596,7 @@ function BeamExec.ProcessFeatures()
|
||||
if nOrd == 1 then
|
||||
EgtSetCurrPhase( 1)
|
||||
else
|
||||
BL.AddPhaseWithRawParts( nRawId, BD.OriXR, BD.PosXR, 0)
|
||||
BeamLib.AddPhaseWithRawParts( nRawId, BD.OriXR, BD.PosXR, 0)
|
||||
end
|
||||
local nPhase = EgtGetCurrPhase()
|
||||
local nDispId = EgtGetPhaseDisposition( nPhase)
|
||||
|
||||
Reference in New Issue
Block a user