DataWall :
- in Drill vanno accettati fori orizzontali sul bordo anche senza foratori orizzontali speciali - in FreeContour corretto riconoscimento lato esterno per percorsi aperti - in LapJoint gestione gorge con lama - migliorie varie a flip e nest.
This commit is contained in:
+42
-8
@@ -54,6 +54,17 @@ local function WriteErrToLogFile( nErr, sMsg, nRot, nCutId, nTaskId)
|
||||
hFile:write( 'TASKID=' .. tostring( nTaskId or 0) .. '\n')
|
||||
hFile:close()
|
||||
end
|
||||
local function BWMessageId( nMsgId, sMsg, params)
|
||||
if WALL.BW and nMsgId and nMsgId > 0 then
|
||||
local sFinalMsg = '$$' .. nMsgId
|
||||
for Index = 1, #params do
|
||||
sFinalMsg = sFinalMsg .. ',' .. params[Index]
|
||||
end
|
||||
return sFinalMsg
|
||||
else
|
||||
return string.format( sMsg, table.unpack( params))
|
||||
end
|
||||
end
|
||||
|
||||
local function WriteTimeToLogFile( dTime)
|
||||
local hFile = io.open( sLogFile, 'a')
|
||||
@@ -175,7 +186,10 @@ if bToProcess then
|
||||
local dPanelLen
|
||||
local dPanelWidth
|
||||
local vWall = {}
|
||||
|
||||
-- flag per Nesting da Btl
|
||||
local bNestingFromBtl = false
|
||||
local nRawOutlineId = GDB_ID.NULL
|
||||
|
||||
-- Se necessario, apro il file Bwe
|
||||
if WALL.FLAG ~= 6 then
|
||||
if not EgtOpenFile( WALL.FILE) then
|
||||
@@ -274,9 +288,28 @@ if bToProcess then
|
||||
local nMGrpId = EgtGetCurrMachGroup()
|
||||
-- Pannello da creare
|
||||
bCreatePanel = true
|
||||
-- Lunghezza e larghezza del pannello
|
||||
dPanelLen = EgtGetInfo( nMGrpId, 'PANELLEN', 'd')
|
||||
dPanelWidth = EgtGetInfo( nMGrpId, 'PANELWIDTH', 'd')
|
||||
-- leggo se grezzo da nesting btl
|
||||
bNestingFromBtl = EgtGetInfo( nMGrpId, 'BTLNESTING', 'b') or false
|
||||
if bNestingFromBtl then
|
||||
-- recupero superficie
|
||||
nRawOutlineId = EgtGetInfo( nMGrpId, 'RAWOUTLINEID') or GDB_ID.NULL
|
||||
if nRawOutlineId ~= GDB_ID.NULL then
|
||||
local nRawPartId = EgtGetParent( EgtGetParent( nRawOutlineId))
|
||||
EgtSetStatus( nRawPartId, GDB_ST.ON)
|
||||
local b3RawSurf = EgtGetBBoxGlob( nRawPartId, GDB_BB.STANDARD)
|
||||
EgtSetStatus( nRawPartId, GDB_ST.OFF)
|
||||
--EgtSurfTmBBox( nRawOutlineId, b3RawSurf, false, GDB_RT.GLOB)
|
||||
if b3RawSurf then
|
||||
-- Lunghezza e larghezza del pannello
|
||||
dPanelLen = b3RawSurf:getDimX()
|
||||
dPanelWidth = b3RawSurf:getDimY()
|
||||
end
|
||||
end
|
||||
else
|
||||
-- Lunghezza e larghezza del pannello
|
||||
dPanelLen = EgtGetInfo( nMGrpId, 'PANELLEN', 'd')
|
||||
dPanelWidth = EgtGetInfo( nMGrpId, 'PANELWIDTH', 'd')
|
||||
end
|
||||
-- Recupero l'elenco ordinato delle pareti da inserire nel pannello
|
||||
for i = 1, 100 do
|
||||
local sKey = 'PART'..tostring( i)
|
||||
@@ -349,8 +382,9 @@ if bToProcess then
|
||||
-- Verifico dimensioni massime grezzo
|
||||
if dRawL > WD.MAX_LENGTH + 10 * GEO.EPS_SMALL or dRawW > WD.MAX_WIDTH + 10 * GEO.EPS_SMALL or dRawH > WD.MAX_HEIGHT + 10 * GEO.EPS_SMALL then
|
||||
ResetMachGroup( vWall)
|
||||
local sOut = 'Grezzo (' .. EgtNumToString( dRawL, 2) .. ' x ' .. EgtNumToString( dRawW, 2) .. ' x ' .. EgtNumToString( dRawH, 2) .. ') ' ..
|
||||
'oltre il limite della macchina ('..EgtNumToString( WD.MAX_LENGTH, 2)..' x '..EgtNumToString( WD.MAX_WIDTH, 2)..' x '..EgtNumToString( WD.MAX_HEIGHT, 2)..') '
|
||||
local sOut = BWMessageId( 1, 'Grezzo (%s x %s x %s) oltre il limite della macchina (%s x %s x %s)',
|
||||
{EgtNumToString( dRawL, 2), EgtNumToString( dRawW, 2), EgtNumToString( dRawH, 2),
|
||||
EgtNumToString( WD.MAX_LENGTH, 2), EgtNumToString( WD.MAX_WIDTH, 2), EgtNumToString( WD.MAX_HEIGHT, 2)})
|
||||
WALL.ERR = 17
|
||||
WALL.MSG = sOut
|
||||
WriteErrToLogFile( WALL.ERR, WALL.MSG)
|
||||
@@ -371,7 +405,7 @@ if bToProcess then
|
||||
end
|
||||
|
||||
-- Sistemo le pareti nel grezzo
|
||||
local bPbOk, sPbErr = WE.ProcessWalls( dRawL, dRawW, dRawH, vWall, WALL.FLAG == 6, true)
|
||||
local bPbOk, sPbErr = WE.ProcessWalls( dRawL, dRawW, dRawH, vWall, WALL.FLAG == 6, true, nRawOutlineId)
|
||||
if not bPbOk then
|
||||
WALL.ERR = 18
|
||||
WALL.MSG = sPbErr
|
||||
@@ -381,7 +415,7 @@ if bToProcess then
|
||||
else
|
||||
-- Scrivo altezza grezzo nel gruppo di lavoro corrente
|
||||
local nMGrpId = EgtGetCurrMachGroup()
|
||||
EgtSetInfo(nMGrpId, 'PANELHEIGHT', dRawH)
|
||||
EgtSetInfo( nMGrpId, 'PANELHEIGHT', dRawH)
|
||||
end
|
||||
-- altrimenti sistemo
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user