- Prima implementazione creazioni fasi

- Piccole migliorie varie
- Corretta lettura info utensile profilato
- Su Proc, aggiunte alcune note pezzo
This commit is contained in:
andrea.villa
2024-08-09 16:46:51 +02:00
parent 9acd52ea10
commit 362f3fd2b0
5 changed files with 56 additions and 19 deletions
+17 -5
View File
@@ -131,7 +131,7 @@ function BeamExec.GetToolsFromDB()
Tool.ToolHolder.dLength = EgtTdbGetCurrToolThLength() or TH_LENGTH_HSK63 -- lunghezza standard HSK63
-- parametri scritti nelle note
Tool.nDouble = EgtGetValInNotes( Tool.sUserNotes, 'DOUBLE')
Tool.bIsProfiledTool = EgtTdbIsCurrToolStandardDraw()
Tool.bIsProfiledTool = not EgtTdbIsCurrToolStandardDraw()
-- lettura parametri non comuni ( famiglia DRILLBIT non ha parametri specifici)
if sToolFamily ~= 'DRILLBIT' then
@@ -348,6 +348,7 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, PARTS)
PARTS[i].dWidth = PARTS[i].b3Raw:getDimY()
PARTS[i].dHeight = PARTS[i].b3Raw:getDimZ()
PARTS[i].b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( PARTS[i].id, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
PARTS[i].nIndexInParts = i
else
local sOut = 'Error: part L(' .. EgtNumToString( dPartLen, 1) .. ') too big for raw part L(' .. EgtNumToString( dLen - 0.1, 1) .. ')'
return false, sOut
@@ -485,6 +486,8 @@ local function CollectFeatures( Part)
if nGrp and nPrc and nDo == 1 then
local Proc = {}
Proc.idPart = Part.id
Proc.idRaw = Part.idRaw
Proc.nIndexPartInParts = Part.nIndexInParts
Proc.id = ProcId
-- id della feature btl ( se non presente info, si prende id dell'entità geometrica)
Proc.idFeature = EgtGetInfo( Proc.id, 'PRID', 's') or Proc.id
@@ -885,7 +888,6 @@ function BeamExec.ProcessFeatures( PARTS)
local vProcRot = {}
-- lista contenente le feature da eseguire
local vProc = {}
-- TODO da rimuovere o lasciare solo per debug
if EgtGetDebugLevel() >= 3 then
@@ -942,11 +944,11 @@ end
if nOrd == 1 then
EgtSetCurrPhase( 1)
else
BeamLib.AddPhaseWithRawParts( PARTS[nPart], BeamData.ptOriXR, BeamData.dPosXR, 0)
BeamLib.AddPhaseWithRawParts( PARTS[nPart].idRaw, BeamData.ptOriXR, BeamData.dPosXR, 0)
end
local nPhase = EgtGetCurrPhase()
local nDispId = EgtGetPhaseDisposition( nPhase)
EgtSetInfo( nDispId, 'TYPE', EgtIf( PARTS[nPart].id, 'START', 'REST'))
EgtSetInfo( nDispId, 'TYPE', 'START')
EgtSetInfo( nDispId, 'ORD', nOrd)
EgtOutLog( ' *** Phase=' .. tostring( nPhase) .. ' Raw=' .. tostring( PARTS[nPart].idRaw) .. ' Part=' .. tostring( PARTS[nPart].id) .. ' ***', 1)
@@ -984,10 +986,20 @@ end
EgtOutLog( ' *** End AddMachinings ***', 1)
-- passo al grezzo successivo
-- indice pezzo successivo
nOrd = nOrd + 1
end
-- ===== finiti i pezzi, si scarica il restante =====
local idRestPart = EgtGetNextRawPart( PARTS[#PARTS].idRaw)
if idRestPart and EgtGetRawPartBBox( idRestPart):getDimX() >= BeamData.dMinRaw then
BeamLib.AddPhaseWithRawParts( idRestPart, BeamData.ptOriXR, BeamData.dPosXR, 0)
local nPhase = EgtGetCurrPhase()
local nDispId = EgtGetPhaseDisposition( nPhase)
EgtSetInfo( nDispId, 'TYPE', 'REST')
EgtSetInfo( nDispId, 'ORD', nOrd)
end
-- Aggiornamento finale di tutto
EgtSetCurrPhase( 1)
local bApplOk, sApplErrors, sApplWarns = EgtApplyAllMachinings()