Files
Manufacturer1-TestMachine/Manufacturer1-TestMachine.mlde
luca.mazzoleni 4db2667313 cambio versione
2024-09-25 12:38:36 +02:00

663 lines
26 KiB
Plaintext

-- Descrizione macchina Essetre-FAST by EgalTech s.r.l. 2024/03/28
-- 2021/12/29 DS ver 2.3l4 Per NUM non va considerato MillOffs negli offset in Z.
-- 2022/01/27 DS ver 2.4a2 Modifiche per tagli testa/coda su pezzi alti.
-- 2022/02/10 DS ver 2.4a3 Ridotto di 10mm pinzaggio con pezzi alti ma sottili.
-- 2022/02/26 DS ver 2.4b1 Aggiunta verifica collisioni spalle per sega a catena.
-- 2022/03/19 DS ver 2.4c1 Unificazione con BH.
-- 2022/05/24 DS ver 2.4e1 Corretto carico utensile punta lunga su T111.
-- 2022/05/24 DS ver 2.4e2 Corretto scarico utensile punta lunga su T111.
-- 2022/06/16 DS ver 2.4f1 Per Rinvio Angolare SecondSupport >= 3, se 2 è Mortiser. Aggiunta gestione Dist per seghe a catena e mortasatrici.
-- 2022/07/22 DS ver.2.4g2 Modifiche per ribaltamento pezzo con molto scarto iniziale.
-- 2022/07/29 DS ver.2.4g3 Migliorata modellazione testa con solidi per collisione.
-- 2022/08/17 DS ver 2.4h1 Correzione nuova gestione distanza di sega a catena.
-- 2022/08/24 DS ver 2.4h2 Correzioni per rinvio angolare (Angular Transmission).
-- 2022/09/20 DS ver 2.4i1 Aggiunta gestione NUM FlexiumPlus (NUM_PLUS).
-- 2022/10/22 DS ver 2.4j3 Ottimizzazioni per NUM FlexiumPlus.
-- 2022/11/09 DS ver 2.4k1 Per Num e NumPlus ora E30033 è ST (dim. verticale) e E30036 è HT (dim. orizzontale).
-- 2022/12/05 DS ver 2.4l1 In OnLinear di genera CN per Num e NumPlus eliminato recupero sovramateriale di testa EMT.X_OFF dopo riutilizzo EMT.L1o.
-- 2023/01/23 DS Ver.2.5a2 In simulazione corretta visualizzazione Sega a catena.
-- 2023/02/09 DS Ver.2.5b1 Correzioni NumPlus per parametri G115 e EG2/EG3 al cambio orientazione sega a catena.
-- 2023/03/20 DS Ver.2.5c1 Inserita gestione fresa BH al posto della lama.
-- 2023/07/26 DS ver.2.5g1 Per NUM e NUM_PLUS aggiunta gestione rotazione in alto su pezzi alti (G101 EH1) come per TPA in versione 2.3f2.
-- 2023/07/26 DS ver.2.5g2 Per NUM e NUM_PLUS tolta segnalazione errore rotazione a Zmax per pezzi alti non gestita (era su EMT.FLAG == 5).
-- 2023/07/27 DS ver.2.5g3 Il parametro di cui alle modifiche precedenti ora viene emesso solo se anche EMT.FLAG2==1.
-- 2023/08/17 DS ver 2.5h2 Possibilità di nuova gestione SawCOffs e SawBOffs con flag NewBCOffs.
-- 2023/08/22 DS ver 2.5h3 Eliminata nuova gestione di 2.5h2 perchè inclinando la direzione utensile rispetto al primo rotante limitava le direzioni raggiungibili.
-- 2023/09/29 ver 2.5i1 In BeamData e mlde aggiunta la lettura di alcuni parametri da Ts3Data.
-- 2023/10/18 DS ver 2.5j1 Con SpliRot ora si assegna da primo movimento di M111/G111 a EE/P8 il corretto valore 2.
-- 2023/10/19 DS ver 2.5j2 Per NUM_PLUS correzione per scarico con pezzo dopo oppure passando da Y a V per eliminare ET2 e scommentare ET2004.
-- 2023/10/21 DS ver 2.5j3 Gestione caso speciale di rotazione dopo separazione senza lavorazioni sul posizionamento finale.
-- 2023/11/04 DS ver 2.5k1 Eliminata testa H4. Aggiunta visualizzazione rinvio su TC.Aggiunta gestione MIN_MACH_VER per simulazione e generazione.
-- 2023/12/13 AV ver.2.5l1 Piccola correzione per errore digitazione variabile in calcolo riposizionamento carrelli (SpecAdjustCarrB3)
-- Corretto segno di una variabile in calcolo posizionamento carrelli
-- 2023/12/15 AV ver.2.5l2 Migliorato calcolo stima tempi di lavorazione
-- 2024/01/19 DS ver 2.6a1 Piccola modifica per direzione preferenziale rinvio da sotto (per evitare di accedere dal lato della barra).
-- 2024/01/29 DS ver 2.6a2 In portautensili per mortasa e sega a catena aggiunti ingombri dello stesso.
-- 2024/02/09 LM ver 2.6b1 In BeamData aggiunta funzione GetBlockedAxis che sostituisce la GetChainSawBlockedAxis.
-- 2024/02/23 AV ver 2.6c1 Prima versione con post-processore common
-- Allineamento con common ver. 2.6c1
-- 2024/02/23 AV ver 2.6c2 Rimossa chiamata funzione EgtGetSourceDir
-- Allineamento con common ver. 2.6c2
-- 2024/02/23 AV ver 2.6c3 Allineamento con common ver. 2.6c3
-- 2024/02/27 AV ver 2.6c4 Allineamento con common ver. 2.6c4. Aggiunto parametro 'SafeXRotAxes' per rotazione motosega con pezzi alti
-- 2024/02/29 AV ver 2.6c5 Allineamento con common ver. 2.6c5
-- 2024/03/04 AV ver 2.6c6 Modificato log con nome macchina
-- Allineamento con common ver. 2.6c6
-- 2024/03/09 DS ver 2.6c7 Migliorie alla geometria macchina e suo caricamento.
-- 2024/03/12 AV ver 2.6c8 Allineamento con common ver. 2.6c7.
-- 2024/03/28 DS ver 2.6c9 Modificata posizione supporto rinvio.
-- 2024/03/28 AV ver 2.6d1 Allineamento con common ver. 2.6c8
-- 2024/04/15 AV ver 2.6d2 Allineamento con common ver. 2.6d1
-- 2024/04/18 AV ver 2.6d3 Allineamento con common ver. 2.6d2
-- 2024/04/30 AV ver 2.6e1 Allineamento con common ver. 2.6e1
-- Aggiunta variabile WoodDensity per gestione WOOD_DENSITY
-- 2024/05/06 AV ver 2.6e2 Allineamento con common ver. 2.6e2
-- 2024/05/06 AV ver 2.6e3 Allineamento con common ver. 2.6e3
-- Aggiunte variabili MinJoin(xx) per gestione MIN_JOIN_(xx)
-- 2024/06/03 AV ver 2.6f1 Aggiunta funzione GetSetupInfo a BeamData per nuovo automatismo
-- 2024/06/13 LM ver 2.6f2 Aggiunta lettura NewTopC da offset Ts3
-- 2024/06/13 AV ver 2.6f3_Dev Per controllo NUM, se arco maggiore di 99999mm, si approssima con una retta.
-- 2024/07/03 AV ver 2.6g1 Allineamento con common ver. 2.6g1
-- 2024/07/04 LM ver 2.6g2 In MachData.ini aggiunto MIN_JOIN_SS
-- 2024/09/02 AV ver 2.6i1 Allineamento con common ver. 2.6i1, Rimossi file "Common-"
-- 2024/09/02 AV ver 2.6i2 Corretto file YML per compilare file "Common_"
-- 2024/09/05 LM ver 2.6i3 In BeamData aggiunte costanti MIN_HEIGHT_ADDED_CUTS, PRECUT_HEAD, PRECUT_TAIL
-- 2024/09/06 LM ver 2.6i4 In BeamData le costanti sopra sono configurabili anche da offsets Ts3v7
-- 2024/09/16 AV ver 2.6i5 Allineamento con common ver. 2.6i2
require( 'EmtGenerator')
EgtEnableDebug( false)
PP_VER = '2.6i11'
PP_NVER = '2.6.9.11'
MIN_MACH_VER = '2.5k1'
MACH_NAME = 'Essetre-FAST'
-- Carico i dati globali
local sMachDir = EgtGetCurrMachineDir()
-- Elimino direttori altre macchine e imposto direttorio macchina corrente per ricerca librerie
EgtRemoveBaseMachineDirFromPackagePath()
EgtAddToPackagePath( sMachDir .. '\\Beam\\?.lua')
EgtAddToPackagePath( sMachDir .. '\\?.lua')
local BD = require( 'BeamData')
local INFO_STD_PP = require( 'Version')
-- prendo la versione kernel minima necessaria più nuova tra macchina e script comuni
if INFO_STD_PP.MIN_MACH_VER_PP_COMMON > MIN_MACH_VER then
MIN_MACH_VER = INFO_STD_PP.MIN_MACH_VER_PP_COMMON
end
EgtOutLog ( '** ' .. MACH_NAME..' '..PP_VER..' ** ( '..INFO_STD_PP.NAME..': '..INFO_STD_PP.VERSION..' - MinMach: '.. MIN_MACH_VER ..') **', 1)
-- Parametri macchina
NumericalControl = 'TPA' -- NUM o TPA o NUM_PLUS
MinX = 0
MaxX = 1350
MinZ = -1350
MaxZ = 0
MinB = -180
MaxB = 360
MinC = -360
MaxC = 360
MinY = 110.0
MaxY = 3760.0
ParkY = 480.0
MinV = -3760.0
MaxV = -110.0
ParkV = -480.0
LoadT = 1454.2
UnloadT = -1700
MaxOpen = 305
MillOffs = 177.35
SawOffs = -242.68
SawBOffs = 0
SawCOffs = 0
ChSawLen = 90.0
AngTr1Offs = 170
AngTr1Len = 150
TurnerOffs = 200.0
DeltaTabY = 898.0
DeltaTabZ = -1017.8 + MillOffs -- per TPA : -1013.3 + MillOffs -- per NUM : -838.4
DimTabY = 400
DimTabX = 34000
LenToPress = 900
StartRotation = true
AutomaticRotation = true
AutoRotMinLen = 2600
DefTcPos = 'T2'
SecondSupport = 0
SpecialBH = false
MaxUnloadLen = 0
BeamHeightForFixRot = 9999 -- per abilitare assegnare 500
CoeffVM = 0.5
NewTopC = true
SafeXRotAxes = 150
-- leggo e aggiorno con parametri da BeamData
if BD then
BeamHeightForFixRot = BD.MAX_HEIGHT_ROT_B_ABOVE or BeamHeightForFixRot
end
-- Aggiornamento con dati da TechnoEssetre7
local sTs3Data = EgtGetStringFromIni( 'Beam', 'DATA_DIR', "C:\\TechnoEssetre7\\EgtData", EgtGetIniFile()).."\\Essetre-Fast.data"
local sData = sMachDir .. "\\Beam\\Ts3Data.lua"
if EgtExistsFile( sTs3Data) then
EgtCopyFile( sTs3Data, sData)
local sTs3DataOld = sTs3Data..'.old'
EgtEraseFile( sTs3DataOld)
EgtRenameFile( sTs3Data, sTs3DataOld)
end
if EgtExistsFile( sData) then
local Machine = dofile( sData)
if Machine then
if Machine.Offsets then
if Machine.Offsets.TIPO_CN == 0 then
NumericalControl = 'NUM'
elseif Machine.Offsets.TIPO_CN == 2 then
NumericalControl = 'NUM_PLUS'
else
NumericalControl = 'TPA'
end
if Machine.Offsets.MAX_X then MinX = - Machine.Offsets.MAX_X end
if Machine.Offsets.MIN_X then MaxX = - Machine.Offsets.MIN_X end
if Machine.Offsets.MIN_Z then MinZ = Machine.Offsets.MIN_Z end
if Machine.Offsets.MAX_Z then MaxZ = Machine.Offsets.MAX_Z end
if Machine.Offsets.MIN_B then MinB = Machine.Offsets.MIN_B end
if Machine.Offsets.MAX_B then MaxB = Machine.Offsets.MAX_B end
if Machine.Offsets.MIN_C then MinC = Machine.Offsets.MIN_C end
if Machine.Offsets.MAX_C then MaxC = Machine.Offsets.MAX_C end
MinY = Machine.Offsets.MIN_Y or Machine.Offsets.MINY or MinY
MaxY = Machine.Offsets.MAX_Y or Machine.Offsets.MAXY or MaxY
ParkY = Machine.Offsets.PARKYY or ParkY
MinV = Machine.Offsets.MIN_V or Machine.Offsets.MINV or MinV
MaxV = Machine.Offsets.MAX_V or Machine.Offsets.MAXV or MaxV
ParkV = Machine.Offsets.PARKVV or ParkV
if Machine.Offsets.YCARICO then LoadT = - Machine.Offsets.YCARICO end
if Machine.Offsets.YSCARICO then UnloadT = - Machine.Offsets.YSCARICO end
if Machine.Offsets.PIVOTFRESA then MillOffs = - Machine.Offsets.PIVOTFRESA end
if Machine.Offsets.PIVOTLAMA then SawOffs = - Machine.Offsets.PIVOTLAMA end
if Machine.Offsets.OFFSETBLAMA then SawBOffs = Machine.Offsets.OFFSETBLAMA end
if Machine.Offsets.OFFSETCLAMA then SawCOffs = Machine.Offsets.OFFSETCLAMA end
if Machine.Offsets.OFFSETZ_RINV_1 then AngTr1Offs = Machine.Offsets.OFFSETZ_RINV_1 - EgtIf( NumericalControl == 'TPA', MillOffs, 0) end
AngTr1Len = Machine.Offsets.OFFSETX_RINV_1 or AngTr1Len
--if Machine.Offsets.OFFSETZ_RINV_2 then AngTr2Offs = Machine.Offsets.OFFSETZ_RINV_2 - EgtIf( NumericalControl == 'TPA', MillOffs, 0) end
--AngTr2Len = Machine.Offsets.OFFSETX_RINV_2 or AngTr2Len
TurnerOffs = Machine.Offsets.OFFSETRIB or TurnerOffs
if Machine.Offsets.OFFSETX then DeltaTabY = - Machine.Offsets.OFFSETX end
if Machine.Offsets.OFFSETZ then DeltaTabZ = Machine.Offsets.OFFSETZ + EgtIf( NumericalControl == 'TPA', MillOffs, 0) end
if Machine.Offsets.SECSUP then SecondSupport = Machine.Offsets.SECSUP end
if Machine.Offsets.BLOCKHAUS then SpecialBH = ( Machine.Offsets.BLOCKHAUS == 1) end
if Machine.Offsets.RIB_AUTO then AutomaticRotation = ( Machine.Offsets.RIB_AUTO == 1) end
if Machine.Offsets.NOULOAD then MaxUnloadLen = Machine.Offsets.NOULOAD end
if Machine.Offsets.DEFTCPOS then DefTcPos = ( 'T' .. Machine.Offsets.DEFTCPOS) end
if Machine.Offsets.WOOD_DENSITY then WoodDensity = Machine.Offsets.WOOD_DENSITY end
if Machine.Offsets.MIN_JOIN_VV then MinJoinVV = Machine.Offsets.MIN_JOIN_VV end
if Machine.Offsets.MIN_JOIN_SS then MinJoinSS = Machine.Offsets.MIN_JOIN_SS end
if Machine.Offsets.MIN_JOIN_LS then MinJoinLS = Machine.Offsets.MIN_JOIN_LS end
if Machine.Offsets.MIN_JOIN_SL then MinJoinSL = Machine.Offsets.MIN_JOIN_SL 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
end
end
end
if SpecialBH then SecondSupport = 0 end
EmtGeneral {
File='Essetre-FAST.nge',
Offset = Vector3d( 0, 1150.16, -1500.0),
AxisMaxAdjust = 30,
AxisMaxRotAdj = 0.5,
ExitMaxAdjust = 30,
ExitMaxRotAdj = 0.5,
AngDeltaMinForHome = 165,
Special = 'Common_FAST.mlse',
Processor = 'Common_FAST.mlpe'}
local BaseId = EmtBase {
Name = 'Base',
Geo='BASE/GEO',
Aux={'BASE/SOLID', 'BASE/TC', 'BASE/SIGN', 'BASE/COLLISION'}}
local XId = EmtAxis {
Name = 'X',
Parent = 'Base',
Invert = true,
Type = MCH_AT.LINEAR,
Dir = Y_AX(),
Pos = Point3d( -639.5, 372.66, 945.7),
Stroke = {MinX, MaxX},
Home = 0,
Geo = 'X_AXIS/GEO',
Aux = 'X_AXIS/SOLID'}
EmtAxis {
Name = 'Z',
Parent = 'X',
Type = MCH_AT.LINEAR,
Dir = Z_AX(),
Pos = Point3d( -19.25, -113.54, 790.0),
Stroke = {MinZ, MaxZ},
Home = MaxZ,
Geo = 'Z_AXIS/GEO',
Aux = {'Z_AXIS/SOLID', 'Z_AXIS/COLLISION'}}
local CId = EmtAxis {
Name = 'C',
Parent = 'Z',
Type = MCH_AT.ROTARY,
Dir = Z_AX(),
Pos = Point3d( 0, 0, 0),
Stroke = {MinC, MaxC},
Home = 0,
Geo = 'C_AXIS/GEO',
Aux = {'C_AXIS/SOLID', 'C_AXIS/COLLISION'}}
if NewTopC then
local vtMove = Vector3d( 65,0,0)
local SolidArmId = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( CId, 'SOLID'), 'ARM')
if EgtSurfTmMoveFacet then
EgtSurfTmMoveFacet( SolidArmId, 11, vtMove, GDB_RT.GLOB)
else
EgtSurfTmMoveVertex( SolidArmId, 23, EgtSurfTmGetVertex( SolidArmId, 23, GDB_RT.GLOB) + vtMove, GDB_RT.GLOB)
EgtSurfTmMoveVertex( SolidArmId, 25, EgtSurfTmGetVertex( SolidArmId, 25, GDB_RT.GLOB) + vtMove, GDB_RT.GLOB)
EgtSurfTmMoveVertex( SolidArmId, 35, EgtSurfTmGetVertex( SolidArmId, 35, GDB_RT.GLOB) + vtMove, GDB_RT.GLOB)
EgtSurfTmMoveVertex( SolidArmId, 36, EgtSurfTmGetVertex( SolidArmId, 36, GDB_RT.GLOB) + vtMove, GDB_RT.GLOB)
end
local CollTopId = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( CId, 'COLLISION'), 'TOP')
EgtMove( CollTopId, vtMove, GDB_RT.GLOB)
EgtSetName( CollTopId, 'BOX')
else
local CollTopId = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( CId, 'COLLISION'), 'TOP')
EgtSetName( CollTopId, 'BOX')
end
EmtAxis {
Name = 'B',
Parent = 'C',
Type = MCH_AT.ROTARY,
Dir = X_AX(),
Pos = Point3d( 0, 0, MillOffs),
Stroke = {MinB, MaxB},
Home = 0,
Geo = 'B_AXIS/GEO',
Aux = {'B_AXIS/SOLID', 'B_AXIS/COLLISION'}}
-- Frese
local H1Id = EmtHead {
Name = 'H1',
Parent = 'B',
HSet = 'H1',
Type = MCH_HT.STD,
Pos = Point3d( 0, 0, 0),
TDir = Z_AX(),
ADir = X_AX(),
Rot1W = 2,
OthColl = {'H2', 'B/SOLID', 'C/SOLID'},
Geo = 'H1_HEAD/GEO'}
EgtSetInfo( H1Id, 'ZMAXONROT', '1,60')
if BeamHeightForFixRot < 1000 then
EgtSetInfo( H1Id, 'ROTATZMAX', '1')
end
-- Lama
local H2Id = EmtHead {
Name = 'H2',
Parent = 'B',
HSet = 'H2',
Type = MCH_HT.STD,
Pos = Point3d( 0, 0, ( MillOffs - SawOffs)),
TDir = VectorFromRotated( -Z_AX(), X_AX(), -SawBOffs),
ADir = X_AX(),
Rot1W = 0.2,
OthColl = {'H1', 'H3', 'B/SOLID', 'C/SOLID'},
Geo = 'H2_HEAD/GEO'}
EgtSetInfo( H2Id, 'ZMAXONROT', '1,5')
if BeamHeightForFixRot < 1000 then
EgtSetInfo( H2Id, 'ROTATZMAX', '1')
end
-- Sega a catena
EmtAxis {
Name = 'A',
Parent = 'B',
Token = '**',
Type = MCH_AT.ROTARY,
Dir = Z_AX(),
Pos = Point3d( 0, 0, 0),
Stroke = { 0, 270},
Home = 0,
Geo = 'A_AXIS/GEO'}
local H3Id = EmtHead {
Name = 'H3',
Parent = 'A',
HSet = 'H1',
Type = MCH_HT.STD,
Pos = Point3d( 0, 0, -ChSawLen),
TDir = X_AX(),
ADir = Z_AX(),
Rot1W = 0.2,
SolCh = MCH_SCC.ADIR_NEAR,
OthColl = {'H2', 'B/SOLID', 'C/SOLID'},
Geo = 'H3_HEAD/GEO'}
EgtSetInfo( H3Id, 'ZMAXONROT', '1,5')
if BeamHeightForFixRot < 1000 then
EgtSetInfo( H3Id, 'ROTATZMAX', '1')
end
-- Eventuale rinvio angolare
if SecondSupport >= 3 then
local H5Id = EmtHead {
Name = 'H5',
Parent = 'B',
HSet = 'H1',
Type = MCH_HT.MULTI,
ExitNbr = 2,
Pos1 = Point3d( 0, -AngTr1Len, -AngTr1Offs),
TDir1 = Y_AX(),
Pos2 = Point3d( 0, AngTr1Len, -AngTr1Offs),
TDir2 = -Y_AX(),
ADir = Z_AX(),
Rot1W = 0.2,
Rot2Stroke = { -120, 120},
OthColl = { 'H2', 'B/SOLID', 'C/SOLID'},
Geo = 'H5_HEAD/GEO',
Aux = {'H5_HEAD/SOLID', 'H5_HEAD/COLLISION'}}
EgtSetInfo( H5Id, 'AGB_TYPE', 2)
EgtSetInfo( H5Id, 'AGB_DMAX', 240)
EgtSetInfo( H5Id, 'AGB_ENCH', 44)
EgtSetInfo( H5Id, 'AGB_ENCV', 380)
EgtSetInfo( H5Id, 'AGB_MDIR', X_AX())
EgtSetInfo( H5Id, 'ZMAXONROT', '1,15')
end
-- Morse
local YId = EmtAxis {
Name = 'Y',
Parent = 'Base',
Type = MCH_AT.LINEAR,
Dir = -X_AX(),
Pos = Point3d( -953.0, 111.75, 1450.0),
Stroke = { MinY, MaxY},
Home = ParkY,
Geo = 'Y_AXIS/GEO',
Aux = {'Y_AXIS/SOLID', 'Y_AXIS/COLLISION'}}
local PYId = EmtAxis {
Name = 'PY',
Parent = 'Y',
Type = MCH_AT.LINEAR,
Dir = -Y_AX(),
Pos = Point3d( -904.0, -276.5, 1449.0),
Stroke = { 0, MaxOpen},
Home = MaxOpen,
Geo = 'PY_AXIS/GEO',
Aux = {'PY_AXIS/SOLID', 'PY_AXIS/COLLISION'}}
local VId = EmtAxis {
Name = 'V',
Parent = 'Base',
Type = MCH_AT.LINEAR,
Dir = -X_AX(),
Pos = Point3d( 953.0, 111.75, 1450.0),
Stroke = { MinV, MaxV},
Home = ParkV,
Geo = 'V_AXIS/GEO',
Aux = {'V_AXIS/SOLID', 'V_AXIS/COLLISION'}}
local PVId = EmtAxis {
Name = 'PV',
Parent = 'V',
Type = MCH_AT.LINEAR,
Dir = -Y_AX(),
Pos = Point3d( 904.0, -276.5, 1449.0),
Stroke = { 0, MaxOpen},
Home = MaxOpen,
Geo = 'PV_AXIS/GEO',
Aux = {'PV_AXIS/SOLID', 'PV_AXIS/COLLISION'}}
EmtAxis {
Name = 'T',
Parent = 'Base',
--Token = '**',
Type = MCH_AT.LINEAR,
Dir = - X_AX(),
Pos = Point3d( 0, 613.16, -830.037),
Stroke = { -30000, 30000},
Home = LoadT,
Geo = 'T_AXIS/GEO'}
EmtTable {
Name = 'Tab',
Parent = 'T',
Type = MCH_TT.FLAT,
Ref1 = Point3d( -DimTabX, DeltaTabY - DimTabY, DeltaTabZ),
Scale = { DimTabX / 20000, DimTabY / 400, 1},
Geo = 'TABLE/GEO',
Aux = 'TABLE/SOLID'}
-- ToolChanger
EmtTcPos {
Name = 'T1',
Parent = 'Base',
Pos = Point3d( 523.8, 88.0, 172.5),
TDir = -X_AX(),
ADir = -Y_AX(),
Geo = 'BASE/T1'}
EmtTcPos {
Name = 'T2',
Parent = 'Base',
Pos = Point3d( 523.8, 88.0, 67.5),
TDir = -X_AX(),
ADir = -Y_AX(),
Geo = 'BASE/T2'}
EmtTcPos {
Name = 'T3',
Parent = 'Base',
Pos = Point3d( 523.8, 88.0, -37.5),
TDir = -X_AX(),
ADir = -Y_AX(),
Geo = 'BASE/T3'}
EmtTcPos {
Name = 'T4',
Parent = 'Base',
Pos = Point3d( 523.8, 88.0, -142.5),
TDir = -X_AX(),
ADir = -Y_AX(),
Geo = 'BASE/T4'}
EmtTcPos {
Name = 'T5',
Parent = 'Base',
Pos = Point3d( 523.8, 88.0, -247.5),
TDir = -X_AX(),
ADir = -Y_AX(),
Geo = 'BASE/T5'}
EmtTcPos {
Name = 'T6',
Parent = 'Base',
Pos = Point3d( 523.8, 88.0, -352.5),
TDir = -X_AX(),
ADir = -Y_AX(),
Geo = 'BASE/T6'}
EmtTcPos {
Name = 'T7',
Parent = 'Base',
Pos = Point3d( 523.8, 88.0, -457.5),
TDir = -X_AX(),
ADir = -Y_AX(),
Geo = 'BASE/T7'}
EmtTcPos {
Name = 'T8',
Parent = 'Base',
Pos = Point3d( 523.8, 88.0, -562.5),
TDir = -X_AX(),
ADir = -Y_AX(),
Geo = 'BASE/T8'}
EmtTcPos {
Name = 'T9',
Parent = 'Base',
Pos = Point3d( 523.8, 88.0, -667.5),
TDir = -X_AX(),
ADir = -Y_AX(),
Geo = 'BASE/T9'}
EmtTcPos {
Name = 'T10',
Parent = 'Base',
Pos = Point3d( 523.8, 88.0, -772.5),
TDir = -X_AX(),
ADir = -Y_AX(),
Geo = 'BASE/T10'}
EmtTcPos {
Name = 'T11',
Parent = 'Base',
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',
Pos = Point3d( -510.4, 113.2, -160.8),
TDir = X_AX(),
ADir = Z_AX(),
Geo = 'BASE/T101'}
else
EmtTcPos {
Name = 'T101',
Parent = 'Base',
Pos = Point3d( -510.4, 113.2, -1160.8),
TDir = X_AX(),
ADir = Z_AX(),
Geo = 'BASE/T101S'}
end
if SecondSupport == 1 then
-- supporto per punta
EmtTcPos {
Name = 'T111',
Parent = 'Base',
Pos = Point3d( -510.4, 113.2, -329.8),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'BASE/T111'}
elseif SecondSupport == 2 then
-- supporto per mortasatrice
local TcpSsId = EmtTcPos {
Name = 'T111',
Parent = 'Base',
Pos = Point3d( -510.4, 113.2, -430.8),
TDir = X_AX(),
ADir = Z_AX(),
Geo = 'BASE/T111M'}
EgtSetInfo( TcpSsId, 'Mortiser', true)
elseif SecondSupport == 3 then
-- supporto per rinvio angolare
local TcpSsId = EmtTcPos {
Name = 'T91',
Parent = 'Base',
ExitNbr = 2,
Pos1 = Point3d( -710.4-150, 113.2, -329.8-170),
TDir1 = X_AX(),
Pos2 = Point3d( -710.4+150, 113.2, -329.8-170),
TDir2 = -X_AX(),
ADir = Z_AX(),
Geo = 'BASE/T91',
Aux = 'BASE/T91_HS'}
end
if SpecialBH then
EmtTcPos {
Name = 'T111',
Parent = 'Base',
Pos = Point3d( -810.4, 113.2, -329.8),
TDir = Y_AX(),
ADir = X_AX(),
Geo = 'BASE/T111S'}
end
-- Aggiusto posizioni geometriche
local vtMove = Vector3d( 0, ( DeltaTabY - 913.16), ( DeltaTabZ + 830.037))
local vtMoveX = Vector3d( 0, 0, ( DeltaTabZ + 830.037))
EgtMove( EgtGetFirstNameInGroup( BaseId, 'SOLID'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( BaseId, 'TC'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( BaseId, 'SIGN'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( BaseId, 'COLLISION'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( YId, 'SOLID'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( YId, 'COLLISION'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( PYId, 'SOLID'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( PYId, 'COLLISION'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( VId, 'SOLID'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( VId, 'COLLISION'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( PVId, 'SOLID'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( PVId, 'COLLISION'), vtMove, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( XId, 'SOLID'), vtMoveX, GDB_RT.GLOB)
-- Assegno identificativi alle spie delle morse
PYLightId = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( PYId, 'SOLID') or GDB_ID.NULL, 'Light')
PVLightId = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( PVId, 'SOLID') or GDB_ID.NULL, 'Light')
---------------------------------------------------------------------
-- Funzioni richiamate per modificare i dati macchina in casi particolari
--function OnSetTable()
--end
---------------------------------------------------------------------
function OnSetHead()
-- se testa lama
if EMC.HEAD == 'H2' then
EmtModifyAxisDirection( 'B', VectorFromRotated( X_AX(), Z_AX(), -SawCOffs))
-- altrimenti
else
EmtModifyAxisDirection( 'B', X_AX())
if EMC.HEAD == 'H3' then
local dDist = EgtIf( EMC.DIST and abs( EMC.DIST) > 1, EMC.DIST, ChSawLen)
EmtModifyExitPosition( EMC.HEAD, EMC.EXIT, Point3d( 0, 0, -dDist))
if not EMC.VER or EMC.VER < '2.5h2' then
local vtMove = Point3d( 0, 0, -dDist) - Point3d( EMC.EXITPOS)
local ExitId = EgtGetFirstNameInGroup( EgtGetHeadId( EMC.HEAD), 'T'..tostring( EMC.EXIT))
EgtMove( ExitId, vtMove)
end
end
end
end
---------------------------------------------------------------------
-- Funzione per impostare spia stato morsa carrello Y
function SetPYLight( bClosed)
if not PYLightId then return end
EgtSetColor( PYLightId, EgtIf( bClosed, 'RED', 'LIME'))
if bClosed then
EgtSetInfo( PYLightId, 'On', '1')
else
EgtRemoveInfo( PYLightId, 'On')
end
end
---------------------------------------------------------------------
-- Funzione per leggere lo stato della morsa carrello Y
function GetPYLight()
if not PYLightId then return false end
return ( EgtGetInfo( PYLightId, 'On') == '1')
end
---------------------------------------------------------------------
-- Funzione per impostare spia stato morsa carrello V
function SetPVLight( bClosed)
if not PVLightId then return end
EgtSetColor( PVLightId, EgtIf( bClosed, 'RED', 'LIME'))
if bClosed then
EgtSetInfo( PVLightId, 'On', '1')
else
EgtRemoveInfo( PVLightId, 'On')
end
end
---------------------------------------------------------------------
-- Funzione per leggere lo stato della morsa carrello V
function GetPVLight()
if not PVLightId then return false end
return ( EgtGetInfo( PVLightId, 'On') == '1')
end
---------------------------------------------------------------------
-- Funzione per resettare tutte le attivazioni della macchina
function OnResetMachine()
EmtUnlinkAllRawPartsFromGroups()
EmtUnlinkAllFixturesFromGroups()
SetPYLight( false)
SetPVLight( false)
-- nascondo Vmill
local nRawId = EgtGetFirstRawPart()
while nRawId do
local nVmId = EgtGetFirstNameInGroup( nRawId, 'VMill')
local nId = EgtGetFirstInGroup( nRawId)
while nId do
EgtSetStatus( nId, EgtIf( nId ~= nVmId, GDB_ST.ON, GDB_ST.OFF))
nId = EgtGetNext( nId)
end
nRawId = EgtGetNextRawPart( nRawId)
end
EgtSetStatus( EgtGetFirstNameInGroup( GDB_ID.ROOT, 'VMill') or GDB_ID.NULL, GDB_ST.OFF)
end