Compare commits

..

3 Commits

Author SHA1 Message Date
andrea.villa 94095e79a6 Merge branch 'develop' 2024-01-26 15:29:41 +01:00
andrea.villa c3a61b1433 Migliorato calcolo dimensioni grezzo per apertura rulli in caso di 'precut' 2024-01-26 15:29:28 +01:00
andrea.villa 1555d809df Merge branch 'main' into develop 2024-01-24 16:36:27 +01:00
4 changed files with 47 additions and 26 deletions
+32 -23
View File
@@ -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
@@ -1093,7 +1103,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
if GetHeadTCSet( EMT.HEAD, EMT.TCPOS) == 'Head1_TC1' then
@@ -1270,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
@@ -1401,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
@@ -2419,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
@@ -2436,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
@@ -2536,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
@@ -2646,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
@@ -2663,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
@@ -2697,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
@@ -2708,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
+11 -2
View File
@@ -276,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
@@ -421,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
@@ -705,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
@@ -786,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
---------------------------------------------------------------------
@@ -1713,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,
+3
View File
@@ -21,3 +21,6 @@ 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
View File
@@ -3,7 +3,7 @@
local InfoCommon_STD_PP = {
NAME = 'Common_ONE-PF', -- nome script PP standard
VERSION = '2.6a4', -- versione script
VERSION = '2.6a5', -- versione script
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
}