Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a47cb7d9be | |||
| fca293d3db | |||
| 1d4f262aef | |||
| cc299918f6 | |||
| 4e390c3eea | |||
| 63452aa0d5 | |||
| 0f78c5186f | |||
| 55c72bf40c | |||
| c2d4c7166c | |||
| 5470f2dbbb | |||
| 3ab4e8326a |
+72
-35
@@ -264,46 +264,38 @@ function OnDispositionEnd()
|
||||
end
|
||||
-- se altrimenti disposizione intermedia, eventuale rotazione
|
||||
elseif IsMidPhase( EMT.PHASE) or IsEnd2Phase( EMT.PHASE) then
|
||||
-- recupero le rotazioni delle fasi corrente e precedente
|
||||
local nRot = GetPhaseRot( EMT.PHASE)
|
||||
local nPrevRot = GetPhaseRot( EMT.PHASE - 1)
|
||||
-- verifico se sono diverse
|
||||
if nRot ~= nPrevRot then
|
||||
-- se ho la testa 2, quindi tipo PF
|
||||
if EgtGetHeadId( 'H21') then
|
||||
local nDeltaRot = nRot - nPrevRot
|
||||
-- rotazione automatica o manuale (sempre con il medesimo comando)
|
||||
local sOut = 'M180 L0=' .. tostring( nDeltaRot)
|
||||
EmtOutput( sOut)
|
||||
-- altrimenti se ONE
|
||||
else
|
||||
if nRot > nPrevRot then nRot = nRot - 4 end
|
||||
local nDeltaRot = nRot - nPrevRot
|
||||
-- se rotazione automatica richiesta e possibile
|
||||
if AutomaticRotation and EMT.LB >= AutoRotMinLen then
|
||||
local sOut = 'M180 L0=' .. tostring( -nDeltaRot)
|
||||
EmtOutput( sOut)
|
||||
else
|
||||
local sOut
|
||||
if nDeltaRot == -1 then
|
||||
sOut = 'M151'
|
||||
elseif nDeltaRot == -2 then
|
||||
sOut = 'M152'
|
||||
elseif nDeltaRot == -3 then
|
||||
sOut = 'M153'
|
||||
end
|
||||
EmtOutput( sOut)
|
||||
EmtOutput( 'M86')
|
||||
EmtOutput( 'G4F.5')
|
||||
end
|
||||
end
|
||||
-- se rotazioni diverse, emetto il comando e aggiorno lo stato
|
||||
if VerifyEmitRotation() then
|
||||
-- imposto stato post-rotazione
|
||||
EMT.POSTROT = true
|
||||
-- imposto recupero sovramateriale in X non più presente
|
||||
EMT.X_OFF = EMT.HOVM
|
||||
end
|
||||
-- se altrimenti disposizione intermedia speciale con eventuale rotazione
|
||||
elseif IsMid2Phase( EMT.PHASE) then
|
||||
-- emissione movimento carrelli
|
||||
EMT.AUXCMD = {}
|
||||
if #EMT.MDCHAR > 0 then
|
||||
EmtOutput( '(ROTATION)')
|
||||
end
|
||||
for i = 1, #EMT.MDCHAR do
|
||||
EmitMoveDataChars( EMT.MDCHAR[i])
|
||||
end
|
||||
if #EMT.MDCHAR > 0 then
|
||||
EmitMoveStartChars( 1)
|
||||
EmitMoveStartChars( 2)
|
||||
end
|
||||
EMT.MDCHAR = {}
|
||||
EMT.AUXTYPE = nil
|
||||
-- se rotazioni diverse, emetto il comando e aggiorno lo stato
|
||||
if VerifyEmitRotation() then
|
||||
-- imposto stato post-rotazione
|
||||
EMT.POSTROT = true
|
||||
-- imposto recupero sovramateriale in X non più presente
|
||||
EMT.X_OFF = EMT.HOVM
|
||||
end
|
||||
-- altrimenti disposizione finale, eventuale scarico pezzo lavorato se non ci sono lavorazioni
|
||||
else
|
||||
else
|
||||
if #EMT.MDCHAR > 0 then
|
||||
MyOutputNoNum( '(PART UNLOAD)')
|
||||
for i = 1, #EMT.MDCHAR do
|
||||
@@ -2469,6 +2461,48 @@ function GetSpecUnloading( nPathId)
|
||||
return ( sVal == '0,Unloading SpecSplit')
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function VerifyEmitRotation()
|
||||
-- recupero le rotazioni delle fasi corrente e precedente
|
||||
local nRot = GetPhaseRot( EMT.PHASE)
|
||||
local nPrevRot = GetPhaseRot( EMT.PHASE - 1)
|
||||
-- se sono uguali non devo fare alcunchè
|
||||
if nRot == nPrevRot then
|
||||
return false
|
||||
end
|
||||
-- se ho la testa 2, quindi tipo PF
|
||||
if EgtGetHeadId( 'H21') then
|
||||
local nDeltaRot = nRot - nPrevRot
|
||||
-- rotazione automatica o manuale (sempre con il medesimo comando)
|
||||
local sOut = 'M180 L0=' .. tostring( nDeltaRot)
|
||||
EmtOutput( sOut)
|
||||
-- altrimenti se ONE
|
||||
else
|
||||
if nRot > nPrevRot then nRot = nRot - 4 end
|
||||
local nDeltaRot = nRot - nPrevRot
|
||||
-- se rotazione automatica richiesta e possibile
|
||||
local dRefLen = EgtIf( IsMid2Phase( EMT.PHASE) or IsEnd2Phase( EMT.PHASE), EMT.LT, EMT.LB)
|
||||
-- se rotazione automatica richiesta e possibile
|
||||
if AutomaticRotation and dRefLen >= AutoRotMinLen then
|
||||
local sOut = 'M180 L0=' .. tostring( -nDeltaRot)
|
||||
EmtOutput( sOut)
|
||||
else
|
||||
local sOut
|
||||
if nDeltaRot == -1 then
|
||||
sOut = 'M151'
|
||||
elseif nDeltaRot == -2 then
|
||||
sOut = 'M152'
|
||||
elseif nDeltaRot == -3 then
|
||||
sOut = 'M153'
|
||||
end
|
||||
EmtOutput( sOut)
|
||||
EmtOutput( 'M86')
|
||||
EmtOutput( 'G4F.5')
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function EmitZmax( bReset, bEnd, bXhome, PrevR1, PrevR2, bSplitCut, bUsePrevDelta)
|
||||
if bReset then
|
||||
@@ -2693,7 +2727,10 @@ end
|
||||
---------------------------------------------------------------------
|
||||
function EmitResetMachining()
|
||||
if ( EMT.TOOL ~= GetNextTool( EMT.MCHID) and IsLastPath( EMT.PATHID)) or GetSpecUnloading( EMT.PATHID) or GetFall( EMT.PATHID) then
|
||||
EmtOutput( 'M05')
|
||||
-- se da MLDE parametro non settato, o settato a true, scrivo il comando arresto mandrino
|
||||
if WriteM05Command == nil or WriteM05Command then
|
||||
EmtOutput( 'M05')
|
||||
end
|
||||
end
|
||||
local sOut = 'G157 EA1'
|
||||
EmtOutput( sOut)
|
||||
|
||||
+26
-8
@@ -359,7 +359,6 @@ function OnSimulDispositionStart()
|
||||
if EMT.VMILL and #EMT.VMILL > 0 then
|
||||
EgtSetStatus( EMT.SCRAP or GDB_ID.NULL, GDB_ST.OFF)
|
||||
end
|
||||
|
||||
-- se altrimenti fasi intermedia o finale speciali, aggancio primo grezzo alla tavola e gli altri in posizione pre-carico
|
||||
elseif IsMid2Phase( EMT.PHASE) or IsEnd2Phase( EMT.PHASE) then
|
||||
-- se cambiata giacitura, lo segnalo
|
||||
@@ -454,6 +453,21 @@ function OnSimulDispositionEnd()
|
||||
EMT.FALL = false
|
||||
EMT.TO_FALL = false
|
||||
end
|
||||
-- se disposizione intermedia
|
||||
if IsMidPhase( EMT.PHASE) or IsEnd2Phase( EMT.PHASE) then
|
||||
-- se le rotazioni delle fasi corrente e precedente sono diverse
|
||||
if GetPhaseRot( EMT.PHASE) ~= GetPhaseRot( EMT.PHASE - 1) then
|
||||
-- imposto stato post-rotazione
|
||||
EMT.POSTROT = true
|
||||
end
|
||||
-- se altrimenti disposizione intermedia speciale con eventuale rotazione
|
||||
elseif IsMid2Phase( EMT.PHASE) then
|
||||
-- se le rotazioni delle fasi corrente e precedente sono diverse
|
||||
if GetPhaseRot( EMT.PHASE) ~= GetPhaseRot( EMT.PHASE - 1) then
|
||||
-- imposto stato post-rotazione
|
||||
EMT.POSTROT = true
|
||||
end
|
||||
end
|
||||
EMT.SPLIT = false
|
||||
EMT.SPECSPLIT = false
|
||||
EMT.TO_SPECSPLIT = false
|
||||
@@ -1624,10 +1638,14 @@ function ExecUnloading()
|
||||
EgtMove( nLayId, vtMove, GDB_RT.GLOB)
|
||||
EgtSetLevel( vMillId, GDB_LV.USER)
|
||||
-- aggiungo gli spigoli
|
||||
local nFirstId, nCount = EgtVolZmapGetEdges( vMillId, nLayId)
|
||||
if nFirstId then
|
||||
for nId = nFirstId, nFirstId + nCount - 1 do
|
||||
EgtSetColor( nId, Color3d( 96, 96, 96))
|
||||
if EgtVolZmapSetShowEdges then
|
||||
EgtVolZmapSetShowEdges( vMillId, true)
|
||||
else
|
||||
local nFirstId, nCount = EgtVolZmapGetEdges( vMillId, nLayId)
|
||||
if nFirstId then
|
||||
for nId = nFirstId, nFirstId + nCount - 1 do
|
||||
EgtSetColor( nId, Color3d( 96, 96, 96))
|
||||
end
|
||||
end
|
||||
end
|
||||
-- rilascio Vmill
|
||||
@@ -2202,9 +2220,9 @@ function OnEstimDispositionEnd()
|
||||
-- Se disposizione inizio o rimanenza
|
||||
if IsStartOrRestPhase( EMT.PHASE) then
|
||||
;
|
||||
-- se altrimenti disposizione intermedia, eventuale rotazione
|
||||
elseif IsMidPhase( EMT.PHASE) then
|
||||
-- recupero le rotazioni delle fasi corrente e precedente
|
||||
-- se altrimenti disposizione intermedia o finale dopo separazione e rotazione, eventuale rotazione
|
||||
elseif IsMidPhase( EMT.PHASE) or IsMid2Phase( EMT.PHASE) or IsEnd2Phase( EMT.PHASE) then
|
||||
-- recupero le rotazioni delle fasi corrente e precedente
|
||||
local nRot = GetPhaseRot( EMT.PHASE)
|
||||
local nPrevRot = GetPhaseRot( EMT.PHASE - 1)
|
||||
-- verifico se sono diverse
|
||||
|
||||
+6
-2
@@ -1116,8 +1116,12 @@ function SpecialCalcMachiningEncumbrance( nMchId, bPreCut)
|
||||
end
|
||||
b3Enc = EgtGetBBoxGlob( EgtGetAxisId( 'C2'), GDB_BB.ONLY_VISIBLE)
|
||||
end
|
||||
local dRollFront = max( b3Enc:getMax():getX(), MIN_FRONT_ENG_V) + SIC_V
|
||||
local dRollBack = max( -b3Enc:getMin():getX(), MIN_BACK_ENG_V) + SIC_V
|
||||
|
||||
-- Forzo la distanza di sicurezza da utensile
|
||||
local nSecRollerDist = EgtGetValInNotes( EgtTdbGetCurrToolParam( MCH_TP.USERNOTES), 'SECDIST', 'i') or SIC_V
|
||||
|
||||
local dRollFront = max( b3Enc:getMax():getX(), MIN_FRONT_ENG_V) + nSecRollerDist
|
||||
local dRollBack = max( -b3Enc:getMin():getX(), MIN_BACK_ENG_V) + nSecRollerDist
|
||||
EgtOutLog( ' RollFront = ' .. EgtNumToString( dRollFront, 1) .. ' RollBack = ' .. EgtNumToString( dRollBack, 1), 3)
|
||||
-- Calcolo della posizione della Punta Utensile rispetto allo Zero Macchina
|
||||
local ptTip
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
==== Essetre_StdPF Update Log ====
|
||||
|
||||
Versione 2.6c8 (22/03/2024)
|
||||
- (SIM) Miglioramento visualizzazione spigoli VMILL alla fine della simulazione. Funzione: EgtVolZmapSetShowEdges. CAM5 ver. 2.6c2 NON OBBLIGATORIA.
|
||||
|
||||
Versione 2.6c7 (11/03/2024)
|
||||
- (GEN) Aggiunta gestione parametro "SECDIST". Distanza di sicurezza tra paratia con rulli e utensile/testa. Parametro da inserire nelle note utensile.
|
||||
- (MLPE-GEN) Aggiunto parametro "WriteM05Command" (NON OBBLIGATORIO) per decidere se scrivere il comando M05 per arresto mandrino. Default a true.
|
||||
|
||||
Versione 2.6c6 (08/03/2024)
|
||||
- (SIM-GEN) Gestione rotazioni 90° come su FAST, caso MID2 (split/cut prima delle rotazioni)
|
||||
|
||||
Versione 2.6c5 (07/03/2024)
|
||||
- (GEN) Per ribaltamento, i comandi si differenziano per macchina. Sembra che ONE e PF abbiano comandi diversi. In attesa di conferma da parte di Essetre
|
||||
- (SIM-GEN) Se cambiato utensile, si aprono sempre paratie
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
local InfoCommon_STD_PP = {
|
||||
NAME = 'Common_ONE-PF', -- nome script PP standard
|
||||
VERSION = '2.6c5', -- versione script
|
||||
VERSION = '2.6c8', -- versione script
|
||||
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user