- Migliorato recupero utensili Essetre in base a TAG

- Aggiunta lettura di qualche parametro Q di Essetre
- Piccole modifiche a strategie
This commit is contained in:
andrea.villa
2025-08-29 10:55:45 +02:00
parent 5a02c08965
commit 70b4927fd2
4 changed files with 76 additions and 10 deletions
+55 -9
View File
@@ -406,7 +406,6 @@ local function GetParameters_Essetre( Proc, sStrategyIdToGet)
local idSlaveProc = PROCESSINGS[Proc.nIndexPartInParts].Rotation[Proc.nCurrentRotation][Proc.SlaveProcIndexes[1]].id
local dDepthChamfer = EgtGetInfo( idSlaveProc or GDB_ID.NULL, 'Q06', 'd') or 0
table.insert( Parameters, { sName = 'dDepthChamfer', sValue = dDepthChamfer, sType = 'd'})
local dCuttingStrategy = EgtGetInfo( idSlaveProc or GDB_ID.NULL, 'Q05', 'd') or 0
local bForceChainSaw = dCuttingStrategy > 0
table.insert( Parameters, { sName = 'bForceChainSaw', sValue = bForceChainSaw, sType = 'b'})
@@ -419,17 +418,30 @@ local function GetParameters_Essetre( Proc, sStrategyIdToGet)
local dDepthChamfer = EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q06', 'd') or 0
table.insert( Parameters, { sName = 'dDepthChamfer', sValue = dDepthChamfer, sType = 'd'})
local bForcePocketing = EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q07', 'd') == 1
-- tutte le strategie che non siano svuotatura, devono essere rimosse
if bForcePocketing and sStrategyIdToGet ~= 'STR0002' then
Parameters.bToRemove = true
else
if sStrategyIdToGet == 'STR0002' then
-- non ci sono Q per questa strategia
elseif sStrategyIdToGet == 'STR0005' then
if bForcePocketing then
Parameters = { { bToRemove = true}}
else
local dCuttingStrategy = EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q04', 'd') or 0
local sCuttingStrategy = EgtIf( dCuttingStrategy == 1, 'KEEP_WASTE_ATTACHED', 'AUTO')
table.insert( Parameters, { sName = 'sCuttingStrategy', sValue = sCuttingStrategy, sType = 's'})
end
end
-- Feature : Drill (1-40)
elseif ID.IsDrill( Proc) then
if sStrategyIdToGet == 'STR0011' then
local dDepthPreHole = ( EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q03', 'd') or 0) == 1
table.insert( Parameters, { sName = 'dDepthPreHole', sValue = dDepthPreHole, sType = 'd'})
elseif sStrategyIdToGet == 'STR0013' then
local bOnlyContouring = ( EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q01', 'd') or 0) == 1
table.insert( Parameters, { sName = 'bOnlyContouring', sValue = bOnlyContouring, sType = 'b'})
end
local bDrillFromOneSide = ( EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q02', 'd') or 0) == 1
local sDrillingMode = EgtIf( bDrillFromOneSide, 'PREFER_ONE', 'AUTO')
table.insert( Parameters, { sName = 'sDrillingMode', sValue = sDrillingMode, sType = 's'})
end
return Parameters
@@ -500,18 +512,52 @@ local function GetTools_Essetre( Proc, sMachiningCategory)
end
ToolList = GetToolsFromMachDataFile( DrillData, TagList)
end
elseif sMachiningCategory == 'Milling' or sMachiningCategory == 'MillingFinish' or sMachiningCategory == 'MillingAntiSplint' then
elseif sMachiningCategory == 'Milling' or sMachiningCategory == 'MillingFinish' or sMachiningCategory == 'MillingAntiSplint' or sMachiningCategory == 'MillingChamfer' then
if EgtExistsFile( sMachDir .. '\\Beam\\MillingData.lua') then
local MillingData = dofile( sMachDir .. '\\Beam\\MillingData.lua')
-- TODO da fare!!
TagList = { 'Prof', 'FreeContour', 'Tenon', 'DtTenon', 'DtMortise', 'BirdsMouth', 'Chamfer', 'Mark', 'Text', 'Long2Cut',
'Long2CutDown', 'LongSmallCut', 'BHSideMill', 'CleanCorner', 'ProfTCone', 'Long2CutSide', 'SmallToolContour',
'AntiSplintMillCut', 'SideMillAsBlade', 'Prof_end'}
-- si cercano TAG esclusivi
if sMachiningCategory == 'MillingAntiSplint' then
TagList = { 'AntiSplintMillCut'}
elseif ID.IsTenon( Proc) then
TagList = { 'Tenon'}
elseif ID.IsDovetailTenon( Proc) then
TagList = { 'DtTenon'}
elseif ID.IsDovetailMortise( Proc) then
TagList = { 'DtMortise'}
elseif ID.IsHeadConcaveProfile( Proc) or ID.IsHeadConvexProfile( Proc) or ID.IsHeadCamberedProfile( Proc) or ID.IsRoundArch( Proc) or ID.IsHeadProfile( Proc) then
if sMachiningCategory == 'MillingFinish' then
TagList = { 'Prof_end'}
end
if not TagList or #TagList == 0 then
TagList = { 'Prof', 'Prof_end'}
end
elseif ID.IsFreeContour( Proc) then
TagList = { 'FreeContour', 'Prof', 'Prof_end'}
elseif ID.IsMarking( Proc) then
TagList = { 'Mark'}
elseif sMachiningCategory == 'MillingChamfer' then
TagList = { 'Chamfer', 'Mark'}
elseif ID.IsText( Proc) then
TagList = { 'Text'}
elseif ID.IsTyroleanDovetail( Proc) or ID.IsDovetail( Proc) then
TagList = { 'ProfTCone', 'Long2Cut'}
elseif ID.IsBirdsMouth( Proc) then
TagList = { 'BirdsMouth'}
elseif sMachiningCategory == 'MillingFinish' then
TagList = { 'CleanCorner', 'SmallToolContour'}
elseif ID.IsSlot( Proc) or ID.IsFrontSlot( Proc) or ID.IsLapJoint( Proc) or ID.IsNotchRabbet( Proc) or ID.IsNotch( Proc) or
ID.IsPocket( Proc) or ID.IsMortise( Proc) or ID.IsFrontMortise( Proc) then
TagList = { 'SideMillAsBlade', 'BHSideMill', 'Long2Cut', 'Long2CutDown', 'LongSmallCut', 'Long2CutSide'}
elseif ID.IsDoubleLongitudinalCut( Proc) or ID.IsDoubleLongitudinalCut( Proc) then
TagList = { 'Long2Cut', 'Long2CutDown', 'LongSmallCut', 'Long2CutSide'}
end
ToolList = GetToolsFromMachDataFile( MillingData, TagList)
end
elseif sMachiningCategory == 'Pocketing' then
if EgtExistsFile( sMachDir .. '\\Beam\\PocketingData.lua') then
local PocketingData = dofile( sMachDir .. '\\Beam\\PocketingData.lua')
-- si cercano TAG esclusivi
if ID.IsMortise( Proc) then
TagList = { 'Mortise', 'Mortise'}
else
+10
View File
@@ -12,6 +12,16 @@
"sMessageId": " ",
"sMinUserLevel": "1"
},
{
"sName": "dDepthPreHole",
"sNameNge": "DEPTHPREHOLE",
"sValue": "0",
"sDescriptionShort": "Depth PreHole",
"sDescriptionLong": "",
"sType": "d",
"sMessageId": " ",
"sMinUserLevel": "1"
},
{
"sName": "sDrillingMode",
"sNameNge": "DRILLING_MODE",
+10
View File
@@ -22,6 +22,16 @@
"sMessageId": " ",
"sMinUserLevel": "1"
},
{
"sName": "bOnlyContouring",
"sNameNge": "ONLYCONT",
"sValue": "0",
"sDescriptionShort": "Execute contour only",
"sDescriptionLong": "Execute the contour anyway, even the hole is bigger than the tool diameter",
"sType": "b",
"sMessageId": " ",
"sMinUserLevel": "1"
},
{
"sName": "sDrillingMode",
"sNameNge": "DRILLING_MODE",
+1 -1
View File
@@ -173,7 +173,7 @@ function STR0013.Make( bAddMachining, Proc, Part, CustomParameters)
MachiningToAdd = BeamLib.MergeTables( MachiningToAdd, Strategy.Machinings[j])
MachiningToAdd.Steps.dStep = TOOLS[nIndexTool].dStep / 3
-- se diametro foro più grande della fresa, ma non oltre il doppio del diametro, si fa contornatura a spirale
elseif Proc.FeatureInfo.dDrillDiam < ( TOOLS[nIndexTool].dDiameter * 0.75) * 2 then
elseif Proc.FeatureInfo.dDrillDiam < ( TOOLS[nIndexTool].dDiameter * 0.75) * 2 or Strategy.Parameters.bOnlyContouring then
MachiningToAdd = MachiningLib.InitMachiningParameters( MCH_MY.MILLING)
MachiningToAdd = BeamLib.MergeTables( MachiningToAdd, Strategy.Machinings[j])
-- il diametro deve essere almeno 1mm più grande del foro, altrimenti la macchina non riesce ad interpolare