Compare commits

...

5 Commits

7 changed files with 52 additions and 28 deletions
+3 -1
View File
@@ -110,7 +110,7 @@ if EgtExistsFile( sDataBeam) then
BeamData.LEN_VERY_SHORT_PART = Machine.Offsets.LEN_VERY_SHORT_PART or BeamData.LEN_VERY_SHORT_PART
BeamData.LEN_SHORT_PART = Machine.Offsets.LEN_SHORT_PART or BeamData.LEN_SHORT_PART
BeamData.OVM_MID = Machine.Offsets.OVM_MID or BeamData.OVM_MID
BeamData.MAX_ANGLE_DRILL_CUT = Machine.Offsets.MAX_ANGLE_DRILL_CUT or BeamData.MAX_ANGLE_DRILL_CUT
if Machine.Offsets.MAX_ANGLE_DRILL_CUT then BeamData.MAX_ANGLE_DRILL_CUT = EgtClamp( Machine.Offsets.MAX_ANGLE_DRILL_CUT, 1, 89) end
if Machine.Offsets.PRECUT_HEAD_DISABLE then BeamData.PRECUT_HEAD = ( Machine.Offsets.PRECUT_HEAD_DISABLE == 0) end
if Machine.Offsets.PRECUT_TAIL_DISABLE then BeamData.PRECUT_TAIL = ( Machine.Offsets.PRECUT_TAIL_DISABLE == 0) end
-- per tagli con lama longitudinale si può attivare oppure si prende in automatico in caso di presenza della seconda lama
@@ -118,6 +118,8 @@ if EgtExistsFile( sDataBeam) then
BeamData.USE_LONGCUT = SecondSaw or BeamData.USE_LONGCUT
if Machine.Offsets.CUT_SIC then BeamData.CUT_SIC = EgtClamp( Machine.Offsets.CUT_SIC, 15, 50) end
if Machine.Offsets.USE_PART_OFFSET then BeamData.USE_PART_OFFSET = ( Machine.Offsets.USE_PART_OFFSET == 1) end
if Machine.Offsets.MIN_JOIN_S then BeamData.MIN_JOIN_S = Machine.Offsets.MIN_JOIN_S end
if Machine.Offsets.MIN_JOIN_L then BeamData.MIN_JOIN_L = Machine.Offsets.MIN_JOIN_L end
end
if Machine.Trave then
BeamData.MIN_WIDTH = Machine.Trave.XMIN or BeamData.MIN_WIDTH
+17 -3
View File
@@ -2020,6 +2020,12 @@ function PrepareResidue( sCmd, nInd)
MDChar.V2 = ParkV2 ; EMT.V2POS = MDChar.V2
end
table.insert( EMT.MDCHAR, MDChar)
-- Se scarico in linea con abbassamento piano ferma pezzo allo scarico
if Cmd[4] == 'UnBrakeBeam' then
-- Abbassa ferma pezzo
local MDStopBeam = { StopBeamStat=2, Load=1}
table.insert( EMT.MDCHAR, MDStopBeam)
end
end
elseif Cmd[1] == '2' then
local MDChar = { IniStatY1=EMT.ISY1, FinStatY1=EMT.FSY1, IniStatY2=EMT.ISY2, FinStatY2=EMT.FSY2, IniStatV2=1, BeamVise=EMT.BV}
@@ -2031,6 +2037,11 @@ function PrepareResidue( sCmd, nInd)
EMT.ROLL_IN = nil
end
table.insert( EMT.MDCHAR, MDChar)
-- Alza ferma pezzo
if Cmd[6] == 'BrakeBeam' then
local MDStopBeam = { StopBeamStat=1, Load=1}
table.insert( EMT.MDCHAR, MDStopBeam)
end
elseif Cmd[1] == '3' then
local MDChar = { IniStatY1=EMT.ISY1, FinStatY1=EMT.FSY1, IniStatY2=EMT.ISY2, FinStatY2=EMT.FSY2, IniStatV1=1, IniStatV2=1, BeamVise=EMT.BV}
if Cmd[2] ~= 'T' then MDChar[Cmd[2]] = tonumber( Cmd[3]) end
@@ -2122,7 +2133,7 @@ function PrepareUnload( sCmd, nInd)
local MDChar = { Y2=tonumber(Cmd[3]), V2=ParkV2, IniStatY2=1, FinStatY2=1, BeamVise=EgtIf( bBarOnY, 1, 0), MovType=EgtIf( EMT.CHY_ON, 3, 2)}
table.insert( EMT.MDCHAR, MDChar)
-- Abbassa ferma pezzo
local MDStopBeam = { StopBeamStat=2}
local MDStopBeam = { StopBeamStat=2, Unload=1}
table.insert( EMT.MDCHAR, MDStopBeam)
-- Dopo che si è abbassato il ferma pezzo chiude il pezzo in morsa per evitare che esso possa essere pinzato inclinato dal pistone
MDChar = { Y2=tonumber(Cmd[3]), V2=ParkV2, IniStatY2=1, FinStatY2=-1, BeamVise=EgtIf( bBarOnY, 1, 0), MovType=EgtIf( EMT.CHY_ON, 3, 2)}
@@ -2143,7 +2154,7 @@ function PrepareUnload( sCmd, nInd)
local MDChar = { Y2=tonumber(Cmd[5]), IniStatY1=EgtIf( bBarOnY, -1, 1), FinStatY1=EgtIf( bBarOnY, -1, 1), IniStatY2=-1, FinStatY2=-1, IniStatV2=1, BeamVise=2, MovType=EgtIf( EMT.CHY_ON, 3, 2)}
table.insert( EMT.MDCHAR, MDChar)
-- Alza ferma pezzo
local MDStopBeam = { StopBeamStat=1}
local MDStopBeam = { StopBeamStat=1, Unload=1}
table.insert( EMT.MDCHAR, MDStopBeam)
-- Ribadisce le quote del carrello appena mosso e Apre la pinza
MDChar = { Y2=tonumber(Cmd[5]), IniStatY1=EgtIf( bBarOnY, -1, 1), FinStatY1=EgtIf( bBarOnY, -1, 1), IniStatY2=-1, FinStatY2=1, IniStatV2=1, BeamVise=2, MovType=EgtIf( EMT.CHY_ON, 3, 2)}
@@ -3126,7 +3137,10 @@ end
function EmitStopBeam( MoData)
EmitMoveStartChars(2)
EmitMoveWaitChars(2)
if MoData.StopBeamStat then sOut = 'M125 P2=' .. EgtNumToString( MoData.StopBeamStat, 0) end
if MoData.StopBeamStat then
local sUnloadSide = EgtIf( MoData.Load, 'P1=', 'P2=')
sOut = 'M125 ' .. sUnloadSide .. EgtNumToString( MoData.StopBeamStat, 0)
end
MyOutput( sOut)
end
+28 -21
View File
@@ -160,10 +160,10 @@ function OnSimulStart()
local nId = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( nGrpId, McdData[i].Sub), McdData[i].Name)
if nId then
table.insert( EMT.MCODET, nId)
EgtOutLog( 'Element ' .. McdData[i].Grp .. '/' .. McdData[i].Sub .. '/' .. McdData[i].Name .. ' (' .. tostring( nId) .. ') is ok', 4)
EgtOutLog( ' Element ' .. McdData[i].Grp .. '/' .. McdData[i].Sub .. '/' .. McdData[i].Name .. ' (' .. tostring( nId) .. ') is ok', 4)
else
nMcdNullCnt = nMcdNullCnt + 1
EgtOutLog( 'Element ' .. McdData[i].Grp .. '/' .. McdData[i].Sub .. '/' .. McdData[i].Name .. ' is null', 4)
EgtOutLog( ' Element ' .. McdData[i].Grp .. '/' .. McdData[i].Sub .. '/' .. McdData[i].Name .. ' is null', 4)
end
end
if nMcdNullCnt > 0 then
@@ -484,6 +484,7 @@ end
---------------------------------------------------------------------
function OnSimulToolSelect( dPosA)
EgtOutLog( '===> ToolSelect : Reset CollisionObj', 4)
-- se utensile non definito, è disposizione ed esco
if EMT.TOOL == '' then return end
-- recupero dati utensile
@@ -575,9 +576,9 @@ function OnSimulToolSelect( dPosA)
-- se attivo Collision Check
EMT.SAFEDIST = COLL_SAFE_DIST
if EMT.COLLOBJ then
local nInd = EgtIf( nSetHead ~= 2, 1001, 1011)
local nInd = 1000 + tonumber( string.sub( EMT.HEAD, 2))
AddToolToCollisionObj( EMT.TOOL, EMT.HEAD, EMT.EXIT, nInd, true)
AddToolHolderToCollisionObj( EMT.TOOL, EMT.HEAD, EMT.EXIT, nInd + 1)
AddToolHolderToCollisionObj( EMT.TOOL, EMT.HEAD, EMT.EXIT, nInd + 100)
for i, Coll in ipairs( EMT.COLLOBJ or {}) do
EmtAddCollisionObjEx( i, Coll.Fr, Coll.Ty, Coll.Mv, Coll.P1, Coll.P2, Coll.P3)
end
@@ -736,8 +737,9 @@ function OnSimulToolDeselect( dPrevA)
-- prendo utensile lama su aggregato
elseif EMT.NEXTHEAD == 'H22' then
-- aggiungo utensile per verifica collisione
AddToolToCollisionObj( EMT.NEXTTOOL, EMT.NEXTHEAD, EMT.NEXTEXIT, 1011, false)
AddToolHolderToCollisionObj( EMT.NEXTTOOL, EMT.NEXTHEAD, EMT.NEXTEXIT, 1011 + 1)
local nInd = 1000 + tonumber( string.sub( EMT.NEXTHEAD, 2))
AddToolToCollisionObj( EMT.NEXTTOOL, EMT.NEXTHEAD, EMT.NEXTEXIT, nInd, false)
AddToolHolderToCollisionObj( EMT.NEXTTOOL, EMT.NEXTHEAD, EMT.NEXTEXIT, nInd + 100)
-- simulo movimento
SimulMoveAxis( 'X2', ParkSawX2, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'B2', ParkSawB2, MCH_SIM_STEP.COLLROT, 'C2', ParkSawC2, MCH_SIM_STEP.COLLROT)
@@ -746,6 +748,7 @@ end
---------------------------------------------------------------------
function OnSimulMachiningStart()
EgtOutLog( '===> Start Machining : ' .. EgtGetName( EMT.MCHID), 4)
-- se lavorazione è con gruppo a forare, abilito le altre punte alla lavorazione del VMILL
if EMT.HEAD == 'H14' then
local OtherTools = EgtGetToolsInCurrSetupPos( 'T121')
@@ -754,7 +757,7 @@ function OnSimulMachiningStart()
if OtherTools[i] ~= '' and OtherTools[i] ~= EMT.TOOL then
EmtAddToolForVmill( OtherTools[i], 'H14', i, EMT.VMILL)
-- dichiaro utensile per verifica collisioni
local nInd = 1011
local nInd = 1000 + tonumber( string.sub( 'H14', 2))
AddToolToCollisionObj( OtherTools[i], 'H14', i, nInd, true)
end
end
@@ -821,9 +824,9 @@ function OnSimulMachiningStart()
-- dichiaro utensile per Vmill
EmtAddToolForVmill( sDouTool, sDouHead, nDouExit, EMT.VMILL)
-- dichiaro utensile per verifica collisioni
local nInd = 1011
local nInd = 1000 + tonumber( string.sub( sDouHead, 2))
AddToolToCollisionObj( sDouTool, sDouHead, nDouExit, nInd, true)
AddToolHolderToCollisionObj( sDouTool, sDouHead, nDouExit, nInd + 1)
AddToolHolderToCollisionObj( sDouTool, sDouHead, nDouExit, nInd + 100)
-- salvo dati
EMT.DOU_TLEN = EgtTdbGetCurrToolParam( MCH_TP.LEN)
EMT.DOU_TTOTLEN = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
@@ -840,19 +843,17 @@ function OnSimulMachiningStart()
local nSetHead = GetHeadSet( EMT.HEAD)
if nSetHead ~= 1 and ( EMT.PREVTOOL_H1 and EMT.PREVHEAD_H1) then
local nPrevExit_H1 = 1
local nInd_H1 = 1001
local nInd_H1 = 1000 + tonumber( string.sub( EMT.PREVHEAD_H1, 2))
AddToolToCollisionObj( EMT.PREVTOOL_H1, EMT.PREVHEAD_H1, nPrevExit_H1, nInd_H1, true)
AddToolHolderToCollisionObj( EMT.PREVTOOL_H1, EMT.PREVHEAD_H1, nPrevExit_H1, nInd_H1 + 1)
AddToolHolderToCollisionObj( EMT.PREVTOOL_H1, EMT.PREVHEAD_H1, nPrevExit_H1, nInd_H1 + 100)
end
if nSetHead ~= 2 and ( EMT.PREVTOOL_H2 and EMT.PREVHEAD_H2) then
local nPrevExit_H2 = 1
local nInd_H2 = 1011
local nInd_H2 = 1000 + tonumber( string.sub( EMT.PREVHEAD_H2, 2))
AddToolToCollisionObj( EMT.PREVTOOL_H2, EMT.PREVHEAD_H2, nPrevExit_H2, nInd_H2, true)
AddToolHolderToCollisionObj( EMT.PREVTOOL_H2, EMT.PREVHEAD_H2, nPrevExit_H2, nInd_H2 + 1)
AddToolHolderToCollisionObj( EMT.PREVTOOL_H2, EMT.PREVHEAD_H2, nPrevExit_H2, nInd_H2 + 100)
end
if nSetHead ~= 3 and IsHeadExisting( 3) then
local nPrevExit_H3 = 1
local nInd_H3 = 1001
local sHeadName
if EgtGetHeadId( 'H39') then
sHeadName = 'H39'
@@ -861,8 +862,10 @@ function OnSimulMachiningStart()
else
EmtSetLastError( 1212, "HEAD not managed")
end
AddToolToCollisionObj( nil, sHeadName, nPrevExit_H3, 1001)
AddToolHolderToCollisionObj( nil, sHeadName, nPrevExit_H3, 1002)
local nPrevExit_H3 = 1
local nInd_H3 = 1000 + tonumber( string.sub( sHeadName, 2))
AddToolToCollisionObj( nil, sHeadName, nPrevExit_H3, nInd_H3)
AddToolHolderToCollisionObj( nil, sHeadName, nPrevExit_H3, nInd_H3 + 100)
end
end
-- se precedente in doppio ma ora solo testa 1 e non in sicurezza
@@ -933,6 +936,10 @@ function OnSimulPathStart()
EMT.TO_FALL = true
end
end
-- dump oggetti di collisione
if DumpCollisionObj then
DumpCollisionObj( ' ==> CollisionObj :', 4)
end
end
---------------------------------------------------------------------
@@ -1445,10 +1452,10 @@ function OnSimulCollision()
return
end
local Class = ''
if EMT.SIMCOBIND == 1001 or EMT.SIMCOBIND == 1011 then
Class = 'T_'..EMT.HEAD
elseif EMT.SIMCOBIND == 1002 or EMT.SIMCOBIND == 1012 then
Class = 'TH_'..EMT.HEAD
if EMT.SIMCOBIND > 1000 and EMT.SIMCOBIND < 1099 then
Class = 'T_H'.. tostring( EMT.SIMCOBIND - 1000)
elseif EMT.SIMCOBIND > 1100 and EMT.SIMCOBIND < 1199 then
Class = 'TH_H'..tostring( EMT.SIMCOBIND - 1100)
else
Class = EMT.COLLOBJ[EMT.SIMCOBIND].Cl
end
+2 -2
View File
@@ -1392,12 +1392,12 @@ function SpecCalcUnloadOnLoadPos()
end
-- riporto la trave al carico
local dRotT = LoadT + TurnerOffs
table.insert( vCmd, { 2, 'Y1', dRotT + EMC.Y1DELTA, 'T', dRotT})
table.insert( vCmd, { 2, 'Y1', dRotT + EMC.Y1DELTA, 'T', dRotT, 'BrakeBeam'})
-- apro la morsa
table.insert( vCmd, { 11, 0})
EMC.CNT = nil
-- riporto il carrello in home
table.insert( vCmd, { 1, 'Y1', ParkY1})
table.insert( vCmd, { 1, 'Y1', ParkY1, 'UnBrakeBeam'})
-- eventuale unione tabelle
if #vCmdPre > 0 then
+1 -1
View File
@@ -5,7 +5,7 @@
require( 'EmtGenerator')
EgtEnableDebug( false)
PP_VER = '3.1a2_DEV16'
PP_VER = '3.1a2_DEV17'
PP_NVER = '3.1.1.2'
MIN_MACH_VER = '2.7d2'
MACH_NAME = EgtGetCurrMachineName()
Binary file not shown.
+1
View File
@@ -20,6 +20,7 @@
2=d,OpenMinSafe,0
3=d,OpenOutRaw,0
4=l,MaxOptSize,0
5=b,AdjustFeed,1
[Mortising]
0=d,MaxElev,0