DataBeam :
- modifiche e correzioni per filling travi.
This commit is contained in:
+14
-37
@@ -1,4 +1,4 @@
|
||||
-- NestProcess.lua by Egaltech s.r.l. 2021/02/13
|
||||
-- NestProcess.lua by Egaltech s.r.l. 2021/05/26
|
||||
-- Gestione nesting automatico pareti
|
||||
|
||||
-- Intestazioni
|
||||
@@ -12,7 +12,7 @@ EgtEnableDebug( false)
|
||||
--NEST.MACHINE = 'Essetre-90480019_MW'
|
||||
--NEST.FLAG = 3
|
||||
|
||||
local sLog = 'BeamNestProcess : ' .. NEST.FILE .. ', ' .. NEST.MACHINE .. ', ' .. NEST.LEN .. ', ' .. NEST.WIDTH
|
||||
local sLog = ' +++ BeamNestProcess : ' .. NEST.FILE .. ', ' .. NEST.MACHINE .. ', ' .. NEST.LEN .. ', ' .. NEST.WIDTH
|
||||
EgtOutLog( sLog)
|
||||
|
||||
-- Cancello file di log specifico
|
||||
@@ -151,23 +151,6 @@ local nTotRaws = Raws.Count
|
||||
-- Pezzi
|
||||
local Parts = {}
|
||||
|
||||
--local Parts = {{ Len=1050, DispLen=9050, Cnt=16},
|
||||
-- { Len=3800, Cnt=20},
|
||||
-- { Len=4654, Cnt=10},
|
||||
-- { Len=1060, Cnt=9},
|
||||
-- { Len=2200, Cnt=15},
|
||||
-- { Len=1331, Cnt=11},
|
||||
-- { Len=3060, Cnt=21},
|
||||
-- { Len=3500, Cnt=6},
|
||||
-- { Len=1622, Cnt=18},
|
||||
-- { Len=1689, Cnt=11},
|
||||
-- { Len=5810, Cnt=8},
|
||||
-- { Len=770, DispLen=9770, Cnt=11},
|
||||
-- { Len=7700, Cnt=2},
|
||||
-- { Len=482, DispLen=11482, Cnt=8},
|
||||
-- { Len=2911, Cnt=9}}
|
||||
--local nTotParts = PartsToFill( Parts)
|
||||
|
||||
-- ciclo su pezzi per aggiungerli al nesting
|
||||
for nPartId, nCount in pairs( PART) do
|
||||
-- recupero lunghezza pezzo
|
||||
@@ -197,26 +180,17 @@ while Raws.Count > 0 and PartsToFill( Parts) > 0 do
|
||||
-- creo pezzo copia
|
||||
local nPartDuploId = EgtDuploNew(PartId)
|
||||
EgtSetInfo(nMachGroup, "PART" .. nInfoIndex, nPartDuploId .. "," .. CurrX)
|
||||
-- local PtId = EgtSurfFrRectangle( GDB_ID.CL, ptOrig + Vector3d( CurrX, 10, 0), ptOrig + Vector3d( CurrX + dLen, 190, 0))
|
||||
-- EgtSetColor( PtId, Color3d( 256 - 4 * PartId, 16 * PartId, 8 * PartId, 40))
|
||||
-- EgtExtractSurfFrChunkLoops( PtId, 0, EgtGetParent( PtId))
|
||||
-- local sText = string.format( 'P%d (%.0f)', Res.Data[i].Id, Parts[Res.Data[i].Id].Len)
|
||||
-- EgtTextAdv( GDB_ID.CL, ptOrig + Vector3d( CurrX + 0.5 * dLen, 100,0), 0, sText, 'ModernPropS.Nfe', 100, 'S', 60, 0.8, 0, GDB_TI.MC)
|
||||
CurrX = CurrX + dLen + Raws.MidGap
|
||||
nInfoIndex = nInfoIndex + 1
|
||||
end
|
||||
end
|
||||
|
||||
-- DrawBarWithParts( ptOrig, Raws, Parts, Res)
|
||||
-- EgtZoom( SCE_ZM.ALL)
|
||||
-- dTime = dTime + Res.Time
|
||||
-- Aggiorno per prossima iterazione
|
||||
Raws.Count = Raws.Count - 1
|
||||
for i = 1, Res.DiffParts do
|
||||
local PartId = Res.Data[i].Id
|
||||
Parts[PartId].Cnt = Parts[PartId].Cnt - Res.Data[i].Count
|
||||
end
|
||||
-- ptOrig = ptOrig + Vector3d( 0, 400, 0)
|
||||
end
|
||||
|
||||
-- creo grezzi per ogni gruppo di lavorazione
|
||||
@@ -226,18 +200,21 @@ BEAM.MACHINE = NEST.MACHINE
|
||||
BEAM.FLAG = 6 -- CREATE_PANEL
|
||||
nMachGroup = EgtGetFirstMachGroup()
|
||||
while nMachGroup do
|
||||
local nNextMachGroup = EgtGetNextMachGroup( nMachGroup)
|
||||
EgtSetCurrMachGroup(nMachGroup)
|
||||
if EgtGetInfo(nMachGroup, "AUTONEST",'i') == 1 then
|
||||
EgtSetInfo(nMachGroup, "AUTONEST", "")
|
||||
EgtSetInfo(nMachGroup, "UPDATEUI", 1)
|
||||
dofile(EgtGetSourceDir() .. "BatchProcessNew.lua")
|
||||
if EgtGetInfo( nMachGroup, "AUTONEST",'i') == 1 then
|
||||
EgtRemoveInfo( nMachGroup, "AUTONEST")
|
||||
EgtSetInfo( nMachGroup, "UPDATEUI", 1)
|
||||
local bOk, sErr = pcall( dofile, EgtGetSourceDir() .. "BatchProcessNew.lua")
|
||||
if not bOk then
|
||||
EgtOutLog( 'Error in BatchProcessNew.lua call (' .. ( sErr or '') ..')')
|
||||
end
|
||||
end
|
||||
nMachGroup = EgtGetNextMachGroup(nMachGroup)
|
||||
nMachGroup = nNextMachGroup
|
||||
end
|
||||
|
||||
EgtResetCurrMachGroup()
|
||||
-- nascondo rettangolo
|
||||
--EgtErase(SheetPartId)
|
||||
-- EgtSaveFile("c:\\Temp\\Prova1.nge")
|
||||
|
||||
EgtOutLog( ' +++ NestProcess completed')
|
||||
NEST.ERR = 0
|
||||
|
||||
EgtOutLog( ' +++ BeamNestProcess completed')
|
||||
|
||||
Reference in New Issue
Block a user