DataWall :

- modifiche, migliorie e correzioni varie.
This commit is contained in:
Dario Sassi
2020-07-20 07:40:07 +00:00
parent 17dd2b85b8
commit c646e7cbf9
6 changed files with 318 additions and 34 deletions
+44 -3
View File
@@ -1,4 +1,4 @@
-- WallExec.lua by Egaltech s.r.l. 2020/06/24
-- WallExec.lua by Egaltech s.r.l. 2020/07/15
-- Libreria esecuzione lavorazioni per Pareti
-- Tabella per definizione modulo
@@ -16,6 +16,8 @@ _G.package.loaded.WMachiningLib = nil
local WM = require( 'WMachiningLib')
_G.package.loaded.WallLib = nil
local WL = require( 'WallLib')
_G.package.loaded.WProcessCut = nil
local Cut = require( 'WProcessCut')
_G.package.loaded.WProcessLapJoint = nil
local LapJoint = require( 'WProcessLapJoint')
_G.package.loaded.WProcessDrill = nil
@@ -124,8 +126,12 @@ end
local function ClassifyFeatures( vProc, b3Raw)
for i = 1, #vProc do
local Proc = vProc[i]
-- se taglio
if Cut.Identify( Proc) then
local bOk = Cut.Classify( Proc, b3Raw)
if not bOk then Proc.Flg = 0 end
-- se tasca
if LapJoint.Identify( Proc) then
elseif LapJoint.Identify( Proc) then
local bOk = LapJoint.Classify( Proc, b3Raw)
if not bOk then Proc.Flg = 0 end
-- se foratura
@@ -156,8 +162,12 @@ end
local function AddFeatureMachining( Proc, nRawId, b3Raw)
local bOk = true
local sErr = ''
-- se taglio (1/2-010-X) o taglio longitudinale (0/3/4-010-X)
if Cut.Identify( Proc) then
-- esecuzione taglio
bOk, sErr = Cut.Make( Proc, nRawId, b3Raw)
-- se tasca (3/4-030-X)
if LapJoint.Identify( Proc) then
elseif LapJoint.Identify( Proc) then
-- esecuzione tasca
bOk, sErr = LapJoint.Make( Proc, nRawId, b3Raw)
-- se foratura ( 3/4-040-X)
@@ -176,6 +186,35 @@ local function AddFeatureMachining( Proc, nRawId, b3Raw)
return bOk, sErr
end
-------------------------------------------------------------------------------------------------------------
local function MoveMachiningsAtEnd( nPhase, nType, sStartName)
local nOperId = EgtGetPhaseDisposition( nPhase)
local nLastId = EgtGetLastOperation()
local nInsertId = nLastId
while nOperId do
local nNextOperId = EgtGetNextOperation( nOperId)
if EgtGetOperationPhase( nOperId) == nPhase and EgtGetOperationType( nOperId) == nType and
( not sStartName or string.sub( EgtGetName( nOperId), 1, #sStartName) == sStartName) then
EgtRelocateGlob( nOperId, nInsertId, GDB_IN.AFTER)
nInsertId = nOperId
end
if nOperId == nLastId then
break
end
nOperId = nNextOperId
end
end
-------------------------------------------------------------------------------------------------------------
local function SortMachinings()
local nPhase = 1
-- Sposto i tagli di lama alla fine
MoveMachiningsAtEnd( nPhase, MCH_OY.SAWING)
-- Sposto i tagli con sega a catena dopo i tagli di lama
MoveMachiningsAtEnd( nPhase, MCH_OY.MORTISING, 'Csaw_')
end
-------------------------------------------------------------------------------------------------------------
function WallExec.ProcessFeatures()
-- errori e stato
@@ -220,6 +259,8 @@ function WallExec.ProcessFeatures()
table.insert( Stats, {Err=1, Msg=sMsg, Rot=0, CutId=Proc.CutId, TaskId=Proc.TaskId})
end
end
-- riordino le lavorazioni
SortMachinings()
-- restituzione risultati
return ( nTotErr == 0), Stats
end