Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 785e4490ea | |||
| 971fcc0c07 | |||
| db7cb8c1b1 | |||
| 80fdaf23f4 | |||
| b832df5767 | |||
| 793fe00cc9 |
+63
-6
@@ -466,8 +466,10 @@ function OnSimulToolSelect( dPosA)
|
|||||||
EMT.TOTDIAM = EgtTdbGetCurrToolParam( MCH_TP.TOTDIAM)
|
EMT.TOTDIAM = EgtTdbGetCurrToolParam( MCH_TP.TOTDIAM)
|
||||||
-- se non è chiamato da altro script (non c'è parametro)
|
-- se non è chiamato da altro script (non c'è parametro)
|
||||||
if not dPosA then
|
if not dPosA then
|
||||||
-- se attivo Vmill
|
-- se utensile non flottante, abilito per Vmill
|
||||||
SetToolForVmill( EMT.TOOL, EMT.HEAD, EMT.EXIT, EMT.VMILL)
|
if not EMT.TFLOAT then
|
||||||
|
EmtSetToolForVmill( EMT.TOOL, EMT.HEAD, EMT.EXIT, EMT.VMILL)
|
||||||
|
end
|
||||||
-- se attivo Collision Check
|
-- se attivo Collision Check
|
||||||
EMT.SAFEDIST = COLL_SAFE_DIST
|
EMT.SAFEDIST = COLL_SAFE_DIST
|
||||||
if EMT.COLLOBJ then
|
if EMT.COLLOBJ then
|
||||||
@@ -527,6 +529,12 @@ function OnSimulToolSelect( dPosA)
|
|||||||
EgtSetAxisPos( 'B', 0)
|
EgtSetAxisPos( 'B', 0)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
-- se TC 1
|
||||||
|
if GetTCSet( EMT.TCPOS) == 1 then
|
||||||
|
EgtSetAxisPos( 'B', 90)
|
||||||
|
else
|
||||||
|
EgtSetAxisPos( 'B', -90)
|
||||||
|
end
|
||||||
-- breve pausa
|
-- breve pausa
|
||||||
EgtPause( 100)
|
EgtPause( 100)
|
||||||
EgtOutText( '')
|
EgtOutText( '')
|
||||||
@@ -576,7 +584,11 @@ function OnSimulToolDeselect()
|
|||||||
-- altrimenti posizioni standard rastrelliera
|
-- altrimenti posizioni standard rastrelliera
|
||||||
else
|
else
|
||||||
SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID)
|
SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID)
|
||||||
SimulMoveAxes( 'B', 90, MCH_SIM_STEP.COLLROT, 'C', -90, MCH_SIM_STEP.COLLROT)
|
if GetTCSet( EMT.TCPOS) == 1 then
|
||||||
|
SimulMoveAxes( 'B', 90, MCH_SIM_STEP.COLLROT, 'C', -90, MCH_SIM_STEP.COLLROT)
|
||||||
|
else
|
||||||
|
SimulMoveAxes( 'B', -90, MCH_SIM_STEP.COLLROT, 'C', -90, MCH_SIM_STEP.COLLROT)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
-- movimento scarico utensile di grosso diametro (su T111)
|
-- movimento scarico utensile di grosso diametro (su T111)
|
||||||
else
|
else
|
||||||
@@ -590,18 +602,25 @@ function OnSimulToolDeselect()
|
|||||||
-- nascondo utensile su testa e lo visualizzo su TcPos
|
-- nascondo utensile su testa e lo visualizzo su TcPos
|
||||||
EgtSetMode( EgtGetHeadId( EMT.HEAD), GDB_MD.HIDDEN)
|
EgtSetMode( EgtGetHeadId( EMT.HEAD), GDB_MD.HIDDEN)
|
||||||
ShowToolInTcPos( EMT.TCPOS_1, true)
|
ShowToolInTcPos( EMT.TCPOS_1, true)
|
||||||
|
|
||||||
-- movimento per carico utensile
|
-- movimento per carico utensile
|
||||||
if EMT.NEXTHEAD ~= 'H3' and EMT.NEXTHEAD ~= 'H5' and EMT.NEXTHEAD ~= 'H6' then
|
if EMT.NEXTHEAD ~= 'H3' and EMT.NEXTHEAD ~= 'H5' and EMT.NEXTHEAD ~= 'H6' then
|
||||||
SimulMoveAxes( 'B', 90, MCH_SIM_STEP.RAPROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.RAPROT)
|
SimulMoveAxes( 'B', EgtIf( GetTCSet( EMT.TCPOS) == 1, 90, -90), MCH_SIM_STEP.RAPROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.RAPROT)
|
||||||
else
|
else
|
||||||
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.RAPROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.RAPROT)
|
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.RAPROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.RAPROT)
|
||||||
end
|
end
|
||||||
-- se segue lama, carico utensile di default
|
-- se segue lama, carico utensile di default
|
||||||
if EMT.NEXTHEAD == 'H2' then
|
if EMT.NEXTHEAD == 'H2' then
|
||||||
local sDefTool = GetDefaultToolName()
|
local sDefTool = GetDefaultToolName()
|
||||||
EgtLoadTool( 'H1', 1, sDefTool)
|
|
||||||
EMT.TOOL_1 = sDefTool
|
EMT.TOOL_1 = sDefTool
|
||||||
EMT.TCPOS_1 = GetToolTcPos( EMT.TOOL_1)
|
EMT.TCPOS_1 = GetToolTcPos( EMT.TOOL_1)
|
||||||
|
-- se TC 1
|
||||||
|
if GetTCSet( EMT.TCPOS_1) == 1 then
|
||||||
|
EgtSetAxisPos( 'B', 90)
|
||||||
|
else
|
||||||
|
EgtSetAxisPos( 'B', -90)
|
||||||
|
end
|
||||||
|
EgtLoadTool( 'H1', 1, sDefTool)
|
||||||
-- lo nascondo sul portautensili
|
-- lo nascondo sul portautensili
|
||||||
ShowToolInTcPos( EMT.TCPOS_1, false)
|
ShowToolInTcPos( EMT.TCPOS_1, false)
|
||||||
end
|
end
|
||||||
@@ -768,7 +787,6 @@ function OnSimulMoveStart()
|
|||||||
EgtOutText( '')
|
EgtOutText( '')
|
||||||
EMT.MCHFIRST = false
|
EMT.MCHFIRST = false
|
||||||
local bZmax = ( EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
|
local bZmax = ( EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
|
||||||
|
|
||||||
-- con pezzi alti aggiorno gli assi rotanti prima di muovermi sopra il pezzo
|
-- con pezzi alti aggiorno gli assi rotanti prima di muovermi sopra il pezzo
|
||||||
if not EMT.LOAD and EMT.MOVE == 0 and EMT.HB > BeamHeightForFixRot and EMT.FLAG2 == 1 then
|
if not EMT.LOAD and EMT.MOVE == 0 and EMT.HB > BeamHeightForFixRot and EMT.FLAG2 == 1 then
|
||||||
-- se motosega mi muovo a X di sicurezza per ruotare
|
-- se motosega mi muovo a X di sicurezza per ruotare
|
||||||
@@ -778,20 +796,59 @@ function OnSimulMoveStart()
|
|||||||
end
|
end
|
||||||
EMT.POSTROT = nil
|
EMT.POSTROT = nil
|
||||||
end
|
end
|
||||||
|
-- se aggregato flottante su inizio attacco va compresso
|
||||||
|
if EMT.TFLOAT and not EMT.TFLOAT_CMP and EMT.MOVE == 1 and EgtGetName( EMT.MOVEID) == 'LI' then
|
||||||
|
-- recupero lunghezza
|
||||||
|
local dOffsL = - EgtGetMachiningParam( MCH_MP.OFFSL)
|
||||||
|
-- imposto compressione della parte flottante
|
||||||
|
SetFloatPos( EMT.HEAD, dOffsL)
|
||||||
|
-- imposto dati utensile in posizione compressa
|
||||||
|
EmtSetToolForVmill( EMT.TOOL, EMT.HEAD, EMT.EXIT, EMT.VMILL, 2, -dOffsL)
|
||||||
|
-- dichiaro che è compresso (assegnando Id entità di movimento)
|
||||||
|
EMT.TFLOAT_CMP = EMT.MOVEID
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
function OnSimulMoveEnd()
|
function OnSimulMoveEnd()
|
||||||
|
-- se termine di passata con lama
|
||||||
if EMT.FLAG == 301 then
|
if EMT.FLAG == 301 then
|
||||||
-- rimozione eventuali sfridi
|
-- rimozione eventuali sfridi
|
||||||
ExecRemoveScraps()
|
ExecRemoveScraps()
|
||||||
end
|
end
|
||||||
|
-- se utensile flottante e movimento di compressione
|
||||||
|
if EMT.TFLOAT and EMT.MOVEID == EMT.TFLOAT_CMP then
|
||||||
|
-- verifico ci sia stata collisione tra ghiera flottante (portautensile e pezzo)
|
||||||
|
if not EMT.TFLOAT_TH_COMPR_COLL then
|
||||||
|
local sErr = 'CUTID='..tostring( EMT.CUTID)..'; TASKID='..tostring( EMT.TASKID)..'; Mach='..EMT.MCHNAME..'; Floating Ring not compressed on approach'
|
||||||
|
EmtSetLastError( 1222, sErr)
|
||||||
|
EgtOutLog( 'Error : ' .. sErr, 1)
|
||||||
|
else
|
||||||
|
EgtOutLog( 'Floating Ring compressed on approach (MOVEID='..EgtNumToString( EMT.MOVEID)..')', 1)
|
||||||
|
end
|
||||||
|
EMT.TFLOAT_TH_COMPR_COLL = nil
|
||||||
|
end
|
||||||
|
-- se aggregato flottante su fine uscita va rilasciato
|
||||||
|
if EMT.TFLOAT and EMT.TFLOAT_CMP and EMT.MOVE == 1 and EgtGetName( EMT.MOVEID) == 'LO' and EgtGetName( EgtGetNext( EMT.MOVEID) or GDB_ID.NULL) ~= 'LO' then
|
||||||
|
-- reset compressione della parte flottante
|
||||||
|
SetFloatPos( EMT.HEAD, 0)
|
||||||
|
-- dichiaro che è rilasciato
|
||||||
|
EMT.TFLOAT_CMP = nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
function OnSimulCollision()
|
function OnSimulCollision()
|
||||||
-- se prima collisione della lavorazione, la segnalo
|
-- se prima collisione della lavorazione, la segnalo
|
||||||
if EMT.MCHNAME ~= EMT.LAST_MCHNAME_COLLIDE then
|
if EMT.MCHNAME ~= EMT.LAST_MCHNAME_COLLIDE then
|
||||||
|
-- speciale per utensile flottante (suo holder contro il grezzo)
|
||||||
|
if EMT.TFLOAT and EMT.TFLOAT_CMP and EMT.SIMCOBIND == 1002 and EMT.SIMVMID == EMT.VMILL[1] then
|
||||||
|
if EMT.MOVEID == EMT.TFLOAT_CMP then
|
||||||
|
EMT.TFLOAT_TH_COMPR_COLL = true
|
||||||
|
end
|
||||||
|
return
|
||||||
|
end
|
||||||
|
-- standard
|
||||||
local Class = ''
|
local Class = ''
|
||||||
if EMT.SIMCOBIND == 1001 then
|
if EMT.SIMCOBIND == 1001 then
|
||||||
Class = 'T_H1'
|
Class = 'T_H1'
|
||||||
|
|||||||
+36
-2
@@ -10,7 +10,8 @@ local BD = require( 'BeamData')
|
|||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
-- *** Generic Machinings ***
|
-- *** Generic Machinings ***
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
require( 'EmtGenMachining')
|
pcall( require, 'EmtGenMachining') -- si fa una require con PCALL perchè la libreria è opzionale
|
||||||
|
|
||||||
|
|
||||||
---------------------- OnSpecialMoveZup -----------------------------
|
---------------------- OnSpecialMoveZup -----------------------------
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
@@ -373,6 +374,17 @@ function OnSpecialApplyDisposition()
|
|||||||
EMC.HCING = EgtGetInfo( nCurrRawId, 'HCING', 'd') or 0
|
EMC.HCING = EgtGetInfo( nCurrRawId, 'HCING', 'd') or 0
|
||||||
EMC.TCING = EgtGetInfo( nCurrRawId, 'TCING', 'd') or 0
|
EMC.TCING = EgtGetInfo( nCurrRawId, 'TCING', 'd') or 0
|
||||||
|
|
||||||
|
-- correggo area non pinzabile in testa o coda in base alle info sulla lavorazione
|
||||||
|
local sNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||||
|
local dHCING = tonumber( EgtGetValInNotes( sNotes, 'HCING'))
|
||||||
|
if dHCING then
|
||||||
|
EMC.HCING = max( dHCING, -50)
|
||||||
|
end
|
||||||
|
local dTCING = tonumber( EgtGetValInNotes( sNotes, 'TCING'))
|
||||||
|
if dTCING then
|
||||||
|
EMC.TCING = max( dTCING, -50)
|
||||||
|
end
|
||||||
|
|
||||||
-- Devo scaricare il pezzo o il grezzo rimasto
|
-- Devo scaricare il pezzo o il grezzo rimasto
|
||||||
-- Posizione trave
|
-- Posizione trave
|
||||||
local dPosT
|
local dPosT
|
||||||
@@ -516,6 +528,17 @@ function OnPostApplyMachining()
|
|||||||
local bSplitting = ( sNotes:find( 'Split') ~= nil)
|
local bSplitting = ( sNotes:find( 'Split') ~= nil)
|
||||||
local bPreCut = ( sNotes:find( 'Precut') ~= nil)
|
local bPreCut = ( sNotes:find( 'Precut') ~= nil)
|
||||||
local bCutting = ( sNotes:find( 'Cut') ~= nil)
|
local bCutting = ( sNotes:find( 'Cut') ~= nil)
|
||||||
|
|
||||||
|
-- correggo area non pinzabile in testa o coda in base alle info sulla lavorazione
|
||||||
|
local dHCING = tonumber( EgtGetValInNotes( sNotes, 'HCING'))
|
||||||
|
if dHCING then
|
||||||
|
EMC.HCING = max( dHCING, -50)
|
||||||
|
end
|
||||||
|
local dTCING = tonumber( EgtGetValInNotes( sNotes, 'TCING'))
|
||||||
|
if dTCING then
|
||||||
|
EMC.TCING = max( dTCING, -50)
|
||||||
|
end
|
||||||
|
|
||||||
local bUnload = IsEndPhase( EMC.PHASE) or IsEnd2Phase( EMC.PHASE)
|
local bUnload = IsEndPhase( EMC.PHASE) or IsEnd2Phase( EMC.PHASE)
|
||||||
if bPreSplit or bPreCut then
|
if bPreSplit or bPreCut then
|
||||||
EgtSetInfo( EMC.MCHID, 'IS_PRE', '1')
|
EgtSetInfo( EMC.MCHID, 'IS_PRE', '1')
|
||||||
@@ -640,6 +663,17 @@ function SpecApplyPath( bPreSplit, bSplitting, bPreCut, bCutting, bUnload, bPreR
|
|||||||
EMC.HCING = EgtGetInfo( nCurrRawId, 'HCING', 'd') or 0
|
EMC.HCING = EgtGetInfo( nCurrRawId, 'HCING', 'd') or 0
|
||||||
EMC.TCING = EgtGetInfo( nCurrRawId, 'TCING', 'd') or 0
|
EMC.TCING = EgtGetInfo( nCurrRawId, 'TCING', 'd') or 0
|
||||||
|
|
||||||
|
-- correggo area non pinzabile in testa o coda in base alle info sulla lavorazione
|
||||||
|
local sNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
|
||||||
|
local dHCING = tonumber( EgtGetValInNotes( sNotes, 'HCING'))
|
||||||
|
if dHCING then
|
||||||
|
EMC.HCING = max( dHCING, -50)
|
||||||
|
end
|
||||||
|
local dTCING = tonumber( EgtGetValInNotes( sNotes, 'TCING'))
|
||||||
|
if dTCING then
|
||||||
|
EMC.TCING = max( dTCING, -50)
|
||||||
|
end
|
||||||
|
|
||||||
-- Calcolo dell'ingombro della lavorazione
|
-- Calcolo dell'ingombro della lavorazione
|
||||||
local dDistFront, dDistBack = SpecialCalcMachiningEncumbrance( EMC.MCHID, bPreCut)
|
local dDistFront, dDistBack = SpecialCalcMachiningEncumbrance( EMC.MCHID, bPreCut)
|
||||||
if not dDistFront or not dDistBack then return end
|
if not dDistFront or not dDistBack then return end
|
||||||
@@ -1687,7 +1721,7 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
|
|||||||
if abs( dYDeltaF - dYDeltaI) > 10 * GEO.EPS_SMALL then
|
if abs( dYDeltaF - dYDeltaI) > 10 * GEO.EPS_SMALL then
|
||||||
table.insert( vCmd, { 11, 0})
|
table.insert( vCmd, { 11, 0})
|
||||||
dYPosA = max( MyMinY, dTPosI + dYDeltaF)
|
dYPosA = max( MyMinY, dTPosI + dYDeltaF)
|
||||||
dTPosA = -( dYPosA + dVDeltaF)
|
dTPosA = dYPosA - dYDeltaF
|
||||||
dVPosA = dTPosA + dVDeltaF
|
dVPosA = dTPosA + dVDeltaF
|
||||||
table.insert( vCmd, { 3, 'Y', dYPosA , 'T', dTPosA, 'V', dVPosA})
|
table.insert( vCmd, { 3, 'Y', dYPosA , 'T', dTPosA, 'V', dVPosA})
|
||||||
table.insert( vCmd, { 11, CalcCharStatus( 'Y', dYDeltaF)})
|
table.insert( vCmd, { 11, CalcCharStatus( 'Y', dYDeltaF)})
|
||||||
|
|||||||
@@ -97,6 +97,8 @@ H5=6603
|
|||||||
H6=6603
|
H6=6603
|
||||||
; Angular transmission
|
; Angular transmission
|
||||||
H7=6617
|
H7=6617
|
||||||
|
; Floating Aggregate
|
||||||
|
H8=6619
|
||||||
|
|
||||||
[SetUp]
|
[SetUp]
|
||||||
Default=Standard
|
Default=Standard
|
||||||
|
|||||||
+193
-70
@@ -22,7 +22,7 @@
|
|||||||
-------------------------------------
|
-------------------------------------
|
||||||
|
|
||||||
require( 'EmtGenerator')
|
require( 'EmtGenerator')
|
||||||
EgtEnableDebug( false)
|
EgtEnableDebug( true)
|
||||||
|
|
||||||
PP_VER = '2.7a1'
|
PP_VER = '2.7a1'
|
||||||
PP_NVER = '2.7.1.1'
|
PP_NVER = '2.7.1.1'
|
||||||
@@ -89,7 +89,8 @@ MaxUnloadLen = 0
|
|||||||
BeamHeightForFixRot = 9999 -- per abilitare assegnare 500
|
BeamHeightForFixRot = 9999 -- per abilitare assegnare 500
|
||||||
NewTopC = true
|
NewTopC = true
|
||||||
SafeXRotAxes = 150
|
SafeXRotAxes = 150
|
||||||
AggreBlockHaus = false
|
AggreBlockHaus = true
|
||||||
|
SecondToolChanger = true
|
||||||
|
|
||||||
-- leggo e aggiorno con parametri da BeamData
|
-- leggo e aggiorno con parametri da BeamData
|
||||||
if BD then
|
if BD then
|
||||||
@@ -158,11 +159,16 @@ if EgtExistsFile( sData) then
|
|||||||
if Machine.Offsets.MIN_JOIN_LL then MinJoinLL = Machine.Offsets.MIN_JOIN_LL end
|
if Machine.Offsets.MIN_JOIN_LL then MinJoinLL = Machine.Offsets.MIN_JOIN_LL end
|
||||||
if Machine.Offsets.NEWTOPC then NewTopC = ( Machine.Offsets.NEWTOPC == 1) end
|
if Machine.Offsets.NEWTOPC then NewTopC = ( Machine.Offsets.NEWTOPC == 1) end
|
||||||
if Machine.Offsets.AGGRE_BH then AggreBlockHaus = ( Machine.Offsets.AGGRE_BH == 1) end
|
if Machine.Offsets.AGGRE_BH then AggreBlockHaus = ( Machine.Offsets.AGGRE_BH == 1) end
|
||||||
|
if Machine.Offsets.SEC_TC then SecondToolChanger = ( Machine.Offsets.SEC_TC == 1) end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if SpecialBH then SecondSupport = 0 end
|
if SpecialBH then SecondSupport = 0 end
|
||||||
|
|
||||||
|
-- compongo i gruppi appartenenti alla base
|
||||||
|
local sBaseAux = {'BASE/SOLID', 'BASE/TC', 'BASE/SIGN', 'BASE/COLLISION'}
|
||||||
|
if SecondToolChanger then table.insert( sBaseAux, 5, 'BASE/TC2') end
|
||||||
|
|
||||||
EmtGeneral {
|
EmtGeneral {
|
||||||
File='Essetre-FAST.nge',
|
File='Essetre-FAST.nge',
|
||||||
Offset = Vector3d( 0, 1150.16, -1500.0),
|
Offset = Vector3d( 0, 1150.16, -1500.0),
|
||||||
@@ -176,7 +182,8 @@ EmtGeneral {
|
|||||||
local BaseId = EmtBase {
|
local BaseId = EmtBase {
|
||||||
Name = 'Base',
|
Name = 'Base',
|
||||||
Geo='BASE/GEO',
|
Geo='BASE/GEO',
|
||||||
Aux={'BASE/SOLID', 'BASE/TC', 'BASE/SIGN', 'BASE/COLLISION'}}
|
Aux = sBaseAux}
|
||||||
|
|
||||||
local XId = EmtAxis {
|
local XId = EmtAxis {
|
||||||
Name = 'X',
|
Name = 'X',
|
||||||
Parent = 'Base',
|
Parent = 'Base',
|
||||||
@@ -336,6 +343,7 @@ if AggreBlockHaus then
|
|||||||
Geo = 'H7_HEAD/GEO',
|
Geo = 'H7_HEAD/GEO',
|
||||||
Aux = {'H7_HEAD/SOLID', 'H7_HEAD/COLLISION'}}
|
Aux = {'H7_HEAD/SOLID', 'H7_HEAD/COLLISION'}}
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Morse
|
-- Morse
|
||||||
local YId = EmtAxis {
|
local YId = EmtAxis {
|
||||||
Name = 'Y',
|
Name = 'Y',
|
||||||
@@ -466,22 +474,83 @@ EmtTcPos {
|
|||||||
TDir = -X_AX(),
|
TDir = -X_AX(),
|
||||||
ADir = -Y_AX(),
|
ADir = -Y_AX(),
|
||||||
Geo = 'BASE/T10'}
|
Geo = 'BASE/T10'}
|
||||||
EmtTcPos {
|
if AggreBlockHaus then
|
||||||
Name = 'T11',
|
local TcpSsId = EmtTcPos {
|
||||||
Parent = 'Base',
|
Name = 'T11',
|
||||||
Pos = Point3d( 523.8, 88.0, -877.5),
|
|
||||||
TDir = -X_AX(),
|
|
||||||
ADir = -Y_AX(),
|
|
||||||
Geo = 'BASE/T11'}
|
|
||||||
if not SpecialBH then
|
|
||||||
EmtTcPos {
|
|
||||||
Name = 'T101',
|
|
||||||
Parent = 'Base',
|
Parent = 'Base',
|
||||||
Pos = Point3d( -510.4, 113.2, -160.8),
|
Pos = Point3d( 678.3, -1.963, -877.5),
|
||||||
TDir = X_AX(),
|
TDir = Y_AX(),
|
||||||
ADir = Z_AX(),
|
ADir = -X_AX(),
|
||||||
Geo = 'BASE/T101'}
|
Geo = 'BASE/T121',
|
||||||
|
Aux = 'BASE/T121_HS'}
|
||||||
else
|
else
|
||||||
|
EmtTcPos {
|
||||||
|
Name = 'T11',
|
||||||
|
Parent = 'Base',
|
||||||
|
Pos = Point3d( 523.8, 88.0, -877.5),
|
||||||
|
TDir = -X_AX(),
|
||||||
|
ADir = -Y_AX(),
|
||||||
|
Geo = 'BASE/T11'}
|
||||||
|
end
|
||||||
|
|
||||||
|
-- ToolChanger 2
|
||||||
|
if SecondToolChanger then
|
||||||
|
EmtTcPos {
|
||||||
|
Name = 'T21',
|
||||||
|
Parent = 'Base',
|
||||||
|
Pos = Point3d( -503.2, 88.0, 172.5),
|
||||||
|
TDir = X_AX(),
|
||||||
|
ADir = -Y_AX(),
|
||||||
|
Geo = 'BASE/T21'}
|
||||||
|
EmtTcPos {
|
||||||
|
Name = 'T22',
|
||||||
|
Parent = 'Base',
|
||||||
|
Pos = Point3d( -503.2, 88.0, 67.5),
|
||||||
|
TDir = X_AX(),
|
||||||
|
ADir = -Y_AX(),
|
||||||
|
Geo = 'BASE/T22'}
|
||||||
|
EmtTcPos {
|
||||||
|
Name = 'T23',
|
||||||
|
Parent = 'Base',
|
||||||
|
Pos = Point3d( -503.2, 88.0, -37.5),
|
||||||
|
TDir = X_AX(),
|
||||||
|
ADir = -Y_AX(),
|
||||||
|
Geo = 'BASE/T23'}
|
||||||
|
EmtTcPos {
|
||||||
|
Name = 'T24',
|
||||||
|
Parent = 'Base',
|
||||||
|
Pos = Point3d( -503.2, 88.0, -142.5),
|
||||||
|
TDir = X_AX(),
|
||||||
|
ADir = -Y_AX(),
|
||||||
|
Geo = 'BASE/T24'}
|
||||||
|
EmtTcPos {
|
||||||
|
Name = 'T25',
|
||||||
|
Parent = 'Base',
|
||||||
|
Pos = Point3d( -503.2, 88.0, -247.5),
|
||||||
|
TDir = X_AX(),
|
||||||
|
ADir = -Y_AX(),
|
||||||
|
Geo = 'BASE/T25'}
|
||||||
|
EmtTcPos {
|
||||||
|
Name = 'T26',
|
||||||
|
Parent = 'Base',
|
||||||
|
Pos = Point3d( -503.2, 88.0, -352.5),
|
||||||
|
TDir = X_AX(),
|
||||||
|
ADir = -Y_AX(),
|
||||||
|
Geo = 'BASE/T26'}
|
||||||
|
EmtTcPos {
|
||||||
|
Name = 'T27',
|
||||||
|
Parent = 'Base',
|
||||||
|
Pos = Point3d( -503.2, 88.0, -457.5),
|
||||||
|
TDir = X_AX(),
|
||||||
|
ADir = -Y_AX(),
|
||||||
|
Geo = 'BASE/T27'}
|
||||||
|
EmtTcPos {
|
||||||
|
Name = 'T28',
|
||||||
|
Parent = 'Base',
|
||||||
|
Pos = Point3d( -503.2, 88.0, -562.5),
|
||||||
|
TDir = X_AX(),
|
||||||
|
ADir = -Y_AX(),
|
||||||
|
Geo = 'BASE/T28'}
|
||||||
EmtTcPos {
|
EmtTcPos {
|
||||||
Name = 'T101',
|
Name = 'T101',
|
||||||
Parent = 'Base',
|
Parent = 'Base',
|
||||||
@@ -489,59 +558,66 @@ else
|
|||||||
TDir = X_AX(),
|
TDir = X_AX(),
|
||||||
ADir = Z_AX(),
|
ADir = Z_AX(),
|
||||||
Geo = 'BASE/T101S'}
|
Geo = 'BASE/T101S'}
|
||||||
end
|
else
|
||||||
if SecondSupport == 1 then
|
if not SpecialBH then
|
||||||
-- supporto per punta
|
EmtTcPos {
|
||||||
EmtTcPos {
|
Name = 'T101',
|
||||||
Name = 'T111',
|
Parent = 'Base',
|
||||||
Parent = 'Base',
|
Pos = Point3d( -510.4, 113.2, -160.8),
|
||||||
Pos = Point3d( -510.4, 113.2, -329.8),
|
TDir = X_AX(),
|
||||||
TDir = Z_AX(),
|
ADir = Z_AX(),
|
||||||
ADir = X_AX(),
|
Geo = 'BASE/T101'}
|
||||||
Geo = 'BASE/T111'}
|
else
|
||||||
elseif SecondSupport == 2 then
|
EmtTcPos {
|
||||||
-- supporto per mortasatrice
|
Name = 'T101',
|
||||||
local TcpSsId = EmtTcPos {
|
Parent = 'Base',
|
||||||
Name = 'T111',
|
Pos = Point3d( -510.4, 113.2, -1160.8),
|
||||||
Parent = 'Base',
|
TDir = X_AX(),
|
||||||
Pos = Point3d( -510.4, 113.2, -430.8),
|
ADir = Z_AX(),
|
||||||
TDir = X_AX(),
|
Geo = 'BASE/T101S'}
|
||||||
ADir = Z_AX(),
|
end
|
||||||
Geo = 'BASE/T111M'}
|
if SecondSupport == 1 then
|
||||||
EgtSetInfo( TcpSsId, 'Mortiser', true)
|
-- supporto per punta
|
||||||
elseif SecondSupport == 3 then
|
EmtTcPos {
|
||||||
-- supporto per rinvio angolare
|
Name = 'T111',
|
||||||
local TcpSsId = EmtTcPos {
|
Parent = 'Base',
|
||||||
Name = 'T91',
|
Pos = Point3d( -510.4, 113.2, -329.8),
|
||||||
Parent = 'Base',
|
TDir = Z_AX(),
|
||||||
ExitNbr = 2,
|
ADir = X_AX(),
|
||||||
Pos1 = Point3d( -710.4-150, 113.2, -329.8-170),
|
Geo = 'BASE/T111'}
|
||||||
TDir1 = X_AX(),
|
elseif SecondSupport == 2 then
|
||||||
Pos2 = Point3d( -710.4+150, 113.2, -329.8-170),
|
-- supporto per mortasatrice
|
||||||
TDir2 = -X_AX(),
|
local TcpSsId = EmtTcPos {
|
||||||
ADir = Z_AX(),
|
Name = 'T111',
|
||||||
Geo = 'BASE/T91',
|
Parent = 'Base',
|
||||||
Aux = 'BASE/T91_HS'}
|
Pos = Point3d( -510.4, 113.2, -430.8),
|
||||||
end
|
TDir = X_AX(),
|
||||||
if SpecialBH then
|
ADir = Z_AX(),
|
||||||
EmtTcPos {
|
Geo = 'BASE/T111M'}
|
||||||
Name = 'T111',
|
EgtSetInfo( TcpSsId, 'Mortiser', true)
|
||||||
Parent = 'Base',
|
elseif SecondSupport == 3 then
|
||||||
Pos = Point3d( -810.4, 113.2, -329.8),
|
-- supporto per rinvio angolare
|
||||||
TDir = Y_AX(),
|
local TcpSsId = EmtTcPos {
|
||||||
ADir = X_AX(),
|
Name = 'T91',
|
||||||
Geo = 'BASE/T111S'}
|
Parent = 'Base',
|
||||||
end
|
ExitNbr = 2,
|
||||||
|
Pos1 = Point3d( -710.4-150, 113.2, -329.8-170),
|
||||||
if AggreBlockHaus then
|
TDir1 = X_AX(),
|
||||||
local TcpSsId = EmtTcPos {
|
Pos2 = Point3d( -710.4+150, 113.2, -329.8-170),
|
||||||
Name = 'T121',
|
TDir2 = -X_AX(),
|
||||||
Parent = 'Base',
|
ADir = Z_AX(),
|
||||||
Pos = Point3d( 678.3, -1.963, -877.5),
|
Geo = 'BASE/T91',
|
||||||
TDir = Y_AX(),
|
Aux = 'BASE/T91_HS'}
|
||||||
ADir = -X_AX(),
|
end
|
||||||
Geo = 'BASE/T121',
|
if SpecialBH then
|
||||||
Aux = 'BASE/T121_HS'}
|
EmtTcPos {
|
||||||
|
Name = 'T111',
|
||||||
|
Parent = 'Base',
|
||||||
|
Pos = Point3d( -810.4, 113.2, -329.8),
|
||||||
|
TDir = Y_AX(),
|
||||||
|
ADir = X_AX(),
|
||||||
|
Geo = 'BASE/T111S'}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Aggiusto posizioni geometriche
|
-- Aggiusto posizioni geometriche
|
||||||
@@ -628,6 +704,52 @@ function GetPVLight()
|
|||||||
return ( EgtGetInfo( PVLightId, 'On') == '1')
|
return ( EgtGetInfo( PVLightId, 'On') == '1')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
---------------------------- Cambio Utensile ------------------------
|
||||||
|
function GetTCSet( sTcPos)
|
||||||
|
-- TC 1
|
||||||
|
if sTcPos == 'T1' or sTcPos == 'T2' or sTcPos == 'T3' or sTcPos == 'T4' or sTcPos == 'T5' or
|
||||||
|
sTcPos == 'T6' or sTcPos == 'T7' or sTcPos == 'T8' or sTcPos == 'T9' or sTcPos == 'T10' or sTcPos == 'T11' then
|
||||||
|
return 1
|
||||||
|
-- TC 2
|
||||||
|
elseif sTcPos == 'T21' or sTcPos == 'T22' or sTcPos == 'T23' or sTcPos == 'T24' or
|
||||||
|
sTcPos == 'T25' or sTcPos == 'T26' or sTcPos == 'T27' or sTcPos == 'T28' then
|
||||||
|
return 2
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
-- Funzione per impostare la posizione del rinvio flottante
|
||||||
|
function SetFloatPos( sHead, dPos)
|
||||||
|
-- recupero Id testa
|
||||||
|
local nHeadId = EgtGetHeadId( sHead)
|
||||||
|
if not nHeadId then return false end
|
||||||
|
-- se ci sono entità flottanti nel ToolHolder
|
||||||
|
local nRefId = EgtGetFirstNameInGroup( nHeadId, '_T1')
|
||||||
|
local vtTool = EgtFR( nRefId, GDB_ID.ROOT):getVersZ()
|
||||||
|
local nObjId = EgtGetFirstGroupInGroup( EgtGetFirstNameInGroup( nHeadId, 'T1'))
|
||||||
|
local FloatEntities = EgtGetInfoInGroup( nObjId, 'Float')
|
||||||
|
if FloatEntities and #FloatEntities > 0 then
|
||||||
|
-- il porta-utensile flottante non può comprimersi più di 10mm
|
||||||
|
if dPos > 10 then
|
||||||
|
local sErr = 'Floating Ring compressed more than 10mm'
|
||||||
|
EmtSetLastError( 1222, sErr)
|
||||||
|
EgtOutLog( 'Error : ' .. sErr, 1)
|
||||||
|
end
|
||||||
|
local dFloat = EgtGetInfo( FloatEntities[1], 'Float', 'd')
|
||||||
|
if abs( dPos - dFloat) > 10 * GEO.EPS_SMALL then
|
||||||
|
local vtMove = ( dPos - dFloat) * vtTool
|
||||||
|
-- sposto tutte le entità flottanti
|
||||||
|
for i = 1, #FloatEntities do
|
||||||
|
EgtMove( FloatEntities[i], vtMove, GDB_RT.GLOB)
|
||||||
|
EgtSetInfo( FloatEntities[i], 'Float', dPos)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
-- Funzione per resettare tutte le attivazioni della macchina
|
-- Funzione per resettare tutte le attivazioni della macchina
|
||||||
function OnResetMachine()
|
function OnResetMachine()
|
||||||
@@ -635,6 +757,7 @@ function OnResetMachine()
|
|||||||
EmtUnlinkAllFixturesFromGroups()
|
EmtUnlinkAllFixturesFromGroups()
|
||||||
SetPYLight( false)
|
SetPYLight( false)
|
||||||
SetPVLight( false)
|
SetPVLight( false)
|
||||||
|
SetFloatPos( 'H1', 0)
|
||||||
-- nascondo Vmill
|
-- nascondo Vmill
|
||||||
local nRawId = EgtGetFirstRawPart()
|
local nRawId = EgtGetFirstRawPart()
|
||||||
while nRawId do
|
while nRawId do
|
||||||
|
|||||||
Binary file not shown.
+27
-15
@@ -24,9 +24,7 @@ local INVALIDPOS = ""
|
|||||||
local POS = "Pos"
|
local POS = "Pos"
|
||||||
|
|
||||||
-- Geom Set
|
-- Geom Set
|
||||||
local GS = {}
|
local GS = {{"H1", "H7", "H8"}}
|
||||||
|
|
||||||
local bAggreBlockHaus = ( EgtGetHeadId( 'H7') ~= nil)
|
|
||||||
|
|
||||||
-- Configurazione posizioni
|
-- Configurazione posizioni
|
||||||
local PositionTable={{Pos = "Pos1", TcPos = "T1", Head = "H1", Group = "G1"},
|
local PositionTable={{Pos = "Pos1", TcPos = "T1", Head = "H1", Group = "G1"},
|
||||||
@@ -39,23 +37,37 @@ local PositionTable={{Pos = "Pos1", TcPos = "T1", Head = "H1", Group = "G1"},
|
|||||||
{Pos = "Pos8", TcPos = "T8", Head = "H1", Group = "G1"},
|
{Pos = "Pos8", TcPos = "T8", Head = "H1", Group = "G1"},
|
||||||
{Pos = "Pos9", TcPos = "T9", Head = "H1", Group = "G1"},
|
{Pos = "Pos9", TcPos = "T9", Head = "H1", Group = "G1"},
|
||||||
{Pos = "Pos10", TcPos = "T10", Head = "H1", Group = "G1"},
|
{Pos = "Pos10", TcPos = "T10", Head = "H1", Group = "G1"},
|
||||||
{Pos = "Pos11", TcPos = EgtIf( bAggreBlockHaus, "T121", "T11"), Head = EgtIf( bAggreBlockHaus, "H7", "H1"), Group = "G1"},
|
{Pos = "Pos11", TcPos = "T11", Head = "H1", Group = "G1"},
|
||||||
{Pos = "Pos12", TcPos = "T42", Head = "H2", Group = "G1"},
|
{Pos = "Pos12", TcPos = "T42", Head = "H2", Group = "G1"},
|
||||||
{Pos = "Pos13", TcPos = "T101", Head = "H3", Group = "G2"}}
|
{Pos = "Pos13", TcPos = "T101", Head = "H3", Group = "G2"}}
|
||||||
local SecSuppId = EgtGetTcPosId( 'T111')
|
|
||||||
if SecSuppId then
|
local IsTC2Active = ( EgtGetFirstNameInGroup( EgtGetBaseId( 'Base'), 'TC2') ~= nil)
|
||||||
local bMortiser = EgtGetInfo( SecSuppId, 'Mortiser', 'b')
|
if IsTC2Active then
|
||||||
if bMortiser then
|
local PositionTableTC2={{Pos = "Pos14", TcPos = "T21", Head = "H1", Group = "G3"},
|
||||||
table.insert( PositionTable, {Pos = "Pos14", TcPos = "T111", Head = "H3", Group = "G2"})
|
{Pos = "Pos15", TcPos = "T22", Head = "H1", Group = "G3"},
|
||||||
else
|
{Pos = "Pos16", TcPos = "T23", Head = "H1", Group = "G3"},
|
||||||
table.insert( PositionTable, {Pos = "Pos14", TcPos = "T111", Head = "H1", Group = "G2"})
|
{Pos = "Pos17", TcPos = "T24", Head = "H1", Group = "G3"},
|
||||||
|
{Pos = "Pos18", TcPos = "T25", Head = "H1", Group = "G3"},
|
||||||
|
{Pos = "Pos19", TcPos = "T26", Head = "H1", Group = "G3"},
|
||||||
|
{Pos = "Pos20", TcPos = "T27", Head = "H1", Group = "G3"},
|
||||||
|
{Pos = "Pos21", TcPos = "T28", Head = "H1", Group = "G3"}}
|
||||||
|
EgtJoinTables( PositionTable, PositionTableTC2)
|
||||||
|
else
|
||||||
|
local SecSuppId = EgtGetTcPosId( 'T111')
|
||||||
|
if SecSuppId then
|
||||||
|
local bMortiser = EgtGetInfo( SecSuppId, 'Mortiser', 'b')
|
||||||
|
if bMortiser then
|
||||||
|
table.insert( PositionTable, {Pos = "Pos14", TcPos = "T111", Head = "H3", Group = "G2"})
|
||||||
|
else
|
||||||
|
table.insert( PositionTable, {Pos = "Pos14", TcPos = "T111", Head = "H1", Group = "G2"})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if EgtGetHeadId( 'H5') then
|
||||||
|
table.insert( PositionTable, {Pos = "Pos14", TcPos = "T91", Head = "H5", Group = "G2"})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if EgtGetHeadId( 'H5') then
|
|
||||||
table.insert( PositionTable, {Pos = "Pos14", TcPos = "T91", Head = "H5", Group = "G2"})
|
|
||||||
end
|
|
||||||
|
|
||||||
local UsePositionHead = true
|
local UsePositionHead = false
|
||||||
|
|
||||||
local function IsInGeomSet( ToolHead, PosHead)
|
local function IsInGeomSet( ToolHead, PosHead)
|
||||||
for GsIndex = 1, #GS do
|
for GsIndex = 1, #GS do
|
||||||
|
|||||||
Binary file not shown.
@@ -27,6 +27,7 @@
|
|||||||
2=d,SIDESTEP
|
2=d,SIDESTEP
|
||||||
3=d,SIDEDEPTH
|
3=d,SIDEDEPTH
|
||||||
4=s,DOUBLE
|
4=s,DOUBLE
|
||||||
|
5=dr,TOOL_OVERHANG
|
||||||
|
|
||||||
[MILL_NOTIP]
|
[MILL_NOTIP]
|
||||||
0=th,TH,
|
0=th,TH,
|
||||||
@@ -34,6 +35,7 @@
|
|||||||
2=d,SIDESTEP
|
2=d,SIDESTEP
|
||||||
3=d,SIDEDEPTH
|
3=d,SIDEDEPTH
|
||||||
4=s,DOUBLE
|
4=s,DOUBLE
|
||||||
|
5=dr,TOOL_OVERHANG
|
||||||
|
|
||||||
[MORTISE_STD]
|
[MORTISE_STD]
|
||||||
0=b,MORTISE
|
0=b,MORTISE
|
||||||
|
|||||||
Reference in New Issue
Block a user