Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e2a3a65ebd | |||
| c0b6ef49d6 | |||
| f900809a26 |
+26
-10
@@ -221,7 +221,8 @@ function OnSimulDispositionStart()
|
||||
end
|
||||
-- Se vero inizio e abilitato creo gli Zmap
|
||||
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 nPartRawId = EgtGetFirstRawPart()
|
||||
while nPartRawId do
|
||||
@@ -247,7 +248,7 @@ function OnSimulDispositionStart()
|
||||
-- determino la risoluzione dello Zmap
|
||||
local dTol = 4.71
|
||||
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
|
||||
local dArea = b3Raw:getDimX() * b3Raw:getDimY() + b3Raw:getDimX() * b3Raw:getDimZ() + b3Raw:getDimY() * b3Raw:getDimZ()
|
||||
if dArea < 0.075e6 then
|
||||
@@ -263,21 +264,25 @@ function OnSimulDispositionStart()
|
||||
elseif dArea < 2.4e6 then
|
||||
dTol = 3.77
|
||||
end
|
||||
dTol = min( dTol, EMT.VMILLTOL or dTol) -- imposto dTol al valore minore tra quello per volume e quello per spessore lama
|
||||
end
|
||||
dTol = min( dTol, EMT.VMILLTOL or dTol) -- imposto dTol al valore minore tra quello per volume e quello per spessore lama
|
||||
-- creo lo Zmap
|
||||
local VMillId = EgtVolZmapBox( nPartRawId, b3Raw:getMin(), b3Raw:getDimX(), b3Raw:getDimY(), b3Raw:getDimZ(), dTol, true, GDB_RT.GLOB)
|
||||
if VMillId then
|
||||
EgtSetName( VMillId, 'VMill')
|
||||
EgtSetLevel( VMillId, GDB_LV.TEMP)
|
||||
EgtSetColor( VMillId, EgtGetColor( nSolId), false)
|
||||
-- nascondo le altre geometrie
|
||||
local nId = EgtGetFirstInGroup( nPartRawId)
|
||||
while nId do
|
||||
if nId ~= VMillId then
|
||||
EgtSetStatus( nId, GDB_ST.OFF)
|
||||
if bShowVMill then
|
||||
-- nascondo le altre geometrie
|
||||
local nId = EgtGetFirstInGroup( nPartRawId)
|
||||
while nId do
|
||||
if nId ~= VMillId then
|
||||
EgtSetStatus( nId, GDB_ST.OFF)
|
||||
end
|
||||
nId = EgtGetNext( nId)
|
||||
end
|
||||
nId = EgtGetNext( nId)
|
||||
else
|
||||
EgtSetStatus( VMillId, GDB_ST.OFF)
|
||||
end
|
||||
table.insert( EMT.VMILL, VMillId)
|
||||
end
|
||||
@@ -338,7 +343,9 @@ function OnSimulDispositionStart()
|
||||
-- gestione eventuale scarto affettato successivo
|
||||
if EMT.VMILL and #EMT.VMILL > 0 then
|
||||
EMT.SCRAP = nScrapRawId
|
||||
EgtSetStatus( EMT.SCRAP or GDB_ID.NULL, GDB_ST.OFF)
|
||||
if EgtGetInfo( EgtGetCurrMachGroup(), 'Vm', 'b') then
|
||||
EgtSetStatus( EMT.SCRAP or GDB_ID.NULL, GDB_ST.OFF)
|
||||
end
|
||||
else
|
||||
EMT.SCRAP = nil
|
||||
end
|
||||
@@ -1484,6 +1491,8 @@ end
|
||||
function ExecUnloading()
|
||||
if EMT.VMILL and #EMT.VMILL > 0 then
|
||||
local vMillId = EMT.VMILL[1]
|
||||
-- grezzo di appartenenza
|
||||
local nPartRawId = EgtGetParent( vMillId)
|
||||
-- gruppo dei Vmill
|
||||
local nVmGrpId = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'VMill')
|
||||
-- li sposto per lasciare spazio al nuovo pezzo
|
||||
@@ -1507,6 +1516,7 @@ function ExecUnloading()
|
||||
EgtSetAxisPos( 'PW', MaxWOpen)
|
||||
end
|
||||
EgtMove( nLayId, vtMove, GDB_RT.GLOB)
|
||||
EgtSetStatus( vMillId, GDB_ST.ON)
|
||||
EgtSetLevel( vMillId, GDB_LV.USER)
|
||||
-- aggiungo gli spigoli
|
||||
if EgtVolZmapSetShowEdges then
|
||||
@@ -1525,6 +1535,12 @@ function ExecUnloading()
|
||||
EgtDraw()
|
||||
-- se finito
|
||||
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
|
||||
local sMachIni = EgtGetCurrMachineDir() .. '\\' .. EgtGetCurrMachineName() .. '.ini'
|
||||
if EgtGetStringFromIni( 'VMill', 'Save', '', sMachIni) == '1' then
|
||||
|
||||
+2
-11
@@ -556,21 +556,12 @@ local function IsFirstMachiningOfStart( nMchId)
|
||||
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 vInitAx = EmtGetInitialAxesPos( nMchId)
|
||||
return ( vInitAx and vInitAx[1] > 100 * GEO.EPS_SMALL)
|
||||
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)
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
==== 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)
|
||||
- (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
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
local InfoCommon_STD_PP = {
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user