Allineamento con Common ver. 2.6a5
This commit is contained in:
+32
-25
@@ -351,6 +351,7 @@ function OnRawMoveData()
|
||||
EMT.HT = b3Part:getDimY()
|
||||
EMT.ST = b3Part:getDimZ()
|
||||
EMT.HOVM = EgtGetInfo( EMT.RAWID, 'HOVM', 'd') or 0
|
||||
EMT.XMINT = b3Part:getMin():getX()
|
||||
else
|
||||
EMT.IDT = GDB_ID.NULL
|
||||
EMT.IT = -1
|
||||
@@ -395,6 +396,9 @@ function OnMachiningStart()
|
||||
EMT.MCHNAME = EgtGetOperationName( EMT.MCHID)
|
||||
EMT.MCHTYPE = EgtGetMachiningParam( MCH_MP.TYPE)
|
||||
EMT.MCHUSERNOTES = EgtGetMachiningParam( MCH_MP.USERNOTES)
|
||||
EMT.MCHSPLIT = ( EMT.MCHUSERNOTES:find( 'Split;', 1, true) ~= nil)
|
||||
EMT.MCHPRECUT = ( EMT.MCHUSERNOTES:find( 'Precut;', 1, true) ~= nil)
|
||||
|
||||
-- se sega a catena, aggiusto subito angolo scelto per asse virtuale A
|
||||
if EMT.HEAD == 'H13' or EMT.HEAD == 'H15' then
|
||||
-- valore dell'asse virtuale
|
||||
@@ -472,7 +476,7 @@ function OnMachiningEnd()
|
||||
elseif EMT.AUXTYPE == 'P' then
|
||||
if EMT.PREROT then
|
||||
if not EMT.ZMAX then
|
||||
EmitZmax( false, true, true, EMT.R1, EMT.R2, false, ( #EMT.MDCHAR > 0))
|
||||
EmitZmax( false, true, true, EMT.R1, EMT.R2, ( #EMT.MDCHAR > 0))
|
||||
EMT.ZMAX = true
|
||||
EMT.TO_ZMAX = nil
|
||||
else
|
||||
@@ -482,7 +486,7 @@ function OnMachiningEnd()
|
||||
EmtOutput( '(PART ROTATION)')
|
||||
elseif EMT.FALL then
|
||||
if EMT.TO_ZMAX and not EMT.ZMAX then
|
||||
EmitZmax( false, true, true, EMT.R1, EMT.R2, false, ( #EMT.MDCHAR > 0))
|
||||
EmitZmax( false, true, true, EMT.R1, EMT.R2, ( #EMT.MDCHAR > 0))
|
||||
EMT.ZMAX = true
|
||||
EMT.TO_ZMAX = nil
|
||||
EMT.TO_XHOME = nil
|
||||
@@ -490,7 +494,7 @@ function OnMachiningEnd()
|
||||
EmtOutput( '(PART FALL)')
|
||||
elseif EMT.SPECSPLIT then
|
||||
if EMT.TO_ZMAX and not EMT.ZMAX then
|
||||
EmitZmax( false, true, true, EMT.R1, EMT.R2, false, ( #EMT.MDCHAR > 0))
|
||||
EmitZmax( false, true, true, EMT.R1, EMT.R2, ( #EMT.MDCHAR > 0))
|
||||
EMT.ZMAX = true
|
||||
EMT.TO_ZMAX = nil
|
||||
EMT.TO_XHOME = nil
|
||||
@@ -594,7 +598,7 @@ function OnPathStart()
|
||||
--EMT.CNT = EgtGetInfo( EMT.PATHID, 'CNT', 'i')
|
||||
--EmtOutput( 'CNT='.. tostring( EMT.CNT or 0))
|
||||
-- se taglio di separazione, verifico se ci sarà caduta
|
||||
if ( EMT.MCHUSERNOTES:find( 'Split', 1, true) ~= nil) then
|
||||
if EMT.MCHSPLIT then
|
||||
local sCmd = EgtGetInfo( EMT.PATHID, 'AE1') or ''
|
||||
if sCmd:find( 'Fall', 1, true) then
|
||||
EMT.TO_FALL = true
|
||||
@@ -602,6 +606,14 @@ function OnPathStart()
|
||||
EMT.TO_SPECSPLIT = true
|
||||
end
|
||||
end
|
||||
|
||||
-- se taglio di precut verifico quanto è più lungo il grezzo rispetto al pezzo (non tiene conto dell'ultimo cubetto)
|
||||
EMT.DELTA_LT = 0
|
||||
if EMT.MCHPRECUT then
|
||||
local dCosA = sqrt( max( 1 - EMT.EXTR[1] * EMT.EXTR[1], 0))
|
||||
EMT.DELTA_LT = max( EMT.XMINT - Point3d( EMT.MMAX):getX() - dCosA * EMT.TDIAM / 2, 0)
|
||||
end
|
||||
|
||||
-- se utensile non cambiato, salvo eventuali precedenti lineari e rotanti
|
||||
if EMT.TOOL == EMT.PREVTOOL and not EMT.ZMAX then
|
||||
EMT.L1pp = EMT.L1op
|
||||
@@ -752,14 +764,13 @@ function OnRapid()
|
||||
-- primo posizionamento
|
||||
local Speed = EMT.S * EgtIf( EMT.HEAD ~= 'H12' and EMT.HEAD ~= 'H22', 1, 1.65)
|
||||
local bOnlyCharY = true
|
||||
-- se Split lascio agganciata solo la pinza Y2 alla fine dei movimenti
|
||||
local bSplitCut = ( EMT.MCHUSERNOTES:find( 'Split', 1, true) ~= nil)
|
||||
-- eventuale Movimento Pinze
|
||||
for i = 1, #EMT.AUXCMD do
|
||||
ProcessPathStartAux( EMT.AUXCMD[i], i)
|
||||
end
|
||||
EMT.AUXCMD = {}
|
||||
if bSplitCut and #EMT.MDCHAR > 0 and not EMT.TO_FALL and not EMT.TO_SPECSPLIT then
|
||||
-- se Split lascio agganciata solo la pinza Y2 alla fine dei movimenti
|
||||
if EMT.MCHSPLIT and #EMT.MDCHAR > 0 and not EMT.TO_FALL and not EMT.TO_SPECSPLIT then
|
||||
EMT.MDCHAR[#EMT.MDCHAR].FinStatY1 = 1
|
||||
end
|
||||
for i = 1, #EMT.MDCHAR do
|
||||
@@ -775,7 +786,7 @@ function OnRapid()
|
||||
if RollerParkingNeeded( EMT.HEAD, PrevR1, PrevR2, EMT.R1, EMT.R2) or
|
||||
EMT.V1POS < EMT.V1NEXTPOS - 1 or EMT.V2POS > EMT.V2NEXTPOS + 1 then
|
||||
local dPosT = EMT.TPOS or EMT.L1op
|
||||
EmitParkRoller( dPosT, bSplitCut)
|
||||
EmitParkRoller( dPosT, EMT.MCHSPLIT)
|
||||
end
|
||||
-- se testa 1 e CU 1
|
||||
if GetHeadTCSet( EMT.HEAD, EMT.TCPOS) == 'Head1_TC1' then
|
||||
@@ -966,7 +977,7 @@ function OnRapid()
|
||||
BhData.Y1 = ParkY1
|
||||
BhData.ViseY1 = 2
|
||||
end
|
||||
if bSplitCut and EMT.Y2DELTA then
|
||||
if EMT.MCHSPLIT and EMT.Y2DELTA then
|
||||
BhData.ViseY1 = 3
|
||||
end
|
||||
if EMT.Y2DELTA then
|
||||
@@ -1076,8 +1087,7 @@ function OnRapid()
|
||||
if EMT.DOU_TYPE then sOut = sOut .. ' Double' end
|
||||
EmtOutput( '( *** '..sOut..' *** )')
|
||||
-- se Split lascio agganciata solo la pinza Y2 alla fine dei movimenti
|
||||
local bSplitCut = ( EMT.MCHUSERNOTES:find( 'Split', 1, true) ~= nil)
|
||||
if bSplitCut and #EMT.MDCHAR > 0 and not EMT.TO_FALL and not EMT.TO_SPECSPLIT then
|
||||
if EMT.MCHSPLIT and #EMT.MDCHAR > 0 and not EMT.TO_FALL and not EMT.TO_SPECSPLIT then
|
||||
EMT.MDCHAR[#EMT.MDCHAR].FinStatY1 = 1
|
||||
end
|
||||
for i = 1, #EMT.MDCHAR do
|
||||
@@ -1089,13 +1099,11 @@ function OnRapid()
|
||||
EmitMoveWaitChars( nMoveType)
|
||||
end
|
||||
EMT.MDCHAR = {}
|
||||
-- se pezzo a destra, dichiaro cabina sinistra da parcheggiare
|
||||
if not EMT.Y1DELTA then EMT.V1NEXTPOS = ParkV1 end
|
||||
-- se necessario allargo le cabine
|
||||
if RollerParkingNeeded( EMT.HEAD, PrevR1, PrevR2, EMT.R1, EMT.R2) or
|
||||
EMT.V1POS < EMT.V1NEXTPOS - 1 or EMT.V2POS > EMT.V2NEXTPOS + 1 then
|
||||
local dPosT = EMT.TPOS or EMT.L1op
|
||||
EmitParkRoller( dPosT, bSplitCut)
|
||||
EmitParkRoller( dPosT, EMT.MCHSPLIT)
|
||||
end
|
||||
-- se testa 1
|
||||
if GetHeadTCSet( EMT.HEAD, EMT.TCPOS) == 'Head1_TC1' then
|
||||
@@ -1272,7 +1280,7 @@ function OnRapid()
|
||||
BhData.Y1 = EgtIf( EMT.Y1POS, EMT.Y1POS, ParkY1)
|
||||
BhData.ViseY1 = 2
|
||||
end
|
||||
if bSplitCut and EMT.Y2DELTA then
|
||||
if EMT.MCHSPLIT and EMT.Y2DELTA then
|
||||
BhData.ViseY1 = 3
|
||||
end
|
||||
if EMT.Y2DELTA then
|
||||
@@ -1403,13 +1411,12 @@ function OnRapid()
|
||||
MyAdjustLinearAxes()
|
||||
EmtAdjustRotaryAxes()
|
||||
-- se Split o Presplit lascio agganciata solo la pinza Y2 alla fine dei movimenti
|
||||
local bSplitCut = ( EMT.MCHUSERNOTES:find( 'Split', 1, true) ~= nil)
|
||||
local sNextTool = GetNextTool( EMT.MCHID)
|
||||
-- vado in home se è ultimo movimento ed è ultima lavorazione, se sono con motosega e devo cambiare utensile, oppure se ho la lama
|
||||
local bToXhome = ( IsLastPath( EMT.PATHID) and not sNextTool) or ( EMT.HEAD == 'H23' and EMT.TOOL ~= sNextTool) or ( EMT.HEAD == 'H13' and EMT.TOOL ~= sNextTool) or EMT.HEAD == 'H12' or EMT.HEAD == 'H22'
|
||||
local CurrL3o = EMT.L3o
|
||||
EMT.L3o = EMT.L3op
|
||||
EmitZmax( true, true, bToXhome, EMT.R1p, EMT.R2p, bSplitCut)
|
||||
EmitZmax( true, true, bToXhome, EMT.R1p, EMT.R2p)
|
||||
EMT.L3o = CurrL3o
|
||||
-- aggiorno quota finale trave dopo Zmax
|
||||
EMT.L1o = EMT.TPOS
|
||||
@@ -2421,7 +2428,7 @@ function GetSpecUnloading( nPathId)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function EmitZmax( bReset, bEnd, bXhome, PrevR1, PrevR2, bSplitCut, bUsePrevDelta)
|
||||
function EmitZmax( bReset, bEnd, bXhome, PrevR1, PrevR2, bUsePrevDelta)
|
||||
if bReset then
|
||||
EmitResetMachining()
|
||||
end
|
||||
@@ -2438,7 +2445,7 @@ function EmitZmax( bReset, bEnd, bXhome, PrevR1, PrevR2, bSplitCut, bUsePrevDelt
|
||||
-- se necessario allargo le cabine
|
||||
if RollerParkingNeeded( EMT.HEAD, PrevR1, PrevR2, dSafeC1, dSafeB1) then
|
||||
local dPosT = EgtIf( bEnd, EMT.L1o, EMT.TPOS or EMT.L1op)
|
||||
EmitParkRoller( dPosT, bSplitCut, bUsePrevDelta)
|
||||
EmitParkRoller( dPosT, bUsePrevDelta)
|
||||
end
|
||||
-- se fresa o lama
|
||||
if GetHeadTCSet( EMT.HEAD, EMT.TCPOS) == 'Head1_TC1' then
|
||||
@@ -2538,7 +2545,7 @@ function EmitZmax( bReset, bEnd, bXhome, PrevR1, PrevR2, bSplitCut, bUsePrevDelt
|
||||
-- se necessario allargo le cabine
|
||||
if RollerParkingNeeded( EMT.HEAD, PrevR1, PrevR2, dSafeC2, dSafeB2) then
|
||||
local dPosT = EgtIf( bEnd, EMT.L1o, EMT.TPOS or EMT.L1op)
|
||||
EmitParkRoller( dPosT, bSplitCut, bUsePrevDelta)
|
||||
EmitParkRoller( dPosT, bUsePrevDelta)
|
||||
end
|
||||
-- se fresa o lama
|
||||
if EMT.HEAD ~= 'H23' then
|
||||
@@ -2648,7 +2655,7 @@ function EmitResetMachining()
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function EmitParkRoller( dPosT, bSplitCut, bUsePrevDelta)
|
||||
function EmitParkRoller( dPosT, bUsePrevDelta)
|
||||
-- se entrambe già parcheggiate, non devo fare alcunché
|
||||
if ( EMT.V1POS - ParkV1) > -0.1 and ( EMT.V2POS - ParkV2) < 0.1 then return end
|
||||
-- Assegno quote pinze correnti
|
||||
@@ -2665,7 +2672,7 @@ function EmitParkRoller( dPosT, bSplitCut, bUsePrevDelta)
|
||||
local DiffY1 = MyParkY1 - dPosY1
|
||||
local DiffY2 = MyParkY2 - dPosY2
|
||||
--EmtOutput( string.format( 'PosT=%.3f DiffY1=%.3f DiffY2=%.3f', dPosT, DiffY1, DiffY2))
|
||||
if bSplitCut then
|
||||
if EMT.MCHSPLIT then
|
||||
if DiffY1 > 0.1 then
|
||||
MDChar.Y1 = dPosY1 + DiffY1
|
||||
end
|
||||
@@ -2699,7 +2706,7 @@ function EmitParkRoller( dPosT, bSplitCut, bUsePrevDelta)
|
||||
local dPosY1 = dPosT + dY1Delta
|
||||
local DiffY1 = MyParkY1 - dPosY1
|
||||
local dMoveY1 = EgtIf( DiffY1 > 0.1, dMoveV1, 0)
|
||||
local dTryMoveY1 = ParkV1 - dPosT - EgtIf( bSplitCut or EMT.FALL, EMT.LT, 0)
|
||||
local dTryMoveY1 = ParkV1 - dPosT - EgtIf( EMT.MCHSPLIT or EMT.FALL, EMT.LT, 0)
|
||||
if ( dPosT > ParkV2 - ExtraParkV and dPosT < ParkV1 and dPosY1 + dTryMoveY1 < MaxY1) then dMoveY1 = max( dMoveY1, dTryMoveY1) end
|
||||
MDChar.Y1 = dPosY1 + dMoveY1
|
||||
MDChar.MovType = 1
|
||||
@@ -2710,8 +2717,8 @@ function EmitParkRoller( dPosT, bSplitCut, bUsePrevDelta)
|
||||
local dPosY2 = dPosT + dY2Delta
|
||||
local DiffY2 = MyParkY2 - dPosY2
|
||||
local dMoveY2 = EgtIf( DiffY2 < -0.1, dMoveV2, 0)
|
||||
local dTryMoveY2 = ParkV2 - dPosT - EMT.LT - EMT.HOVM
|
||||
if ( dPosT + EMT.LT + EMT.HOVM < ParkV1 + ExtraParkV and dPosT + EMT.LT + EMT.HOVM > ParkV2 and dPosY2 + dTryMoveY2 > MinY2) then dMoveY2 = min( dMoveY2, dTryMoveY2) end
|
||||
local dTryMoveY2 = ParkV2 - dPosT - EMT.LT - EMT.DELTA_LT - EMT.HOVM
|
||||
if ( dPosT + EMT.LT + EMT.DELTA_LT + EMT.HOVM < ParkV1 + ExtraParkV and dPosT + EMT.LT + EMT.DELTA_LT + EMT.HOVM > ParkV2 and dPosY2 + dTryMoveY2 > MinY2) then dMoveY2 = min( dMoveY2, dTryMoveY2) end
|
||||
MDChar.Y2 = dPosY2 + dMoveY2
|
||||
MDChar.MovType = 2
|
||||
MDChar.BeamVise = 2
|
||||
|
||||
+64
-34
@@ -78,7 +78,7 @@ function OnSimulStart()
|
||||
{ Grp = 'Base', Sub = 'COLLISION', Name = 'COL1'},
|
||||
{ Grp = 'Base', Sub = 'COLLISION', Name = 'COL2'},
|
||||
{ Grp = 'Base', Sub = 'BELT', Name = 'COLLISION'}}
|
||||
-- gruppo CHSAW si attiva solo se progress, one con BIT ortiser o PF
|
||||
-- gruppo CHSAW si attiva solo se progress, one con BIT mortiser o PF
|
||||
if Progress or Mortiser or EgtGetHeadId( 'H21') then
|
||||
table.insert( McdData, { Grp = 'Base', Sub = 'COLLISION', Name = 'CHSAW'})
|
||||
end
|
||||
@@ -86,6 +86,11 @@ function OnSimulStart()
|
||||
if Mortiser and EgtGetHeadId( 'H21') then
|
||||
table.insert( McdData, { Grp = 'Base', Sub = 'COLLISION', Name = 'MORTISER'})
|
||||
end
|
||||
-- se Progress si attiva magazzino lama sotto traversa
|
||||
if Progress and EgtGetHeadId( 'H21') then
|
||||
table.insert( McdData, { Grp = 'Base', Sub = 'COLLISION', Name = 'SAW1'})
|
||||
end
|
||||
|
||||
if Clamp5 then
|
||||
table.insert( McdData, { Grp = 'W', Sub = 'COLLISION', Name = 'STM1'})
|
||||
table.insert( McdData, { Grp = 'W', Sub = 'COLLISION', Name = 'STM2'})
|
||||
@@ -271,6 +276,7 @@ function OnSimulDispositionStart()
|
||||
EMT.LB = b3Bar:getDimX()
|
||||
EMT.LR = b3Raw:getDimX()
|
||||
EMT.LT = b3Part:getDimX()
|
||||
EMT.XMINT = b3Part:getMin():getX()
|
||||
EMT.HOVM = EgtGetInfo( nPartRawId or GDB_ID.NULL, 'HOVM', 'd') or 0
|
||||
EMT.CUTID = EgtGetInfo( PartId or GDB_ID.NULL, 'CUTID', 'i') or 0
|
||||
EMT.Y1SPEC = nil
|
||||
@@ -416,6 +422,7 @@ function OnSimulToolSelect( dPosA)
|
||||
EMT.TOOLTYPE = EgtTdbGetCurrToolParam( MCH_TP.TYPE)
|
||||
EMT.TLEN = EgtTdbGetCurrToolParam( MCH_TP.LEN)
|
||||
EMT.TTOTLEN = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
|
||||
EMT.TDIAM = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||
EMT.TUSERNOTES = EgtTdbGetCurrToolParam( MCH_TP.USERNOTES)
|
||||
local nSetHead = GetHeadSet( EMT.HEAD)
|
||||
-- se ho due teste, verifico che l'altra sia dalla parte opposta
|
||||
@@ -700,6 +707,7 @@ function OnSimulMachiningStart()
|
||||
EMT.MCHUSERNOTES = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
EMT.VMRS = ( EMT.MCHTYPE ~= MCH_MY.DRILLING and not EMT.MCHUSERNOTES:find( 'VMRS=0;', 1, true))
|
||||
EMT.MCHSPLIT = ( EMT.MCHUSERNOTES:find( 'Split;', 1, true) ~= nil)
|
||||
EMT.MCHPRECUT = ( EMT.MCHUSERNOTES:find( 'Precut;', 1, true) ~= nil)
|
||||
-- recupero TASKID della feature lavorata
|
||||
local vId = EgtGetMachiningGeometry()
|
||||
if vId and #vId > 0 and #vId[1] > 0 then
|
||||
@@ -781,6 +789,12 @@ function OnSimulPathStart()
|
||||
EMT.TO_SPECSPLIT = true
|
||||
end
|
||||
end
|
||||
-- se taglio di precut verifico quanto è più lungo il grezzo rispetto al pezzo (non tiene conto dell'ultimo cubetto)
|
||||
EMT.DELTA_LT = 0
|
||||
if EMT.MCHPRECUT then
|
||||
local dCosA = sqrt( max( 1 - EMT.EXTR[1] * EMT.EXTR[1], 0))
|
||||
EMT.DELTA_LT = max( EMT.XMINT - Point3d( EMT.MMAX):getX() - dCosA * EMT.TDIAM / 2, 0)
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -792,7 +806,7 @@ function OnSimulPathEnd()
|
||||
if EMT.MCHSPLIT and not EMT.TO_FALL and not EMT.TO_SPECSPLIT then
|
||||
EMT.SPLIT_Y1DELTA = EMT.Y1DELTA
|
||||
EMT.Y1DELTA = nil
|
||||
SetPY1Light( false)
|
||||
ExecMovePY1( false)
|
||||
end
|
||||
ExecMoveZmax( EMT.MCHSPLIT)
|
||||
EMT.TO_ZMAX = nil
|
||||
@@ -802,19 +816,19 @@ end
|
||||
---------------------------------------------------------------------
|
||||
function OnSimulPathStartAux()
|
||||
-- eseguo il comando
|
||||
ExecAuxCmd( EMT.AUX)
|
||||
ExecAuxCmd( EMT.AUX, true)
|
||||
-- se ultimo comando e lavorazione di split, sgancio il carro Y1
|
||||
if EMT.AUXIND == EMT.AUXTOT and EMT.MCHSPLIT and not EMT.TO_SPECSPLIT and not EMT.TO_FALL then
|
||||
EMT.SPLIT_Y1DELTA = EMT.Y1DELTA
|
||||
EMT.Y1DELTA = nil
|
||||
SetPY1Light( false)
|
||||
ExecMovePY1( false)
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function OnSimulPathEndAux()
|
||||
-- eseguo il comando
|
||||
ExecAuxCmd( EMT.AUX)
|
||||
ExecAuxCmd( EMT.AUX, false)
|
||||
-- se ultimo comando e richiesta risalita a Zmax
|
||||
if EMT.AUXIND == EMT.AUXTOT and EMT.TO_ZMAX then
|
||||
ExecMoveZmax( EMT.MCHSPLIT)
|
||||
@@ -1127,7 +1141,7 @@ function OnSimulMoveEnd()
|
||||
-- se lavorazione split, dichiaro carro Y1 riagganciato
|
||||
if EMT.SPLIT_Y1DELTA then
|
||||
EMT.SPLIT_Y1DELTA = nil
|
||||
SetPY1Light( true)
|
||||
ExecMovePY1( true)
|
||||
end
|
||||
-- chiusura pinza speciale (e posizionamento iniziale)
|
||||
if EMT.W2DELTA then
|
||||
@@ -1192,7 +1206,7 @@ function OnSimulCollision()
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function ExecAuxCmd( sCmd)
|
||||
function ExecAuxCmd( sCmd, bPathStart)
|
||||
-- analizzo il comando
|
||||
local Cmd = EgtSplitString( sCmd)
|
||||
if Cmd[1] == '0' then
|
||||
@@ -1212,29 +1226,31 @@ function ExecAuxCmd( sCmd)
|
||||
end
|
||||
EgtOutText( Cmd[2])
|
||||
elseif Cmd[1] == '1' then
|
||||
if EMT.SPLIT or EMT.SPECSPLIT then ExecOpenRoller( 1) end
|
||||
if EMT.UNLOADING or EMT.TO_FALL or EMT.TO_SPECSPLIT then ExecOpenRoller( 2) end
|
||||
local sV1, MoveV1, sV2, MoveV2 = CalcMoveV1V2ForAuxCmd( Cmd)
|
||||
local bOk, bOk1, bOk2, bOk3 = SimulMoveAxes( Cmd[2], tonumber( Cmd[3]), MCH_SIM_STEP.RAPID,
|
||||
sV1, MoveV1, MCH_SIM_STEP.RAPID,
|
||||
sV2, MoveV2, MCH_SIM_STEP.RAPID)
|
||||
if not bOk then
|
||||
if not bOk1 then
|
||||
if VerifyY1Y2Stroke( Cmd[2], tonumber( Cmd[3])) == nil then
|
||||
EgtOutLog( 'Error on ExecAuxCmd : ' .. sCmd)
|
||||
if Cmd[2] ~= 'Z' then
|
||||
ExecOpenRoller( 1)
|
||||
ExecOpenRoller( 2)
|
||||
local sV1, MoveV1, sV2, MoveV2 = CalcMoveV1V2ForAuxCmd( Cmd)
|
||||
local bOk, bOk1, bOk2, bOk3 = SimulMoveAxes( Cmd[2], tonumber( Cmd[3]), MCH_SIM_STEP.RAPID,
|
||||
sV1, MoveV1, MCH_SIM_STEP.RAPID,
|
||||
sV2, MoveV2, MCH_SIM_STEP.RAPID)
|
||||
if not bOk then
|
||||
if not bOk1 then
|
||||
if VerifyY1Y2Stroke( Cmd[2], tonumber( Cmd[3])) == nil then
|
||||
EgtOutLog( 'Error on ExecAuxCmd : ' .. sCmd)
|
||||
end
|
||||
elseif not bOk2 then
|
||||
VerifyV1V2Stroke( sV1, MoveV1)
|
||||
elseif not bOk3 then
|
||||
VerifyV1V2Stroke( sV2, MoveV2)
|
||||
end
|
||||
elseif not bOk2 then
|
||||
VerifyV1V2Stroke( sV1, MoveV1)
|
||||
elseif not bOk3 then
|
||||
VerifyV1V2Stroke( sV2, MoveV2)
|
||||
end
|
||||
end
|
||||
elseif Cmd[1] == '2' then
|
||||
-- Verifico movimento carrello con trave agganciata
|
||||
VerifyOneChariotSlide( Cmd[2], Cmd[3], Cmd[4], Cmd[5])
|
||||
-- Eseguo i movimenti necessari
|
||||
if EMT.SPLIT then ExecOpenRoller( 1) end
|
||||
if EMT.UNLOADING or EMT.TO_FALL or EMT.TO_SPECSPLIT then ExecOpenRoller( 2) end
|
||||
ExecOpenRoller( 1)
|
||||
ExecOpenRoller( 2)
|
||||
local sV1, MoveV1, sV2, MoveV2 = CalcMoveV1V2ForAuxCmd( Cmd)
|
||||
local bOk, bOk1, bOk2, bOk3, bOk4 = SimulMoveAxes( Cmd[2], tonumber( Cmd[3]), MCH_SIM_STEP.RAPID,
|
||||
Cmd[4], tonumber( Cmd[5]), MCH_SIM_STEP.RAPID,
|
||||
@@ -1256,8 +1272,8 @@ function ExecAuxCmd( sCmd)
|
||||
-- Verifico movimento carrelli con trave agganciata
|
||||
VerifyTwoChariotsSlide( Cmd[2], Cmd[3], Cmd[4], Cmd[5], Cmd[6], Cmd[7])
|
||||
-- Eseguo i movimenti necessari
|
||||
if EMT.SPLIT then ExecOpenRoller( 1) end
|
||||
if EMT.UNLOADING or EMT.TO_FALL or EMT.TO_SPECSPLIT then ExecOpenRoller( 2) end
|
||||
ExecOpenRoller( 1)
|
||||
ExecOpenRoller( 2)
|
||||
local sV1, MoveV1, sV2, MoveV2 = CalcMoveV1V2ForAuxCmd( Cmd)
|
||||
local bOk, bOk1, bOk2, bOk3, bOk4, bOk5 = SimulMoveAxes( Cmd[2], tonumber( Cmd[3]), MCH_SIM_STEP.RAPID,
|
||||
Cmd[4], tonumber( Cmd[5]), MCH_SIM_STEP.RAPID,
|
||||
@@ -1277,15 +1293,13 @@ function ExecAuxCmd( sCmd)
|
||||
end
|
||||
end
|
||||
elseif Cmd[1] == '4' then
|
||||
ExecMoveHome( Cmd[2] == '1', EMT.MCHSPLIT)
|
||||
ExecMoveHome( Cmd[2] == '1', EgtIf( bPathStart, false, EMT.MCHSPLIT))
|
||||
elseif Cmd[1] == '11' then
|
||||
local dPY = EgtIf( Cmd[2] == '0', MaxHoOpen, EgtIf( EMT.ROT == -1, EMT.SB, EMT.HB))
|
||||
SimulMoveAxis( 'PY1', dPY, MCH_SIM_STEP.RAPID)
|
||||
SetPY1Light( Cmd[2] ~= '0')
|
||||
local bClose = Cmd[2] ~= '0'
|
||||
if bPathStart and EMT.MCHSPLIT and not EMT.FALL and EMT.AUXIND >= 8 then bClose = false end
|
||||
ExecMovePY1( bClose)
|
||||
elseif Cmd[1] == '12' then
|
||||
local dPY = EgtIf( Cmd[2] == '0', MaxHoOpen, EgtIf( EMT.ROT == -1, EMT.SB, EMT.HB))
|
||||
SimulMoveAxis( 'PY2', dPY, MCH_SIM_STEP.RAPID)
|
||||
SetPY2Light( Cmd[2] ~= '0')
|
||||
ExecMovePY2( Cmd[2] ~= '0')
|
||||
elseif Cmd[1] == '21' then
|
||||
local nY1Delta = tonumber( Cmd[2])
|
||||
local nY2Delta = tonumber( Cmd[3])
|
||||
@@ -1367,6 +1381,7 @@ end
|
||||
function ExecMoveHome( bNearV, bMchSplit)
|
||||
-- risalita a Zmax
|
||||
ExecMoveZmax( bMchSplit)
|
||||
EMT.TO_ZMAX = nil
|
||||
-- se richiesto, avvicino i rulli
|
||||
if bNearV then
|
||||
-- se sega a catena su testa 1 devo prima depositarla
|
||||
@@ -1576,6 +1591,18 @@ function ExecUnloading()
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function ExecMovePY1( bClose)
|
||||
SimulMoveAxes( 'PY1', EgtIf( not bClose, MaxHoOpen, EMT.HB), MCH_SIM_STEP.RAPID)
|
||||
SetPY1Light( bClose)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function ExecMovePY2( bClose)
|
||||
SimulMoveAxes( 'PY2', EgtIf( not bClose, MaxHoOpen, EMT.HB), MCH_SIM_STEP.RAPID)
|
||||
SetPY2Light( bClose)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function LinkRemainingPartsToY1()
|
||||
local nCurrOrd = GetPhaseOrd( EMT.PHASE)
|
||||
@@ -1607,6 +1634,9 @@ function ExecParkRoller( PosY1, PosY2, PosV1, PosV2, bSpliCut, bAgg)
|
||||
-- Parcheggi pinze
|
||||
local MyParkY1 = ParkY1 + EgtIf( bAgg, AggLoad, 0)
|
||||
local MyParkY2 = ParkY2
|
||||
-- Apro i rulli, se necessario
|
||||
if abs( ParkV1 - PosV1) > 0.1 then ExecOpenRoller( 1) end
|
||||
if abs( ParkV2 - PosV2) > 0.1 then ExecOpenRoller( 2) end
|
||||
-- Eseguo spostamenti
|
||||
if EMT.Y1DELTA and EMT.Y2DELTA then
|
||||
local DiffY1 = MyParkY1 - PosY1
|
||||
@@ -1692,8 +1722,8 @@ function ExecParkRoller( PosY1, PosY2, PosV1, PosV2, bSpliCut, bAgg)
|
||||
local MoveV2 = ParkV2 - PosV2
|
||||
local DiffY2 = MyParkY2 - PosY2
|
||||
local MoveY2 = EgtIf( DiffY2 < -0.1, MoveV2, 0)
|
||||
local TryMoveY2 = ParkV2 - PosT - EMT.LT - EMT.HOVM
|
||||
if ( PosT + EMT.LT + EMT.HOVM < ParkV1 + ExtraParkV and PosT + EMT.LT + EMT.HOVM > ParkV2 and PosY2 + TryMoveY2 > MinY2) then MoveY2 = min( MoveY2, TryMoveY2) end
|
||||
local TryMoveY2 = ParkV2 - PosT - EMT.LT - EMT.DELTA_LT - EMT.HOVM
|
||||
if ( PosT + EMT.LT + EMT.DELTA_LT + EMT.HOVM < ParkV1 + ExtraParkV and PosT + EMT.LT + EMT.DELTA_LT + EMT.HOVM > ParkV2 and PosY2 + TryMoveY2 > MinY2) then MoveY2 = min( MoveY2, TryMoveY2) end
|
||||
if not SimulMoveAxes( 'T', PosT + MoveY2, MCH_SIM_STEP.RAPID,
|
||||
'V1', ParkV1, MCH_SIM_STEP.RAPID,
|
||||
'V2', ParkV2, MCH_SIM_STEP.RAPID,
|
||||
|
||||
+21
-1
@@ -291,6 +291,22 @@ local function GetNextStartOrRestPhase( nPhase)
|
||||
return nNextPhase
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function IsFirstMachiningOfStart( nMchId)
|
||||
-- se non è fase inizio di pezzo, ritorno risultato negativo
|
||||
if not IsStartOrRestPhase( EMC.PHASE) then
|
||||
return false
|
||||
end
|
||||
-- recupero la precedente operazione attiva
|
||||
local nPrevOperId = EgtGetPrevActiveOperation( nMchId)
|
||||
-- se non esiste o non è una disposizione, ritorno risultato negativo
|
||||
if not nPrevOperId or EgtGetOperationType( nPrevOperId) ~= MCH_OY.DISP then
|
||||
return false
|
||||
end
|
||||
-- è la prima
|
||||
return true
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function GetPhaseRot( nPhase)
|
||||
return ( EgtGetInfo( EgtGetPhaseDisposition( nPhase) or GDB_ID.NULL, 'ROT', 'i') or 0)
|
||||
@@ -839,6 +855,7 @@ function SpecApplyPath( bPreSplit, bSplitting, bPreCut, bCutting, bUnload, bPreR
|
||||
EMC.SB = b3Tot:getDimY()
|
||||
EMC.HB = b3Tot:getDimZ()
|
||||
EMC.LT = b3Raw:getDimX()
|
||||
EgtOutLog( ' BarLen='..EgtNumToString( EMC.LB, 1), 3)
|
||||
|
||||
-- Aggiorno limiti di presa
|
||||
UpdateMinJoin()
|
||||
@@ -1297,6 +1314,9 @@ function SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1Del
|
||||
return {}
|
||||
end
|
||||
|
||||
-- al carico o con prima lavorazione di un pezzo si deve ignorare l'ingombro delle lavorazioni di testa per il pinzaggio
|
||||
if EMC.LOAD or IsFirstMachiningOfStart( EMC.MCHID) then EMC.HCING = 0 end
|
||||
|
||||
return SpecAdjustCarriages( WorkTab)
|
||||
|
||||
-- [B] se richiesti entrambi e posso metterli
|
||||
@@ -2599,7 +2619,7 @@ function SpecAdjustCarrC( WorkTab)
|
||||
WorkTab.dY1DeltaMaxF = EMC.LB - ( MinJoin + MyTCING)
|
||||
-- se Y1 deve accentrarsi
|
||||
if WorkTab.dY1DeltaI > WorkTab.dY1DeltaMaxF then
|
||||
WorkTab.dY1DeltaMinF = EMC.LB - 2 *( MinJoin + MyTCING)
|
||||
WorkTab.dY1DeltaMinF = EMC.LB - 2 * MinJoin - MyTCING
|
||||
end
|
||||
end
|
||||
-- posizioni obiettivo dei carrelli al centro dei rispettivi intervalli di validità
|
||||
|
||||
+2
-1
@@ -38,12 +38,13 @@
|
||||
-- 2023/11/28 ver 2.6a1 Prima versione con utilizzo post-processore standard per macchine ONE e PF
|
||||
-- 2024/01/17 ver 2.6a2 Allineamento con Common ver. 2.6a2
|
||||
-- 2024/01/23 ver 2.6a3 Allineamento con Common ver. 2.6a3
|
||||
-- 2024/01/23 ver 2.6a4 Allineamento con Common ver. 2.6a5
|
||||
|
||||
-- Intestazioni
|
||||
require( 'EmtGenerator')
|
||||
EgtEnableDebug( false)
|
||||
|
||||
PP_VER = '2.6a3'
|
||||
PP_VER = '2.6a4'
|
||||
MIN_MACH_VER = '2.5k1'
|
||||
|
||||
local sBaseDir = EgtGetSourceDir()
|
||||
|
||||
+9
-1
@@ -15,4 +15,12 @@ Versione 2.6a2 (09/01/2024)
|
||||
- Nuova versione. Prima versione stabile rilasciabile.
|
||||
|
||||
Versione 2.6a3 (23/01/2024)
|
||||
- (GEN) Corretto gestione del movimento precedente all'ultimo che manda il pezzo alla posizione di scarico
|
||||
- (GEN) Corretto gestione del movimento precedente all'ultimo che manda il pezzo alla posizione di scarico
|
||||
|
||||
versione 2.6a4 (24/01/2024)
|
||||
- (GEN) Se pezzo tenuto solo con pinza destra non si esclude la rulliera di sinistra, se pezzogrande, può venire in supporto
|
||||
- (SIM-GEN) Correzione gestione apertura/chiusura rulli sul fine barra e in generale (da PF1250)
|
||||
- (SIM) Aggiunto solido collisione lama sotto traversa (per PF-progress)
|
||||
|
||||
versione 2.6a5 (26/01/2024)
|
||||
- (SIM-GEN) Migliorato calcolo dimensioni grezzo per apertura rulli in caso di 'precut'
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
local InfoCommon_STD_PP = {
|
||||
NAME = 'Common_ONE-PF', -- nome script PP standard
|
||||
VERSION = '2.6a3', -- versione script
|
||||
VERSION = '2.6a5', -- versione script
|
||||
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user