DataBeam :

- migliorie e correzioni.
This commit is contained in:
Dario Sassi
2019-07-15 07:00:32 +00:00
parent 19df7d3338
commit d39116d84f
5 changed files with 164 additions and 82 deletions
+21 -16
View File
@@ -1,5 +1,6 @@
-- BeamExec.lua by Egaltech s.r.l. 2019/07/01
-- BeamExec.lua by Egaltech s.r.l. 2019/07/12
-- Libreria esecuzione lavorazioni per Travi
-- 2019/07/11 Aggiunta gestione stato rotazione di feature per TS3.
-- Tabella per definizione modulo
local BeamExec = {}
@@ -133,6 +134,10 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, vBeam)
if (( abs( PartWidth - dRawW) < 10 * GEO.EPS_SMALL and abs( PartHeight - dRawH) < 10 * GEO.EPS_SMALL) or
( abs( PartHeight - dRawW) < 10 * GEO.EPS_SMALL and abs( PartWidth - dRawH) < 10 * GEO.EPS_SMALL)) and
NextLen >= 0 then
-- eventuale sovramateriale di testa
if vBeam[i].PosX then
DeltaS = max( vBeam[i].PosX - ( dRawL - Len), 0)
end
-- dimensioni del grezzo
local CrawLen = PartLen + DeltaS + DeltaE
local Delta = DeltaE
@@ -148,8 +153,8 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, vBeam)
local sOut = 'Error creating Additional Group in Part ' .. tostring( Pz)
return false, sOut
end
-- se primo pezzo con sovramateriale, aggiungo faccia per taglio iniziale al pezzo
if i == 1 and dOvmHead > 1. then
-- se sovramateriale di testa, aggiungo faccia per taglio iniziale al pezzo
if DeltaS > 1. then
BL.AddPartStartFace( Pz, b3Solid)
EgtSetInfo( nRaw, 'HOVM', DeltaS)
end
@@ -323,12 +328,12 @@ local function OrderFeatures( vProc, b3Raw)
-- funzione di confronto
-- secondo centro box in X (taglio di intestazione prima di altri tagli di testa e taglio di separazione però prima di altri tagli di coda)
local function CompareFeatures( B1, B2)
-- se primo è feature di testa e l'altro è intestazione
if B1.Head and Hcut.Identify( B2) then
-- se l'altro è intestazione va sempre prima
if Hcut.Identify( B2) then
return false
end
-- se secondo è feature di testa e l'altro è intestazione
if B2.Head and Hcut.Identify( B1) then
-- se primo è intestazione va sempre prima
if Hcut.Identify( B1) then
return true
end
-- se primo è feature di coda e l'altro è separazione o non è feature di coda
@@ -373,9 +378,9 @@ local function OrderFeatures( vProc, b3Raw)
return ( B1.Prc == 50 and B2.Prc == 52)
end
-- confronto standard
if abs( B1.Box:getCenter():getX() - B2.Box:getCenter():getX()) > 1.0 then
if abs( B1.Box:getCenter():getX() - B2.Box:getCenter():getX()) > 100.0 then
return B1.Box:getCenter():getX() > B2.Box:getCenter():getX()
elseif abs( B1.Box:getCenter():getY() - B2.Box:getCenter():getY()) > 1.0 then
elseif abs( B1.Box:getCenter():getY() - B2.Box:getCenter():getY()) > 100.0 then
return B1.Box:getCenter():getY() > B2.Box:getCenter():getY()
else
return B1.Box:getCenter():getZ() > B2.Box:getCenter():getZ()
@@ -694,11 +699,11 @@ function BeamExec.ProcessFeatures()
local bOk, sMsg, bNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, b3Raw)
if not bOk then
nTotErr = nTotErr + 1
table.insert( Stats, {Err=1, Msg=sMsg, CutId=Proc.CutId, TaskId=Proc.TaskId})
table.insert( Stats, {Err=1, Msg=sMsg, Rot=-2, CutId=Proc.CutId, TaskId=Proc.TaskId})
elseif sMsg and #sMsg > 0 then
table.insert( Stats, {Err=-1, Msg=sMsg, CutId=Proc.CutId, TaskId=Proc.TaskId})
table.insert( Stats, {Err=-1, Msg=sMsg, Rot=-2, CutId=Proc.CutId, TaskId=Proc.TaskId})
else
table.insert( Stats, {Err=0, Msg='', CutId=Proc.CutId, TaskId=Proc.TaskId})
table.insert( Stats, {Err=0, Msg='', Rot=-2, CutId=Proc.CutId, TaskId=Proc.TaskId})
end
-- se era taglio di separazione, aggiungo nuova fase
if bNewPhase then
@@ -742,11 +747,11 @@ function BeamExec.ProcessFeatures()
local bOk, sMsg, bNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, b3Raw)
if not bOk then
nTotErr = nTotErr + 1
table.insert( Stats, {Err=1, Msg=sMsg, CutId=Proc.CutId, TaskId=Proc.TaskId})
table.insert( Stats, {Err=1, Msg=sMsg, Rot=0, CutId=Proc.CutId, TaskId=Proc.TaskId})
elseif sMsg and #sMsg > 0 then
table.insert( Stats, {Err=-1, Msg=sMsg, CutId=Proc.CutId, TaskId=Proc.TaskId})
table.insert( Stats, {Err=-1, Msg=sMsg, Rot=0, CutId=Proc.CutId, TaskId=Proc.TaskId})
else
table.insert( Stats, {Err=0, Msg='', CutId=Proc.CutId, TaskId=Proc.TaskId})
table.insert( Stats, {Err=0, Msg='', Rot=0, CutId=Proc.CutId, TaskId=Proc.TaskId})
end
-- se era taglio di separazione, aggiungo nuova fase
if bNewPhase then
@@ -773,7 +778,7 @@ function BeamExec.ProcessFeatures()
local bApplOk, sApplErrors = EgtApplyAllMachinings()
if not bApplOk then
nTotErr = nTotErr + 1
table.insert( Stats, {Err = 1, Msg=sApplErrors, CutId=0, TaskId=0})
table.insert( Stats, {Err = 1, Msg=sApplErrors, Rot=0, CutId=0, TaskId=0})
end
return ( nTotErr == 0), Stats