DataBeam :

- correzioni per tagli su pezzi grossi
- correzioni varie.
This commit is contained in:
Dario Sassi
2019-09-04 18:31:10 +00:00
parent fcdc31ae09
commit 4d26232057
9 changed files with 140 additions and 114 deletions
+20 -13
View File
@@ -1,6 +1,7 @@
-- BeamExec.lua by Egaltech s.r.l. 2019/07/12
-- BeamExec.lua by Egaltech s.r.l. 2019/09/04
-- Libreria esecuzione lavorazioni per Travi
-- 2019/07/11 Aggiunta gestione stato rotazione di feature per TS3.
-- 2019/09/04 Corretto controllo feature di testa e coda con sovramateriale di testa elevato.
-- Tabella per definizione modulo
local BeamExec = {}
@@ -207,12 +208,12 @@ end
local function IsHeadFeature( Proc, b3Raw, dCurrOvmH)
-- feature sempre di testa o coda per il gruppo
if Proc.Grp == 1 or Proc.Grp == 2 then
return ( Proc.Box:getCenter():getX() > b3Raw:getCenter():getX())
return ( Proc.Box:getCenter():getX() > b3Raw:getCenter():getX() - 0.5 * dCurrOvmH)
end
-- feature sempre di testa o coda nonostante il gruppo
if ( Proc.Grp == 3 or Proc.Grp == 4) and
( Proc.Prc == 51 or Proc.Prc == 56 or Proc.Prc == 100 or Proc.Prc == 101 or Proc.Prc == 102 or Proc.Prc == 103 or Proc.Prc == 106) then
return ( Proc.Box:getCenter():getX() > b3Raw:getCenter():getX())
return ( Proc.Box:getCenter():getX() > b3Raw:getCenter():getX() - 0.5 * dCurrOvmH)
end
-- gestioni speciali
if LapJoint.Identify( Proc) then
@@ -232,15 +233,15 @@ local function IsHeadFeature( Proc, b3Raw, dCurrOvmH)
end
-------------------------------------------------------------------------------------------------------------
local function IsTailFeature( Proc, b3Raw)
local function IsTailFeature( Proc, b3Raw, dCurrOvmH)
-- feature sempre di testa o coda per il gruppo
if Proc.Grp == 1 or Proc.Grp == 2 then
return ( Proc.Box:getCenter():getX() < b3Raw:getCenter():getX())
return ( Proc.Box:getCenter():getX() < b3Raw:getCenter():getX() - 0.5 * dCurrOvmH)
end
-- feature sempre di testa o coda nonostante il gruppo
if ( Proc.Grp == 3 or Proc.Grp == 4) and
( Proc.Prc == 51 or Proc.Prc == 56 or Proc.Prc == 100 or Proc.Prc == 101 or Proc.Prc == 102 or Proc.Prc == 103 or Proc.Prc == 106) then
return ( Proc.Box:getCenter():getX() < b3Raw:getCenter():getX())
return ( Proc.Box:getCenter():getX() < b3Raw:getCenter():getX() - 0.5 * dCurrOvmH)
end
-- gestioni speciali
if LapJoint.Identify( Proc) then
@@ -286,7 +287,7 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH)
Proc.Box = EgtGetBBoxGlob( ProcId, GDB_BB.STANDARD)
Proc.Fct = EgtSurfTmFacetCount( ProcId) or 0
Proc.Head = IsHeadFeature( Proc, b3Raw, dCurrOvmH)
Proc.Tail = IsTailFeature( Proc, b3Raw)
Proc.Tail = IsTailFeature( Proc, b3Raw, dCurrOvmH)
Proc.Diam = 0
Proc.Fcs = 0
Proc.Fce = 0
@@ -314,7 +315,7 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH)
Proc2.Fct = Proc.Fct
Proc2.Diam = Proc.Diam
Proc2.Head = Proc.Head
Proc2.Tail = Drill.IsTailFeature( Proc2, b3Raw)
Proc2.Tail = Drill.IsTailFeature( Proc2, b3Raw, dCurrOvmH)
Proc2.Fcs = Proc.Fce
Proc2.Fce = Proc.Fcs
Proc2.CutId = Proc.CutId
@@ -332,17 +333,18 @@ end
-------------------------------------------------------------------------------------------------------------
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 l'altro è intestazione va sempre prima
if Hcut.Identify( B2) then
return false
end
-- se primo è intestazione va sempre prima
if Hcut.Identify( B1) then
return true
end
-- se l'altro è intestazione va sempre prima
if Hcut.Identify( B2) then
return false
end
-- se primo è feature di coda e l'altro è separazione o non è feature di coda
if B1.Tail and ( Split.Identify( B2) or not B2.Tail) then
return false
@@ -397,8 +399,10 @@ local function OrderFeatures( vProc, b3Raw)
return B1.Box:getCenter():getZ() > B2.Box:getCenter():getZ()
end
end
-- eseguo ordinamento
table.sort( vProc, CompareFeatures)
-- riunisco fori con lo stesso diametro e non troppo lontani
for i = 1, #vProc do
local ProcI = vProc[i]
@@ -454,6 +458,9 @@ local function ClassifyFeatures( vProc, b3Raw, Stats)
-- se separazione
elseif Split.Identify( Proc) then
nSplitting = i
-- se taglio
elseif Cut.Identify( Proc) then
bOk, bDown = Cut.Classify( Proc)
-- se doppio taglio
elseif DoubleCut.Identify( Proc) then
bOk, bDown = DoubleCut.Classify( Proc)
@@ -524,7 +531,7 @@ local function ClassifyFeatures( vProc, b3Raw, Stats)
else
Proc.Flg = 0
bAllOk = false
table.insert( Stats, {Err = 1, Msg='Error : classify failed', CutId=Proc.CutId, TaskId=Proc.TaskId})
table.insert( Stats, {Err = 1, Msg='Error : impossible to machine', CutId=Proc.CutId, TaskId=Proc.TaskId})
end
end
-- se necessario ribaltamento, assegno intestatura alla fase ribaltata