- aggiunta gestione in doppio di forature e groove passanti (rivolte verso Z+)

- lieve correzione a check utensile doppio
- aggiunto interasse minimo per lavorazioni in doppio
This commit is contained in:
luca.mazzoleni
2023-08-09 17:16:47 +02:00
parent a4c3b74434
commit 5e6dfe320f
3 changed files with 209 additions and 17 deletions
+57 -6
View File
@@ -55,7 +55,7 @@ end
---------------------------------------------------------------------
-- Classificazione della feature
function WPD.Classify( Proc, b3Raw)
function WPD.Classify( Proc, b3Raw)
-- recupero e verifico l'entità foro
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') or 0
@@ -156,6 +156,41 @@ function WPD.RotateClassify( Proc)
end
end
---------------------------------------------------------------------
local function IsToolDoubleOk( sToolMasterName, sToolDoubleName)
local bIsToolDoubleOk = false
-- dimensioni utensile master
EgtTdbSetCurrTool( sToolMasterName)
local dTMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT)
local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
-- dimensioni utensile double
EgtTdbSetCurrTool( sToolDoubleName)
local dTMaxMatDouble = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT)
local dTDiamDouble = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
-- controllo che siano uguali
bIsToolDoubleOk = ( dTMaxMatDouble > dTMaxMat - 100 * GEO.EPS_SMALL) and
( abs( dTDiam - dTDiamDouble) < 100 * GEO.EPS_SMALL) and
EgtTdbGetCurrToolParam( MCH_TP.ACTIVE)
return bIsToolDoubleOk
end
---------------------------------------------------------------------
local function IsMachiningOkForDouble( sMachining)
local bDoubleOk = false
if sMachining and EgtMdbSetCurrMachining( sMachining) then
-- recupero l'utensile della lavorazione
local sToolMasterName = EgtMdbGetCurrMachiningParam( MCH_MP.TOOL)
if EgtTdbSetCurrTool( sToolMasterName or '') then
-- cerco eventuale utensile in doppio
local sToolDoubleName = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'DOUBLE', 's')
if sToolDoubleName and EgtTdbSetCurrTool( sToolDoubleName) then
bDoubleOk = IsToolDoubleOk( sToolMasterName, sToolDoubleName)
end
end
end
return bDoubleOk
end
---------------------------------------------------------------------
local function IsHorizLongDrill( Proc)
-- recupero e verifico l'entità foro
@@ -263,10 +298,21 @@ function WPD.Make( Proc, nRawId, b3Raw)
end
end
end
local bUseDLenToFindDrilling = true
local sDrilling, nType = WM.FindDrilling( dDiam, dLen, sHead)
if not sDrilling then
bUseDLenToFindDrilling = false
sDrilling, nType = WM.FindDrilling( dDiam, nil, sHead)
end
-- se Proc è settata per essere specchiata cerco la lavorazione adatta e verifico possa essere effettivamente specchiata
if Proc.Double and Proc.Double == 2 then
local sDrillingBackup = sDrilling
sDrilling = WM.FindDrilling( dDiam, EgtIf( bUseDLenToFindDrilling, dLen, nil), 'H1')
if not IsMachiningOkForDouble( sDrilling) then
Proc.Double = 0
sDrilling = sDrillingBackup
end
end
if sHead and not sDrilling then
sDrilling, nType = WM.FindDrilling( dDiam, dLen)
if not sDrilling then
@@ -447,21 +493,26 @@ function WPD.Make( Proc, nRawId, b3Raw)
end
end
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
-- Note utente
local sUserNotes = ''
-- leggo eventuali note esistenti della lavorazione
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
-- se foratura o svuotatura, dichiarazione nessuna generazione sfridi per Vmill
if nType == 'Drill' or nType == 'Pocket' then
sUserNotes = 'VMRS=0;'
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
end
-- se foratura
if nType == 'Drill' then
-- aggiungo alle note massima elevazione (coincide con affondamento)
sUserNotes = sUserNotes .. 'MaxElev=' .. EgtNumToString( dDepth, 1) .. ';'
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dDepth, 1))
-- se foro passante, aggiungo questa qualifica alle note
if bOpen then
sUserNotes = sUserNotes .. 'Open=1;'
sUserNotes = EgtSetValInNotes( sUserNotes, 'Open', 1)
end
end
-- se lavorazione in doppio aggiungo le rispettive note
if Proc.Double and Proc.Double == 2 then
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double)
sUserNotes = EgtSetValInNotes( sUserNotes, 'MirrorAx', Proc.MirrorAx)
end
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- eseguo
if not EgtApplyMachining( true, false) then