Piccole correzioni in simulazione per scarico motosega

This commit is contained in:
andrea.villa
2026-06-26 10:23:49 +02:00
parent 5d7bed991b
commit c2fe11a910
+7 -10
View File
@@ -616,8 +616,8 @@ function OnSimulToolDeselect( dPrevA)
-- nascondo l'utensile sulla testa
EgtSetMode( EgtGetHeadId( EMT.PREVHEAD_H1 or '') or GDB_ID.NULL, GDB_MD.HIDDEN)
-- se non è chiamata per cambio angolo di presa della sega a catena
if not dPrevA then
local sTool, sHead, sTcPos = FindNextToolOnHeadSet( 1, false)
local sTool, sHead, sTcPos = FindNextToolOnHeadSet( 1, false)
if not dPrevA or not sTool then
-- imposto correttamente i dati di testa
local OrigEMC = EMC
EMC = { HEAD = sHead, TOOL = sTool, TCPOS = sTcPos, TOTDIAM = 0}
@@ -643,13 +643,13 @@ function OnSimulToolDeselect( dPrevA)
-- nascondo l'utensile sulla testa
EgtSetMode( EgtGetHeadId( EMT.PREVHEAD_H2 or '') or GDB_ID.NULL, GDB_MD.HIDDEN)
-- se non è chiamata per cambio angolo di presa della sega a catena
if not dPrevA then
local sTool, sHead, sTcPos = FindNextToolOnHeadSet( 2, false)
if not dPrevA or not sTool then
-- cambio utensile
EgtSetAxisPos( 'C2', ParkC2)
EgtSetAxisPos( 'B2', ParkB2)
EgtSetAxisPos( 'Z2', MaxZ2)
SimulMoveAxis( 'X2', ParkX2, MCH_SIM_STEP.RAPID)
local sTool, sHead, sTcPos = FindNextToolOnHeadSet( 2, false)
local OrigEMC = EMC
EMC = { HEAD = sHead or 'H21', TOOL = sTool, TCPOS = sTcPos, TOTDIAM = 0}
OnSetHead()
@@ -662,9 +662,7 @@ function OnSimulToolDeselect( dPrevA)
end
-- se utensile non cambia e non è sega a catena, esco
-- if ( EMT.NEXTTOOL == EMT.PREVTOOL_H1 or EMT.NEXTTOOL == EMT.PREVTOOL_H2 or EMT.NEXTHEAD ~= EMT.HEAD) and not HeadIsChainSaw( EMT.NEXTHEAD) then return end
if ( EMT.NEXTTOOL == EMT.PREVTOOL_H1 or EMT.NEXTTOOL == EMT.PREVTOOL_H2) then return end
if ( EMT.NEXTTOOL == EMT.PREVTOOL_H1 or EMT.NEXTTOOL == EMT.PREVTOOL_H2) and not HeadIsChainSaw( EMT.NEXTHEAD) then return end
-- deposito utensile
EgtOutText( 'Tool change in progress...')
-- se prossimo utensile sega a catena, devo mettere in home testa 1 e depositare l'utensile sulla testa 2 o viceversa
@@ -680,13 +678,12 @@ function OnSimulToolDeselect( dPrevA)
'B2', EgtGetAxisHomePos( 'B2'), MCH_SIM_STEP.COLLROT, 'C2', EgtGetAxisHomePos( 'C2'), MCH_SIM_STEP.COLLROT)
end
local dNextHeadSet = GetHeadSet( EMT.NEXTHEAD)
if dNextHeadSet == 1 then
if dHeadSet == 1 then
-- visualizzo utensile su TcPos
ShowToolInTcPos( EMT.PREVTCPOS_H1, true)
-- nascondo l'utensile sulla testa
EgtSetMode( EgtGetHeadId( EMT.PREVHEAD_H1 or '') or GDB_ID.NULL, GDB_MD.HIDDEN)
elseif dNextHeadSet == 2 then
else
-- visualizzo utensile su TcPos
ShowToolInTcPos( EMT.PREVTCPOS_H2, true)
-- nascondo l'utensile sulla testa