Compare commits

...

3 Commits

4 changed files with 33 additions and 22 deletions
+19 -3
View File
@@ -221,7 +221,8 @@ function OnSimulDispositionStart()
end end
-- Se vero inizio e abilitato creo gli Zmap -- Se vero inizio e abilitato creo gli Zmap
EMT.VMILL = {} EMT.VMILL = {}
if not EMT.SIM1ST and EgtGetInfo( EgtGetCurrMachGroup(), 'Vm', 'b') then if not EMT.SIM1ST then
local bShowVMill = EgtGetInfo( EgtGetCurrMachGroup(), 'Vm', 'b')
local nLastOrd = GetPhaseOrd( EgtGetPhaseCount()) local nLastOrd = GetPhaseOrd( EgtGetPhaseCount())
local nPartRawId = EgtGetFirstRawPart() local nPartRawId = EgtGetFirstRawPart()
while nPartRawId do while nPartRawId do
@@ -247,7 +248,7 @@ function OnSimulDispositionStart()
-- determino la risoluzione dello Zmap -- determino la risoluzione dello Zmap
local dTol = 4.71 local dTol = 4.71
if EmtGetVMillStep then if EmtGetVMillStep then
dTol = EmtGetVMillStep( b3Raw:getDimX(), b3Raw:getDimY(), b3Raw:getDimZ(), dTol) dTol = EmtGetVMillStep( b3Raw:getDimX(), b3Raw:getDimY(), b3Raw:getDimZ(), EMT.VMILLTOL or dTol)
else else
local dArea = b3Raw:getDimX() * b3Raw:getDimY() + b3Raw:getDimX() * b3Raw:getDimZ() + b3Raw:getDimY() * b3Raw:getDimZ() local dArea = b3Raw:getDimX() * b3Raw:getDimY() + b3Raw:getDimX() * b3Raw:getDimZ() + b3Raw:getDimY() * b3Raw:getDimZ()
if dArea < 0.075e6 then if dArea < 0.075e6 then
@@ -263,14 +264,15 @@ function OnSimulDispositionStart()
elseif dArea < 2.4e6 then elseif dArea < 2.4e6 then
dTol = 3.77 dTol = 3.77
end end
end
dTol = min( dTol, EMT.VMILLTOL or dTol) -- imposto dTol al valore minore tra quello per volume e quello per spessore lama dTol = min( dTol, EMT.VMILLTOL or dTol) -- imposto dTol al valore minore tra quello per volume e quello per spessore lama
end
-- creo lo Zmap -- creo lo Zmap
local VMillId = EgtVolZmapBox( nPartRawId, b3Raw:getMin(), b3Raw:getDimX(), b3Raw:getDimY(), b3Raw:getDimZ(), dTol, true, GDB_RT.GLOB) local VMillId = EgtVolZmapBox( nPartRawId, b3Raw:getMin(), b3Raw:getDimX(), b3Raw:getDimY(), b3Raw:getDimZ(), dTol, true, GDB_RT.GLOB)
if VMillId then if VMillId then
EgtSetName( VMillId, 'VMill') EgtSetName( VMillId, 'VMill')
EgtSetLevel( VMillId, GDB_LV.TEMP) EgtSetLevel( VMillId, GDB_LV.TEMP)
EgtSetColor( VMillId, EgtGetColor( nSolId), false) EgtSetColor( VMillId, EgtGetColor( nSolId), false)
if bShowVMill then
-- nascondo le altre geometrie -- nascondo le altre geometrie
local nId = EgtGetFirstInGroup( nPartRawId) local nId = EgtGetFirstInGroup( nPartRawId)
while nId do while nId do
@@ -279,6 +281,9 @@ function OnSimulDispositionStart()
end end
nId = EgtGetNext( nId) nId = EgtGetNext( nId)
end end
else
EgtSetStatus( VMillId, GDB_ST.OFF)
end
table.insert( EMT.VMILL, VMillId) table.insert( EMT.VMILL, VMillId)
end end
nPartRawId = EgtGetNextRawPart( nPartRawId) nPartRawId = EgtGetNextRawPart( nPartRawId)
@@ -338,7 +343,9 @@ function OnSimulDispositionStart()
-- gestione eventuale scarto affettato successivo -- gestione eventuale scarto affettato successivo
if EMT.VMILL and #EMT.VMILL > 0 then if EMT.VMILL and #EMT.VMILL > 0 then
EMT.SCRAP = nScrapRawId EMT.SCRAP = nScrapRawId
if EgtGetInfo( EgtGetCurrMachGroup(), 'Vm', 'b') then
EgtSetStatus( EMT.SCRAP or GDB_ID.NULL, GDB_ST.OFF) EgtSetStatus( EMT.SCRAP or GDB_ID.NULL, GDB_ST.OFF)
end
else else
EMT.SCRAP = nil EMT.SCRAP = nil
end end
@@ -1484,6 +1491,8 @@ end
function ExecUnloading() function ExecUnloading()
if EMT.VMILL and #EMT.VMILL > 0 then if EMT.VMILL and #EMT.VMILL > 0 then
local vMillId = EMT.VMILL[1] local vMillId = EMT.VMILL[1]
-- grezzo di appartenenza
local nPartRawId = EgtGetParent( vMillId)
-- gruppo dei Vmill -- gruppo dei Vmill
local nVmGrpId = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'VMill') local nVmGrpId = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'VMill')
-- li sposto per lasciare spazio al nuovo pezzo -- li sposto per lasciare spazio al nuovo pezzo
@@ -1507,6 +1516,7 @@ function ExecUnloading()
EgtSetAxisPos( 'PW', MaxWOpen) EgtSetAxisPos( 'PW', MaxWOpen)
end end
EgtMove( nLayId, vtMove, GDB_RT.GLOB) EgtMove( nLayId, vtMove, GDB_RT.GLOB)
EgtSetStatus( vMillId, GDB_ST.ON)
EgtSetLevel( vMillId, GDB_LV.USER) EgtSetLevel( vMillId, GDB_LV.USER)
-- aggiungo gli spigoli -- aggiungo gli spigoli
if EgtVolZmapSetShowEdges then if EgtVolZmapSetShowEdges then
@@ -1525,6 +1535,12 @@ function ExecUnloading()
EgtDraw() EgtDraw()
-- se finito -- se finito
if EMT.PHASE == EgtGetPhaseCount() then if EMT.PHASE == EgtGetPhaseCount() then
-- in ogni caso, nascondo ultimo pezzo
local nId = EgtGetFirstInGroup( nPartRawId)
while nId do
EgtSetStatus( nId, GDB_ST.OFF)
nId = EgtGetNext( nId)
end
-- se impostato di salvare i Vmill, lo faccio -- se impostato di salvare i Vmill, lo faccio
local sMachIni = EgtGetCurrMachineDir() .. '\\' .. EgtGetCurrMachineName() .. '.ini' local sMachIni = EgtGetCurrMachineDir() .. '\\' .. EgtGetCurrMachineName() .. '.ini'
if EgtGetStringFromIni( 'VMill', 'Save', '', sMachIni) == '1' then if EgtGetStringFromIni( 'VMill', 'Save', '', sMachIni) == '1' then
+2 -11
View File
@@ -556,21 +556,12 @@ local function IsFirstMachiningOfStart( nMchId)
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
--TODO : controllare più precisamente se il primo punto della lavorazione fa collidere utensile, codolo, B o C contro la trave se non arretrata prima della discesa in Z.
-- ora fa arretrare la trave anche per le lavorazioni che non collidono ma semplicemente iniziano più avanti della trave, anche se lavorazioni sul fianco.
local function IsHeadMachining( nMchId) local function IsHeadMachining( nMchId)
local vInitAx = EmtGetInitialAxesPos( nMchId) local vInitAx = EmtGetInitialAxesPos( nMchId)
return ( vInitAx and vInitAx[1] > 100 * GEO.EPS_SMALL) return ( vInitAx and vInitAx[1] > 100 * GEO.EPS_SMALL)
end end
--------------------------------------------------------------------- Idea sostituzione IsHeadMachining controlla anche che Y sia dentro al pezzo
--[[local function IsHeadMachining( nMchId)
local vInitAx = EmtGetInitialAxesPos( nMchId)
local dDeltaZeroBeamY = EgtIf( GetHeadSet( EgtTdbGetCurrToolParam( MCH_TP.HEAD)) == 1, DeltaTabY, Delta2TabY)
if vInitAx then
if vInitAx[1] > 100 * GEO.EPS_SMALL and vInitAx[2] >= dDeltaZeroBeamY - 100 * GEO.EPS_SMALL and vInitAx[2] <= dDeltaZeroBeamY + EMC.SB + 100 * GEO.EPS_SMALL then
return true
end
end
return
end]]
--------------------------------------------------------------------- ---------------------------------------------------------------------
local function GetPhaseRot( nPhase) local function GetPhaseRot( nPhase)
+4
View File
@@ -1,5 +1,9 @@
==== Common_ONE-PF Update Log ==== ==== Common_ONE-PF Update Log ====
Versione 3.1-- (--/--/2026)
- (SIM-INI) Con CAM5 v.3.1h2 è possibile abilitare/disabilitare VMILL durante lavorazione. Serve Modifica INI macchina "Enable=2" in sezione "[VMill]".
Il flag non è più di creazione, ma di visualizzazione, e il controllo collisioni è comunque garantito.
Versione 3.1h1 (05/08/2026) Versione 3.1h1 (05/08/2026)
- (SIM-GEN) Se arretra trave al parcheggio rulli dopo Unload non può eseguire movimento completo, esegue movimento parziale solo se questo porta POST > 0. Altrimenti non fa nulla. Ticket#3102 - (SIM-GEN) Se arretra trave al parcheggio rulli dopo Unload non può eseguire movimento completo, esegue movimento parziale solo se questo porta POST > 0. Altrimenti non fa nulla. Ticket#3102
- (SIM) OnSimulToolDeselect chiamata da mlpe e ultimo movimento o movimento pinze nel quale non bisogna caricare nessun utensile, forzo TCPOS a 'T0'. Ticket#3114 - (SIM) OnSimulToolDeselect chiamata da mlpe e ultimo movimento o movimento pinze nel quale non bisogna caricare nessun utensile, forzo TCPOS a 'T0'. Ticket#3114
+1 -1
View File
@@ -3,7 +3,7 @@
local InfoCommon_STD_PP = { local InfoCommon_STD_PP = {
NAME = 'Common_ONE-PF', -- nome script PP standard NAME = 'Common_ONE-PF', -- nome script PP standard
VERSION = '3.1h1', -- versione script VERSION = '3.1--', -- versione script
MIN_MACH_VER_PP_COMMON = '3.1f1' -- versione minima kernel MIN_MACH_VER_PP_COMMON = '3.1f1' -- versione minima kernel
} }