Files
Masterwood-TF600KST/Masterwood-TF600KST.mlde
luca.mazzoleni 6bcd42654a - cambio versione
2025-09-11 12:28:42 +02:00

377 lines
13 KiB
Plaintext

-- Descrizione macchina Masterwood TF600KST 2025/08/22
-- by EgalWare s.r.l.
require( 'EmtGenerator')
EgtEnableDebug( false)
PP_VER = '2.7i1'
MIN_MACH_VER = '2.7d2'
-- DATI MACCHINA --
NumericalControl = 'woodWOP'
COLL_SAFE_DIST = 3
-- DATI TAVOLA --
TabX = 0
TabY = 0
TabZ = 0
----------------------------------------------------
-------------------- CORSE ASSI --------------------
----------------------------------------------------
XAxisStroke = {-3000, 3000}
XAxisHome = 0
YAxisStroke = {-2000, 2000}
Z11AxisStroke = {-700, 700}
Z12AxisStroke = {-700, 700}
Z21AxisStroke = {-700, 700}
Z22AxisStroke = {-700, 700}
----------------------------------------------------
-------------------- DATI TESTE --------------------
----------------------------------------------------
-- testa 5 assi sopra
H11Pos = Vector3d( 0, 0, 0)
-- gruppo forare
H12PosX = 200
H12PosY = 0
H12PosZ = 0
H12Pos = H11Pos + Vector3d( H12PosX, H12PosY, H12PosZ)
-- teste gruppo a forare sopra
MDRILLTOP = { { Pos = H12Pos + Vector3d( 0, 0, 0), Ex=1, St=90}, -- uscita 1
{ Pos = H12Pos + Vector3d( 32, 0, 0), Ex=2, St=90}, -- uscita 2
{ Pos = H12Pos + Vector3d( 64, 0, 0), Ex=3, St=90}, -- uscita 3
{ Pos = H12Pos + Vector3d( 96, 0, 0), Ex=4, St=90}, -- uscita 4
{ Pos = H12Pos + Vector3d( 128, 0, 0), Ex=5, St=90}, -- uscita 5
{ Pos = H12Pos + Vector3d( 160, 0, 0), Ex=6, St=90}, -- uscita 6
{ Pos = H12Pos + Vector3d( 192, -32, 0), Ex=7, St=90}, -- uscita 7
{ Pos = H12Pos + Vector3d( 192, -64, 0), Ex=8, St=90}, -- uscita 8
{ Pos = H12Pos + Vector3d( 192, -96, 0), Ex=9, St=90}, -- uscita 9
{ Pos = H12Pos + Vector3d( 192, -160, 0), Ex=10, St=90}, -- uscita 10
{ Pos = H12Pos + Vector3d( 192, -192, 0), Ex=11, St=90}, -- uscita 11
{ Pos = H12Pos + Vector3d( 192, -224, 0), Ex=12, St=90}, -- uscita 12
{ Pos = H12Pos + Vector3d( 192, -256, 0), Ex=13, St=90}, -- uscita 13
{ Pos = H12Pos + Vector3d( 48, -80, 0), Ex=14, Tw=18, St=60}, -- uscita 14
{ Pos = H12Pos + Vector3d( 80, -80, 0), Ex=15, Tw=19, St=60}, -- uscita 15
{ Pos = H12Pos + Vector3d( 22, 96, 0), Ex=16, Tw=20, St=60}, -- uscita 16
{ Pos = H12Pos + Vector3d( 22, 64, 0), Ex=17, Tw=21, St=60}, -- uscita 17
{ Pos = H12Pos + Vector3d( 48, -186, 0), Ex=18, Tw=14, St=60}, -- uscita 18
{ Pos = H12Pos + Vector3d( 60, -186, 0), Ex=19, Tw=15, St=60}, -- uscita 19
{ Pos = H12Pos + Vector3d( 128, 96, 0), Ex=20, Tw=16, St=60}, -- uscita 20
{ Pos = H12Pos + Vector3d( 128, 64, 0), Ex=21, Tw=17, St=60} -- uscita 21
}
-- testa 5 assi sotto
H21Pos = Vector3d( 0, 0, 0)
-- teste gruppo a forare sotto
H22PosX = 200
H22PosY = 0
H22PosZ = 0
H22Pos = H21Pos + Vector3d( H22PosX, H22PosY, H22PosZ)
MDRILLBOTT = { { Pos = H22Pos + Vector3d( 0, 0, 0), Ex=1, St=90}, -- uscita 1 Z+ (dir Z-)
{ Pos = H22Pos + Vector3d( 32, 0, 0), Ex=2, St=90}, -- uscita 2 Z+ (dir Z-)
{ Pos = H22Pos + Vector3d( 64, 0, 0), Ex=3, St=90}, -- uscita 3 Z+ (dir Z-)
{ Pos = H22Pos + Vector3d( 0, 32, 0), Ex=4, St=90}, -- uscita 4 Z+ (dir Z-)
{ Pos = H22Pos + Vector3d( 32, 32, 0), Ex=5, St=90}, -- uscita 5 Z+ (dir Z-)
{ Pos = H22Pos + Vector3d( 64, 32, 0), Ex=6, St=90}, -- uscita 6 Z+ (dir Z-)
{ Pos = H22Pos + Vector3d( 0, 64, 0), Ex=7, St=90}, -- uscita 7 Z+ (dir Z-)
{ Pos = H22Pos + Vector3d( 32, 64, 0), Ex=8, St=90}, -- uscita 8 Z+ (dir Z-)
{ Pos = H22Pos + Vector3d( 64, 64, 0), Ex=9, St=90} -- uscita 9 Z+ (dir Z-)
}
----------------------------------------------------
----------------- DATI BANCALETTI ------------------
----------------------------------------------------
----------------------------------------------------------------------
EmtGeneral {
File='Masterwood-TF600KST.nge',
Offset = Vector3d( -1317.5,28.47,-826.5),
AxisMaxAdjust = 10,
ExitMaxAdjust = 20,
Special = 'Masterwood-TF600KST.mlse',
Processor = 'Masterwood-TF600KST.mlpe'}
EmtBase {
Name = 'Base',
Geo= 'BASE/GEO',
Aux= { 'BASE/SOLID'}}
-- Testa e TC
EmtAxis {
Name = 'X',
Parent = 'Base',
Token = 'X',
Type = MCH_AT.LINEAR,
Dir = X_AX(),
Pos = Point3d(0, 0, 0),
Stroke = XAxisStroke,
Home = XAxisHome,
Geo = 'X_AXIS/GEO',
Aux = 'X_AXIS/SOLID'}
EmtAxis {
Name = 'Y',
Parent = 'X',
Token = 'Y',
Type = MCH_AT.LINEAR,
Dir = Y_AX(),
Pos = Point3d(0, 0, 0),
Stroke = YAxisStroke,
Home = 2000,
Geo = 'Y_AXIS/GEO',
Aux = 'Y_AXIS/SOLID'}
EmtAxis {
Name = 'Z11',
Parent = 'Y',
Token = 'Z',
Type = MCH_AT.LINEAR,
Dir = Z_AX(),
Pos = Point3d(0, 0, 0),
Stroke = Z11AxisStroke,
Home = 650,
Geo = 'Z11_AXIS/GEO',
Aux = 'Z11_AXIS/SOLID'}
EmtHead {
Name = 'H11',
Parent = 'Z11',
HSet = 'H11',
Type = MCH_HT.STD,
Pos = H11Pos,
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'H11_HEAD/GEO'}
EmtAxis {
Name = 'Z12',
Parent = 'Y',
Token = 'Z',
Type = MCH_AT.LINEAR,
Dir = Z_AX(),
Pos = Point3d( 0, 0, 0),
Stroke = Z12AxisStroke,
Home = 400,
Geo = 'Z12_AXIS/GEO',
Aux = 'Z12_AXIS/SOLID'}
EmtHead {
Name = 'H12',
Parent = 'Z12',
HSet = 'H12',
Type = MCH_HT.MULTI,
SelType = MCH_SLT.MULTIEXITS,
ExitNbr = 21,
Pos1 = MDRILLTOP[1].Pos,
TDir1 = Z_AX(),
Pos2 = MDRILLTOP[2].Pos,
TDir2 = Z_AX(),
Pos3 = MDRILLTOP[3].Pos,
TDir3 = Z_AX(),
Pos4 = MDRILLTOP[4].Pos,
TDir4 = Z_AX(),
Pos5 = MDRILLTOP[5].Pos,
TDir5 = Z_AX(),
Pos6 = MDRILLTOP[6].Pos,
TDir6 = Z_AX(),
Pos7 = MDRILLTOP[7].Pos,
TDir7 = Z_AX(),
Pos8 = MDRILLTOP[8].Pos,
TDir8 = Z_AX(),
Pos9 = MDRILLTOP[9].Pos,
TDir9 = Z_AX(),
Pos10 = MDRILLTOP[10].Pos,
TDir10 = Z_AX(),
Pos11 = MDRILLTOP[11].Pos,
TDir11 = Z_AX(),
Pos12 = MDRILLTOP[12].Pos,
TDir12 = Z_AX(),
Pos13 = MDRILLTOP[13].Pos,
TDir13 = Z_AX(),
Pos14 = MDRILLTOP[14].Pos,
TDir14 = -Y_AX(),
Pos15 = MDRILLTOP[15].Pos,
TDir15 = -Y_AX(),
Pos16 = MDRILLTOP[16].Pos,
TDir16 = X_AX(),
Pos17 = MDRILLTOP[17].Pos,
TDir17 = X_AX(),
Pos18 = MDRILLTOP[18].Pos,
TDir18 = Y_AX(),
Pos19 = MDRILLTOP[19].Pos,
TDir19 = Y_AX(),
Pos20 = MDRILLTOP[20].Pos,
TDir20 = -X_AX(),
Pos21 = MDRILLTOP[21].Pos,
TDir21 = -X_AX(),
ADir = VectorFromPolar( 1, 45),
Geo = 'H12_HEAD/GEO',
Aux = {'H12_HEAD/SOLID', 'H12_HEAD/SOL_T1', 'H12_HEAD/SOL_T2', 'H12_HEAD/SOL_T3', 'H12_HEAD/SOL_T4', 'H12_HEAD/SOL_T5',
'H12_HEAD/SOL_T6', 'H12_HEAD/SOL_T7', 'H12_HEAD/SOL_T8', 'H12_HEAD/SOL_T9', 'H12_HEAD/SOL_T10', 'H12_HEAD/SOL_T11',
'H12_HEAD/SOL_T12', 'H12_HEAD/SOL_T13', 'H12_HEAD/SOL_T14', 'H12_HEAD/SOL_T15', 'H12_HEAD/SOL_T16', 'H12_HEAD/SOL_T17'}}
EmtAxis {
Name = 'Z21',
Parent = 'Y',
Token = 'Z',
Type = MCH_AT.LINEAR,
Dir = Z_AX(),
Pos = Point3d(0, 0, 0),
Stroke = Z21AxisStroke,
Home = -650,
Geo = 'Z21_AXIS/GEO',
Aux = 'Z21_AXIS/SOLID'}
local H21Id = EmtHead {
Name = 'H21',
Parent = 'Z21',
HSet = 'H21',
Type = MCH_HT.STD,
Pos = H21Pos,
TDir = -Z_AX(),
ADir = X_AX(),
Geo = 'H21_HEAD/GEO'}
EgtSetInfo( H21Id, 'ABOVE', 0)
EmtAxis {
Name = 'Z22',
Parent = 'Y',
Token = 'Z',
Type = MCH_AT.LINEAR,
Dir = Z_AX(),
Pos = Point3d( 0, 0, 0),
Stroke = Z22AxisStroke,
Home = -400,
Geo = 'Z22_AXIS/GEO',
Aux = 'Z22_AXIS/SOLID'}
local H22Id = EmtHead {
Name = 'H22',
Parent = 'Z22',
HSet = 'H22',
Type = MCH_HT.MULTI,
SelType = MCH_SLT.MULTIEXITS,
ExitNbr = 9,
Pos1 = MDRILLBOTT[1].Pos,
TDir1 = -Z_AX(),
Pos2 = MDRILLBOTT[2].Pos,
TDir2 = -Z_AX(),
Pos3 = MDRILLBOTT[3].Pos,
TDir3 = -Z_AX(),
Pos4 = MDRILLBOTT[4].Pos,
TDir4 = -Z_AX(),
Pos5 = MDRILLBOTT[5].Pos,
TDir5 = -Z_AX(),
Pos6 = MDRILLBOTT[6].Pos,
TDir6 = -Z_AX(),
Pos7 = MDRILLBOTT[7].Pos,
TDir7 = -Z_AX(),
Pos8 = MDRILLBOTT[8].Pos,
TDir8 = -Z_AX(),
Pos9 = MDRILLBOTT[9].Pos,
TDir9 = -Z_AX(),
ADir = -X_AX(),
Geo = 'H22_HEAD/GEO',
Aux = {'H22_HEAD/SOLID', 'H22_HEAD/SOL_T1', 'H22_HEAD/SOL_T2', 'H22_HEAD/SOL_T3', 'H22_HEAD/SOL_T4',
'H22_HEAD/SOL_T5', 'H22_HEAD/SOL_T6', 'H22_HEAD/SOL_T7', 'H22_HEAD/SOL_T8', 'H22_HEAD/SOL_T9'}}
EgtSetInfo( H22Id, 'ABOVE', 0)
-- Tavola
EmtTable {
Name = 'Tab',
Parent = 'Base',
Type = MCH_TT.FLAT,
Ref1 = {TabX, TabY, TabZ},
Geo = 'TABLE/GEO'}
---------------------------------------------------------------------
-- Funzioni richiamate per modificare i dati macchina in casi particolari
---------------------------------------------------------------------
function OnSetTable()
EgtSetTableAreaOffset( 100, 100, 100, 100)
end
---------------------------------------------------------------------
local function MoveGroup( nGrpId, vtVers, dPos, bLoc)
local dVal = EgtGetInfo( nGrpId, 'Val')
if not dVal then return end
if abs( dPos - dVal) > GEO.EPS_SMALL then
local nRT = EgtIf( bLoc, GDB_RT.LOC, GDB_RT.GLOB)
EgtMove( nGrpId, ( dPos - dVal) * vtVers, nRT)
EgtSetInfo( nGrpId, 'Val', dPos)
end
end
---------------------------------------------------------------------
function OnActivateDrillingUnit()
-- sistemo dati uscite attive
local vbExit = {}
for i = 1, #( EMC.DRACEX or {}) do
vbExit[EMC.DRACEX[i]] = true
end
if EgtGetName( EMC.HEADID) == 'H12' then
-- ciclo su tutte le uscite della testa
for nExit = 1, #MDRILLTOP do
-- eventuale gemello
local nTwin = MDRILLTOP[nExit].Tw or 0
-- nome e identificativo della geometria dell'uscita
local sExit = 'T' .. EgtNumToString( nExit, 0)
local nExitId = EgtGetFirstNameInGroup( EMC.HEADID, sExit)
-- recupero la geometria associata all'uscita
local sStem = 'SOL_' .. sExit
local nStemId = EgtGetFirstNameInGroup( EMC.HEADID, sStem)
-- determino la posizione
local dPos = EgtIf( vbExit[nExit] or vbExit[nTwin], 0, MDRILLTOP[nExit].St)
-- eseguo posizionamento
if nStemId then
MoveGroup( nStemId, Z_AX(), dPos)
end
MoveGroup( nExitId, Z_AX(), dPos)
end
end
if EgtGetName( EMC.HEADID) == 'H22' then
-- ciclo su tutte le uscite della testa
for nExit = 1, #MDRILLBOTT do
-- eventuale gemello
local nTwin = MDRILLBOTT[nExit].Tw or 0
-- nome e identificativo della geometria dell'uscita
local sExit = 'T' .. EgtNumToString( nExit, 0)
local nExitId = EgtGetFirstNameInGroup( EMC.HEADID, sExit)
-- recupero la geometria associata all'uscita
local sStem = 'SOL_' .. sExit
local nStemId = EgtGetFirstNameInGroup( EMC.HEADID, sStem)
-- determino la posizione
local dPos = EgtIf( vbExit[nExit] or vbExit[nTwin], 0, MDRILLBOTT[nExit].St)
-- eseguo posizionamento
if nStemId then
MoveGroup( nStemId, -Z_AX(), dPos)
end
MoveGroup( nExitId, -Z_AX(), dPos)
end
end
end
---------------------------------------------------------------------
function OnSetHead()
-- disabilito uscite del gruppo a forare da sopra (gestito con multiselezione)
EMC.HEADID = EgtGetHeadId( 'H12')
EMC.DRACEX = EgtIf( EMC.HEAD == 'H12', { EMC.EXIT}, nil)
OnActivateDrillingUnit()
-- gestisco uscite del gruppo a forare da sotto (gestito con selezione singola)
EMC.HEADID = EgtGetHeadId( 'H22')
EMC.DRACEX = EgtIf( EMC.HEAD == 'H22', { EMC.EXIT}, nil)
OnActivateDrillingUnit()
end
---------------------------------------------------------------------
-- Funzione per resettare tutte le attivazioni della macchina
function OnResetMachine()
EmtUnlinkAllRawPartsFromGroups()
-- 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