- in Squaring aggiunt creazione lavorazione al momento e settaggio parametri

- in Squaring gestito allungamento e attacco verticale per contemplare overmaterial e altezza pezzo
This commit is contained in:
luca.mazzoleni
2024-10-29 09:09:19 +01:00
parent b4b3df0f5e
commit d2b3c32b61
2 changed files with 144 additions and 107 deletions
+8 -41
View File
@@ -1080,6 +1080,7 @@ end
-------------------------------------------------------------------------------------------------------------
local function AddSquaring( sSquaringTool, RawPart)
local nFirstOperationId = EgtGetNextOperation( EgtGetPhaseDisposition( 1))
local dMachiningDepth = RawPart.b3:getDimZ()
local bOk
local sMsg = ''
@@ -1094,9 +1095,9 @@ local function AddSquaring( sSquaringTool, RawPart)
return false, sMsg
end
MachiningGeometries = Squaring.CreateGeometry( sSquaringTool, SquaringTools, RawPart)
SquaringGeometries = Squaring.CreateGeometry( sSquaringTool, SquaringTools, RawPart)
bOk, sMsg, OperationsId = Squaring.AddMachinings( MachiningGeometries)
bOk, sMsg, OperationsId = Squaring.AddMachinings( SquaringGeometries, RawPart, nFirstOperationId)
if not bOk then
for i = 1, #OperationsId do
EgtRemoveOperation( i)
@@ -1105,7 +1106,7 @@ local function AddSquaring( sSquaringTool, RawPart)
return false, sMsg
end
Squaring.AddScrapRemoval()
Squaring.AddScrapRemoval( nFirstOperationId)
if WD.SQUARING_TYPE == 2 then
Squaring.RemoveExternalMachinings( Geometry)
@@ -1272,7 +1273,10 @@ function WallExec.ProcessFeatures()
bOk, sMsg = AddSquaring( 'DoubleDiskmill', RawPart)
end
if not bOk and ( WD.SQUARING_TOOL == 0 or WD.SQUARING_TOOL == 2) then
bOk, sMsg = AddSquaring( 'DoubleDiskmillAndBlade', RawPart)
-- attualmente non gestito, va modificata la configurazione macchina e non si sa se sia gestito in macchina (PLC)
bOk = false
sMsg = 'Squaring not possible : double blade + diskmill not supported'
--bOk, sMsg = AddSquaring( 'DoubleDiskmillAndBlade', RawPart)
end
if not bOk and ( WD.SQUARING_TOOL == 0 or WD.SQUARING_TOOL == 3) then
bOk, sMsg = AddSquaring( 'DoubleBlade', RawPart)
@@ -1298,43 +1302,6 @@ function WallExec.ProcessFeatures()
else
table.insert( Stats, {Err=0, Msg='', Rot=0, CutId=0, TaskId=0})
end
local nFirstOperationId = EgtGetNextOperation( EgtGetPhaseDisposition( nPhase))
local dDepth = b3Raw:getDimZ()
-- ricerca lavorazione
local Machining = Squaring.GetMachining( dDepth)
if Machining.sSquaring then
-- creazione percorsi
local RawPart = { nId = nRawId, b3 = b3Raw}
local SquaringGeometries = Squaring.CreateGeometry( RawPart, Machining)
-- applicazione lavorazioni
local bIsApplyOk, sMsg = Squaring.AddMachinings( Machining, SquaringGeometries, nFirstOperationId)
if not bIsApplyOk then
nTotErr = nTotErr + 1
table.insert( Stats, {Err=1, Msg=sMsg, Rot=0, CutId=0, TaskId=0})
elseif sMsg and #sMsg > 0 then
table.insert( Stats, {Err=-1, Msg=sMsg, Rot=0, CutId=0, TaskId=0})
else
table.insert( Stats, {Err=0, Msg='', Rot=0, CutId=0, TaskId=0})
end
-- pulizia sfridi alla prima lavorazione dopo la squadratura
EgtSetCurrMachining( nFirstOperationId)
local sMachiningNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
sMachiningNotes = sMachiningNotes .. 'ScrapRemove=1;'
EgtSetMachiningParam( MCH_MP.USERNOTES, sMachiningNotes)
else
local sErr = 'Error : Squaring not found in library'
EgtOutLog( sErr)
table.insert( Stats, {Err=1, Msg=sErr, Rot=0, CutId=0, TaskId=0})
end
end
-- Aggiornamento finale di tutto