Compare commits

..

4 Commits

Author SHA1 Message Date
andrea.villa 08cde3ae2c Merge branch 'develop' 2024-01-24 16:36:03 +01:00
andrea.villa 86665b87d8 Aggiunto solido collisione lama sotto traversa (per PF-progress) 2024-01-24 16:35:51 +01:00
andrea.villa 524bfc43e1 - Se pezzo tenuto solo con pinza destra non si esclude la rulliera di sinistra
- Correzione gestione apertura/chiusura rulli sul fine barra e in generale (da PF1250)
2024-01-23 15:22:25 +01:00
andrea.villa 69bc812e35 Merge branch 'main' into develop 2024-01-23 11:26:06 +01:00
5 changed files with 81 additions and 37 deletions
-2
View File
@@ -1089,8 +1089,6 @@ 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
+53 -32
View File
@@ -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'})
@@ -792,7 +797,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 +807,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 +1132,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 +1197,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 +1217,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 +1263,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 +1284,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 +1372,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 +1582,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 +1625,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
+21 -1
View File
@@ -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à
+6 -1
View File
@@ -15,4 +15,9 @@ 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)
+1 -1
View File
@@ -3,7 +3,7 @@
local InfoCommon_STD_PP = {
NAME = 'Common_ONE-PF', -- nome script PP standard
VERSION = '2.6a3', -- versione script
VERSION = '2.6a4', -- versione script
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
}