DataWall :
- correzioni per verifica setup prima di simulazione - aggiunto massimo affondamento di lama e fresa nella tavola - in Gorge larghezza come gambo più sicurezza e impostata rotazione asse C - nell'ordinamento si fanno le gole orizzontali (SideMill) prima di quelle inclinate - migliorati controlli forature in nesting.
This commit is contained in:
+44
-8
@@ -401,7 +401,7 @@ local function ContainsStartName( nOperId, StartNames)
|
||||
end
|
||||
|
||||
------ Ordinamento dei tagli, delle fresature e delle forature -------
|
||||
local function SortMach( nPhase, PrevMch, nPartId, nType, StartNames, bExistName, sInfo, bExistInfo, bOneWay, bByTool)
|
||||
local function SortMach( nPhase, PrevMch, nPartId, nType, StartNames, bExistName, sInfo, bExistInfo, bOneWay, bByTool, bByToolAngle)
|
||||
-- dichiarazione tabella
|
||||
local TabCut = {}
|
||||
-- Recupero gli identificativi delle lavorazioni e annullo eventuali allungamenti e Id di altre lavorazioni rappresentate
|
||||
@@ -424,6 +424,7 @@ local function SortMach( nPhase, PrevMch, nPartId, nType, StartNames, bExistName
|
||||
local sTUUID = ''
|
||||
local nToolType = 0
|
||||
local nToolDiam = 0
|
||||
local nToolDir = 0
|
||||
if bByTool then
|
||||
sTUUID = EgtGetMachiningParam( MCH_MP.TUUID)
|
||||
local sToolName = EgtTdbGetToolFromUUID( sTUUID)
|
||||
@@ -434,7 +435,13 @@ local function SortMach( nPhase, PrevMch, nPartId, nType, StartNames, bExistName
|
||||
sTUUID = ''
|
||||
end
|
||||
end
|
||||
table.insert( TabCut, {Mch=nOperId, Ent=nEntId, Start=ptStart, End=ptEnd, Tool=sTUUID, ToolType=nToolType, ToolDiam=nToolDiam})
|
||||
if bByToolAngle then
|
||||
local nClId = EgtGetFirstNameInGroup( nOperId, 'CL')
|
||||
local nPathId = EgtGetFirstInGroup( nClId or GDB_ID.NULL)
|
||||
local vtTool = EgtGetInfo( nPathId, 'EXTR', 'v')
|
||||
nToolDir = EgtIf( vtTool:getZ() > 0.999999, 1, 0)
|
||||
end
|
||||
table.insert( TabCut, {Mch=nOperId, Ent=nEntId, Start=ptStart, End=ptEnd, Tool=sTUUID, ToolType=nToolType, ToolDiam=nToolDiam, ToolDir=nToolDir})
|
||||
end
|
||||
end
|
||||
-- Passo alla operazione successiva
|
||||
@@ -443,7 +450,6 @@ local function SortMach( nPhase, PrevMch, nPartId, nType, StartNames, bExistName
|
||||
|
||||
if bByTool then
|
||||
function ToolCompare(a,b)
|
||||
local y = a.ToolType < b.ToolType and a.ToolDiam > b.ToolDiam and a.Tool < b.Tool
|
||||
if a.ToolType < b.ToolType then
|
||||
return true
|
||||
elseif a.ToolType == b.ToolType then
|
||||
@@ -452,21 +458,48 @@ local function SortMach( nPhase, PrevMch, nPartId, nType, StartNames, bExistName
|
||||
elseif a.ToolDiam == b.ToolDiam then
|
||||
if a.Tool < b.Tool then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
elseif a.Tool == b.Tool then
|
||||
if bByToolAngle then
|
||||
if a.ToolDir > b.ToolDir then
|
||||
return true
|
||||
elseif a.ToolDir == b.ToolDir then
|
||||
return a.Mch < b.Mch
|
||||
end
|
||||
else
|
||||
return a.Mch < b.Mch
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return false
|
||||
-- return a.ToolType < b.ToolType and a.ToolDiam > b.ToolDiam and a.Tool < b.Tool
|
||||
end
|
||||
-- test della funzione di ordinamento
|
||||
if EgtGetDebugLevel() >= 3 then
|
||||
EgtOutLog( ' CompareFeatures Test ')
|
||||
local bCompTest = true
|
||||
for i = 1, #TabCut do
|
||||
for j = i + 1, #TabCut do
|
||||
local bComp1 = ToolCompare( TabCut[i], TabCut[j])
|
||||
local bComp2 = ToolCompare( TabCut[j], TabCut[i])
|
||||
if bComp1 == bComp2 then
|
||||
bCompTest = false
|
||||
EgtOutLog( string.format( ' ProcId : %d vs %d --> ERROR', TabCut[i].Mch, TabCut[j].Mch))
|
||||
end
|
||||
end
|
||||
end
|
||||
if bCompTest then
|
||||
EgtOutLog( ' ALL OK')
|
||||
end
|
||||
end
|
||||
|
||||
table.sort(TabCut, ToolCompare)
|
||||
-- table.sort(TabCut, function(a,b) return a.ToolType < b.ToolType and a.ToolDiam > b.ToolDiam and a.Tool < b.Tool end)
|
||||
local SupportTabCut = {}
|
||||
local nPrevTUUID = 0
|
||||
local nPrevTDirZ = 1
|
||||
for i = 1, #TabCut do
|
||||
-- se tuuid uguale al precedente, lo aggiungo alla lista
|
||||
if nPrevTUUID == TabCut[i].Tool then
|
||||
if nPrevTUUID == TabCut[i].Tool and ( not bByToolAngle or nPrevTDirZ == TabCut[i].ToolDir) then
|
||||
table.insert( SupportTabCut, TabCut[i])
|
||||
-- se tuuid diverso,
|
||||
else
|
||||
@@ -475,6 +508,9 @@ local function SortMach( nPhase, PrevMch, nPartId, nType, StartNames, bExistName
|
||||
-- cancello la lista e aggiorno tuuid corrente
|
||||
SupportTabCut = {}
|
||||
nPrevTUUID = TabCut[i].Tool
|
||||
if bByToolAngle then
|
||||
nPrevTDirZ = TabCut[i].ToolDir
|
||||
end
|
||||
table.insert( SupportTabCut, TabCut[i])
|
||||
end
|
||||
end
|
||||
@@ -511,7 +547,7 @@ local function SortMachinings( nPhase, PrevMch, nPartId)
|
||||
-- Fresature per gole
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Gorge_'}, true, 'MOVE_AFTER', false)
|
||||
-- Fresature che sono rifiniture di spigoli
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'SideMill_'}, true, 'MOVE_AFTER', false, false, true)
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'SideMill_'}, true, 'MOVE_AFTER', false, false, true, true)
|
||||
-- Fresature che sono puliture di spigoli
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Clean_'}, true, 'MOVE_AFTER', false)
|
||||
-- Tagli con lama
|
||||
|
||||
Reference in New Issue
Block a user