Prima versione macchina

This commit is contained in:
andrea.villa
2025-04-10 10:09:39 +02:00
parent a44f9f3914
commit 7695928900
21 changed files with 2403 additions and 93 deletions
+8
View File
@@ -0,0 +1,8 @@
/Tools
/Machinings
/SetUp
/Beam/CutData.lua
/Beam/DrillData.lua
/Beam/MillingData.lua
/Beam/PocketingData.lua
/Beam/SawingData.lua
Binary file not shown.
Binary file not shown.
Binary file not shown.
+61
View File
@@ -0,0 +1,61 @@
; Commento per evitare BOM con UTF-8
[General]
Material=Wood
[Tools]
Drillbit=1
Sawblade=1
Mill=1
Mortise=0
Chisel=0
DrillMaker=MakeWoodDrill.lua
SawbladeMaker=MakeSawblade.lua
MillMaker=MakeWoodCylMill.lua
ChiselMaker=MakeChisel.lua
[ToolHolder]
H11.1=HSK-F63_MillWeld12.nge
[Machinings]
Drilling=1
Sawing=1
Milling=1
Pocketing=1
Mortising=0
Chiseling=0
GenMachining=0
SurfRoughing=1
SurfFinishing=1
5AxMilling=1
[5AxMilling]
5AxScript1=5AxProject
5AxScript2=5AxPocketProject
5AxScript3=5AxCylProject
[Disposition]
InitScript=InitDisp.lua
[Fixtures]
HookTolerance = 100
Vac1=Vac125x75H100,12
Vac2=Vac115x160H100,12
Ref1=RefD22,12
[Heads]
; 5 axis head
H11=6608
; Gang drill
H21=6612
; Multi exit 4 aggr.
H22=6626
[SetUp]
Default=Std
[VMill]
Enable=1
[Estimations]
Enable=1
WinPlace=0,814,161,616,826
+591
View File
@@ -0,0 +1,591 @@
-- Descrizione macchina Homag Venture16L 2025/04/02
-- by EgalWare s.r.l.
require( 'EmtGenerator')
EgtEnableDebug( false)
PP_VER = '2.7d1'
MIN_MACH_VER = '2.7a1'
-- DATI MACCHINA --
NumericalControl = 'woodWOP'
-- DATI TAVOLA --
TabX = 0
TabY = 0
TabZ = 0
----------------------------------------------------
-------------------- CORSE ASSI --------------------
----------------------------------------------------
XAxisStroke = {-250, 4330}
XAxisHome = -250
YAxisStroke = {-445, 2000}
Z1AxisStroke = {-35, 670}
CAxisStroke = {-360, 720}
AAxisStroke = {-100, 100}
Z2AxisStroke = {-25, 400}
C2AxisStroke = {0, 90}
----------------------------------------------------
-------------------- DATI TESTE --------------------
----------------------------------------------------
-- testa 5 assi
H11Pos = Vector3d( 0, 0, 0)
-- gruppo forare
H21PosX = 159.860
H21PosY = -551.890
H21PosZ = 125.000
H21Pos = H11Pos + Vector3d( H21PosX, H21PosY, H21PosZ)
-- teste gruppo forare
MDRILL = { { Pos = H21Pos + Vector3d( 0, 0, 0), Ex=1, St=60}, -- uscita 1
{ Pos = H21Pos + Vector3d( -32, 0, 0), Ex=2, St=60}, -- uscita 2
{ Pos = H21Pos + Vector3d( -64, 0, 0), Ex=3, St=60}, -- uscita 3
{ Pos = H21Pos + Vector3d( -96, 0, 0), Ex=4, St=60}, -- uscita 4
{ Pos = H21Pos + Vector3d( -128, 0, 0), Ex=5, St=60}, -- uscita 5
{ Pos = H21Pos + Vector3d( -160, 0, 0), Ex=6, St=60}, -- uscita 6
{ Pos = H21Pos + Vector3d( -192, 0, 0), Ex=7, St=60}, -- uscita 7
{ Pos = H21Pos + Vector3d( -224, 0, 0), Ex=8, St=60}, -- uscita 8
{ Pos = H21Pos + Vector3d( -256, 0, 0), Ex=9, St=60}, -- uscita 9
{ Pos = H21Pos + Vector3d( -288, 0, 0), Ex=10, St=60}, -- uscita 10
{ Pos = H21Pos + Vector3d( -320, 0, 0), Ex=11, St=60}, -- uscita 11
{ Pos = H21Pos + Vector3d( -160, 32, 0), Ex=12, St=60}, -- uscita 12
{ Pos = H21Pos + Vector3d( -160, 64, 0), Ex=13, St=60}, -- uscita 13
{ Pos = H21Pos + Vector3d( -160, 96, 0), Ex=14, St=60}, -- uscita 14
{ Pos = H21Pos + Vector3d( -160, 128, 0), Ex=15, St=60}, -- uscita 15
{ Pos = H21Pos + Vector3d( -160, 160, 0), Ex=16, St=60}, -- uscita 16
{ Pos = H21Pos + Vector3d( -160, 192, 0), Ex=17, St=60} -- uscita 17
}
-- teste rinvio su gruppo a forare
H22Pos = H21Pos + Vector3d( -64, 96, -50)
MANGTR = { { Pos = H22Pos + Vector3d( 53.5, 0, 0), Ex=1, St=90}, -- uscita 1 X+ (dir X-)
{ Pos = H22Pos + Vector3d( 0, 55.5, 0), Ex=2, St=90}, -- uscita 2 Y+ (dir Y-)
{ Pos = H22Pos + Vector3d( -53.5, 0, 0), Ex=3, St=90}, -- uscita 3 X- (dir X+)
{ Pos = H22Pos + Vector3d( 0, -55.5, 0), Ex=4, St=90} -- uscita 4 Y- (dir Y+)
}
----------------------------------------------------
----------------- DATI BANCALETTI ------------------
----------------------------------------------------
----------------------------------------------------------------------
EmtGeneral {
File='Homag-Venture16L.nge',
Offset = Vector3d( -1317.5,28.47,-826.5),
AxisMaxAdjust = 10,
ExitMaxAdjust = 20,
Special = 'Homag-Venture16L.mlse',
Processor = 'Homag-Venture16L.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', 'X_AXIS/TC'}}
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 = 'Z1',
Parent = 'Y',
Token = 'Z',
Type = MCH_AT.LINEAR,
Dir = Z_AX(),
Pos = Point3d(0, 0, 0),
Stroke = Z1AxisStroke,
Home = 650,
Geo = 'Z1_AXIS/GEO',
Aux = 'Z1_AXIS/SOLID'}
EmtAxis {
Name = 'C',
Parent = 'Z1',
Token = 'C',
Type = MCH_AT.ROTARY,
Dir = Z_AX(),
Pos = Point3d(0, 0, 244),
Stroke = CAxisStroke,
Home = 0,
Geo = 'C_AXIS/GEO',
Aux = {'C_AXIS/SOLID'}}
EmtAxis {
Name = 'A',
Parent = 'C',
Token = 'A',
Type = MCH_AT.ROTARY,
Dir = Y_AX(),
Pos = Point3d( 0, 0, 135),
Stroke = AAxisStroke,
Home = 0,
Geo = 'A_AXIS/GEO',
Aux = {'A_AXIS/SOLID'}}
EmtHead {
Name = 'H11',
Parent = 'A',
HSet = 'H11',
Type = MCH_HT.STD,
Pos = H11Pos,
TDir = Z_AX(),
ADir = X_AX(),
OthColl = {'C/SOLID','A/SOLID'},
Geo = 'H11_HEAD/GEO'}
EmtAxis {
Name = 'Z2',
Parent = 'Y',
Token = 'Z',
Type = MCH_AT.LINEAR,
Dir = Z_AX(),
Pos = Point3d( 0, 0, 0),
Stroke = Z2AxisStroke,
Home = 400,
Geo = 'Z2_AXIS/GEO',
Aux = 'Z2_AXIS/SOLID'}
EmtHead {
Name = 'H21',
Parent = 'Z2',
HSet = 'H21',
Type = MCH_HT.MULTI,
SelType = MCH_SLT.MULTIEXITS,
ExitNbr = 17,
Pos1 = MDRILL[1].Pos,
TDir1 = Z_AX(),
Pos2 = MDRILL[2].Pos,
TDir2 = Z_AX(),
Pos3 = MDRILL[3].Pos,
TDir3 = Z_AX(),
Pos4 = MDRILL[4].Pos,
TDir4 = Z_AX(),
Pos5 = MDRILL[5].Pos,
TDir5 = Z_AX(),
Pos6 = MDRILL[6].Pos,
TDir6 = Z_AX(),
Pos7 = MDRILL[7].Pos,
TDir7 = Z_AX(),
Pos8 = MDRILL[8].Pos,
TDir8 = Z_AX(),
Pos9 = MDRILL[9].Pos,
TDir9 = Z_AX(),
Pos10 = MDRILL[10].Pos,
TDir10 = Z_AX(),
Pos11 = MDRILL[11].Pos,
TDir11 = Z_AX(),
Pos12 = MDRILL[12].Pos,
TDir12 = Z_AX(),
Pos13 = MDRILL[13].Pos,
TDir13 = Z_AX(),
Pos14 = MDRILL[14].Pos,
TDir14 = Z_AX(),
Pos15 = MDRILL[15].Pos,
TDir15 = Z_AX(),
Pos16 = MDRILL[16].Pos,
TDir16 = Z_AX(),
Pos17 = MDRILL[17].Pos,
TDir17 = Z_AX(),
ADir = X_AX(),
Geo = 'H21_HEAD/GEO',
Aux = {'H21_HEAD/SOLID', 'H21_HEAD/SOL_T1', 'H21_HEAD/SOL_T2', 'H21_HEAD/SOL_T3', 'H21_HEAD/SOL_T4', 'H21_HEAD/SOL_T5',
'H21_HEAD/SOL_T6', 'H21_HEAD/SOL_T7', 'H21_HEAD/SOL_T8', 'H21_HEAD/SOL_T9', 'H21_HEAD/SOL_T10', 'H21_HEAD/SOL_T11',
'H21_HEAD/SOL_T12', 'H21_HEAD/SOL_T13', 'H21_HEAD/SOL_T14', 'H21_HEAD/SOL_T15', 'H21_HEAD/SOL_T16', 'H21_HEAD/SOL_T17'}}
EmtAxis {
Name = 'C2',
Parent = 'Z2',
Token = 'C',
Type = MCH_AT.ROTARY,
Dir = Z_AX(),
Pos = H22Pos,
Stroke = C2AxisStroke,
Home = 0,
Geo = 'C2_AXIS/GEO',
Aux = {'C2_AXIS/SOLID'}}
EmtHead {
Name = 'H22',
Parent = 'C2',
HSet = 'H22',
Type = MCH_HT.MULTI,
SelType = MCH_SLT.FIXEDEXITS,
ExitNbr = 4,
Pos1 = MANGTR[1].Pos,
TDir1 = -X_AX(),
Pos2 = MANGTR[2].Pos,
TDir2 = -Y_AX(),
Pos3 = MANGTR[3].Pos,
TDir3 = X_AX(),
Pos4 = MANGTR[4].Pos,
TDir4 = Y_AX(),
ADir = Z_AX(),
Geo = 'H22_HEAD/GEO',
Aux = {'H22_HEAD/SOLID'}}
-- Tool Changer
local ptTcR = Point3d( 0, 2850, 526)
EmtTcPos {
Name = 'T1',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 0),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T1'}
EmtTcPos {
Name = 'T2',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 1),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T2'}
EmtTcPos {
Name = 'T3',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 2),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T3'}
EmtTcPos {
Name = 'T4',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 3),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T4'}
EmtTcPos {
Name = 'T5',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 4),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T5'}
EmtTcPos {
Name = 'T6',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 5),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T6'}
EmtTcPos {
Name = 'T7',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 6),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T7'}
EmtTcPos {
Name = 'T8',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 7),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T8'}
EmtTcPos {
Name = 'T9',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 8),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T9'}
EmtTcPos {
Name = 'T10',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 9),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T10'}
EmtTcPos {
Name = 'T11',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 10),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T11'}
EmtTcPos {
Name = 'T12',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 11),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T12'}
EmtTcPos {
Name = 'T13',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 12),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T13'}
EmtTcPos {
Name = 'T14',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 13),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T14'}
EmtTcPos {
Name = 'T15',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 14),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T15'}
EmtTcPos {
Name = 'T16',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 15),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T16'}
EmtTcPos {
Name = 'T17',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 16),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T17'}
EmtTcPos {
Name = 'T18',
Parent = 'X',
Pos = ptTcR + VectorFromSpherical( 362, 90, -90 + 20 * 17),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'X_AXIS/T18'}
-- Tavola
EmtTable {
Name = 'Tab',
Parent = 'Base',
Type = MCH_TT.FLAT,
Ref1 = {TabX, TabY, TabZ},
Geo = 'TABLE/GEO',
Aux = {'TABLE/SOLID', 'TABLE/FIXED1', 'TABLE/FIXED2'}}
-- bancaletti
local PL1Id = EmtAxis {
Name = 'PL1',
Parent = 'Tab',
Type = MCH_AT.LINEAR,
Dir = X_AX(),
Pos = Point3d(0, 0, 0),
Stroke = {80, 2755},
Home = 100,
Geo = 'PL1_AXIS/GEO',
Aux = {'PL1_AXIS/SOLID'}}
EgtSetInfo( PL1Id, 'MDist', 100)
EgtSetInfo( PL1Id, 'PDist', 100)
EgtSetInfo( PL1Id, 'Next', 'PL2')
EgtMove( PL1Id, Vector3d( -100, 0, 0), GDB_RT.GLOB)
local PL2Id = EmtAxis {
Name = 'PL2',
Parent = 'Tab',
Type = MCH_AT.LINEAR,
Dir = X_AX(),
Pos = Point3d(0, 0, 0),
Stroke = {280, 2955},
Home = 300,
Geo = 'PL2_AXIS/GEO',
Aux = {'PL2_AXIS/SOLID'}}
EgtSetInfo( PL2Id, 'MDist', 100)
EgtSetInfo( PL2Id, 'PDist', 100)
EgtSetInfo( PL2Id, 'Prev', 'PL1')
EgtSetInfo( PL2Id, 'Next', 'PL3')
EgtMove( PL2Id, Vector3d( -300, 0, 0), GDB_RT.GLOB)
local PL3Id = EmtAxis {
Name = 'PL3',
Parent = 'Tab',
Type = MCH_AT.LINEAR,
Dir = X_AX(),
Pos = Point3d(0, 0, 0),
Stroke = {480, 3155},
Home = 500,
Geo = 'PL3_AXIS/GEO',
Aux = {'PL3_AXIS/SOLID'}}
EgtSetInfo( PL3Id, 'MDist', 100)
EgtSetInfo( PL3Id, 'PDist', 100)
EgtSetInfo( PL3Id, 'Prev', 'PL2')
EgtSetInfo( PL3Id, 'Next', 'PL4')
EgtMove( PL3Id, Vector3d( -500, 0, 0), GDB_RT.GLOB)
local PL4Id = EmtAxis {
Name = 'PL4',
Parent = 'Tab',
Type = MCH_AT.LINEAR,
Dir = X_AX(),
Pos = Point3d(0, 0, 0),
Stroke = {680, 3355},
Home = 700,
Geo = 'PL4_AXIS/GEO',
Aux = {'PL4_AXIS/SOLID'}}
EgtSetInfo( PL4Id, 'MDist', 100)
EgtSetInfo( PL4Id, 'PDist', 100)
EgtSetInfo( PL4Id, 'Prev', 'PL3')
EgtSetInfo( PL4Id, 'Next', 'PL5')
EgtMove( PL4Id, Vector3d( -700, 0, 0), GDB_RT.GLOB)
local PL5Id = EmtAxis {
Name = 'PL5',
Parent = 'Tab',
Type = MCH_AT.LINEAR,
Dir = X_AX(),
Pos = Point3d(0, 0, 0),
Stroke = {880, 3555},
Home = 3535,
Geo = 'PL5_AXIS/GEO',
Aux = {'PL5_AXIS/SOLID'}}
EgtSetInfo( PL5Id, 'MDist', 100)
EgtSetInfo( PL5Id, 'PDist', 100)
EgtSetInfo( PL5Id, 'Prev', 'PL4')
EgtSetInfo( PL5Id, 'Next', 'PL6')
EgtMove( PL5Id, Vector3d( -900, 0, 0), GDB_RT.GLOB)
local PL6Id = EmtAxis {
Name = 'PL6',
Parent = 'Tab',
Type = MCH_AT.LINEAR,
Dir = X_AX(),
Pos = Point3d(0, 0, 0),
Stroke = {1080, 3755},
Home = 3735,
Geo = 'PL6_AXIS/GEO',
Aux = {'PL6_AXIS/SOLID'}}
EgtSetInfo( PL6Id, 'MDist', 100)
EgtSetInfo( PL6Id, 'PDist', 100)
EgtSetInfo( PL6Id, 'Prev', 'PL5')
EgtSetInfo( PL6Id, 'Next', 'PL7')
EgtMove( PL6Id, Vector3d( -1100, 0, 0), GDB_RT.GLOB)
local PL7Id = EmtAxis {
Name = 'PL7',
Parent = 'Tab',
Type = MCH_AT.LINEAR,
Dir = X_AX(),
Pos = Point3d(0, 0, 0),
Stroke = {1280, 3955},
Home = 3935,
Geo = 'PL7_AXIS/GEO',
Aux = {'PL7_AXIS/SOLID'}}
EgtSetInfo( PL7Id, 'MDist', 100)
EgtSetInfo( PL7Id, 'PDist', 100)
EgtSetInfo( PL7Id, 'Prev', 'PL6')
EgtSetInfo( PL7Id, 'Next', 'PL8')
EgtMove( PL7Id, Vector3d( -1300, 0, 0), GDB_RT.GLOB)
local PL8Id = EmtAxis {
Name = 'PL8',
Parent = 'Tab',
Type = MCH_AT.LINEAR,
Dir = X_AX(),
Pos = Point3d(0, 0, 0),
Stroke = {1480, 4155},
Home = 4135,
Geo = 'PL8_AXIS/GEO',
Aux = {'PL8_AXIS/SOLID'}}
EgtSetInfo( PL8Id, 'MDist', 100)
EgtSetInfo( PL8Id, 'PDist', 100)
EgtSetInfo( PL8Id, 'Prev', 'PL7')
EgtMove( PL8Id, Vector3d( -1500, 0, 0), GDB_RT.GLOB)
---------------------------------------------------------------------
-- 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()
-- assegno dati testa
local nHeadId = EMC.HEADID
-- sistemo dati uscite attive
local vbExit = {}
for i = 1, #( EMC.DRACEX or {}) do
vbExit[EMC.DRACEX[i]] = true
end
-- ciclo su tutte le uscite della testa
for nExit = 1, #MDRILL do
-- eventuale gemello
local nTwin = MDRILL[nExit].Tw or 0
-- nome e identificativo della geometria dell'uscita
local sExit = 'T' .. EgtNumToString( nExit, 0)
local nExitId = EgtGetFirstNameInGroup( nHeadId, sExit)
-- recupero la geometria associata all'uscita
local sStem = 'SOL_' .. sExit
local nStemId = EgtGetFirstNameInGroup( nHeadId, sStem)
-- determino la posizione
local dPos = EgtIf( vbExit[nExit] or vbExit[nTwin], 0, MDRILL[nExit].St)
-- eseguo posizionamento
if nStemId then
MoveGroup( nStemId, Z_AX(), dPos)
end
MoveGroup( nExitId, Z_AX(), dPos)
end
end
---------------------------------------------------------------------
function OnActivateAngTransm()
-- assegno dati testa
local nHeadId = EMC.HEADID
-- determino la posizione
local dPos = EgtIf( EMC.ACTIVE, 0, MANGTR[1].St)
local nSolidId = EgtGetFirstNameInGroup( nHeadId, 'SOLID')
if nSolidId then
MoveGroup( nSolidId, Z_AX(), dPos)
end
-- ciclo su tutte le uscite della testa
for nExit = 1, #MANGTR do
-- nome e identificativo della geometria dell'uscita
local sExit = 'T' .. EgtNumToString( nExit, 0)
local nExitId = EgtGetFirstNameInGroup( nHeadId, sExit)
-- eseguo posizionamento
MoveGroup( nExitId, Z_AX(), dPos)
end
end
---------------------------------------------------------------------
function OnSetHead()
EMC.HEADID = EgtGetHeadId( 'H21')
EMC.DRACEX = nil
OnActivateDrillingUnit()
EMC.HEADID = EgtGetHeadId( 'H22')
EMC.ACTIVE = ( EMC.HEAD == 'H22')
OnActivateAngTransm()
end
---------------------------------------------------------------------
-- Funzione per resettare tutte le attivazioni della macchina
function OnResetMachine()
EmtUnlinkAllRawPartsFromGroups()
EmtUnlinkAllFixturesFromGroups()
-- 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
+764
View File
@@ -0,0 +1,764 @@
-- Processore macchina Homag Venture16L 2025/03/30
-- by EgalWare s.r.l.
--
-- Intestazioni
require( 'EmtGenerator')
EgtEnableDebug( false)
---------------------------------------------------------------------
-- *** GENERATION ***
---------------------------------------------------------------------
local sBaseDir = EgtGetCurrMachineDir()
if NumericalControl == 'woodWOP' then
dofile( sBaseDir .. '\\Homag-woodWOP.mlpe')
else
EmtSetLastError( 1201, 'Numerical Control error : unkwnown type')
end
---------------------------------------------------------------------
-- *** SIMULATION ***
---------------------------------------------------------------------
---------------------------------------------------------------------
function OnSimulStart()
-- controllo versione programma
if not EMT.VER or EMT.VER < MIN_MACH_VER then
EmtSetLastError( 1200, 'A newer version of the program is required (minimum EgtMachKernel '..MIN_MACH_VER..')')
end
-- Carico gli utensili sulle barre portautensili
local vTcPos = EgtGetAllTcPosNames()
if vTcPos then
for i = 1, #vTcPos do
local vTools = EgtGetToolsInCurrSetupPos( vTcPos[i])
for j = 1, #( vTools or {}) do
if vTools[j] ~= '' then
EgtLoadTool( vTcPos[i], j, vTools[j])
end
end
ShowToolInTcPos( vTcPos[i], true)
end
end
-- Se reset o home, esco
if EMT.SIM1ST then return end
-- Creo o svuoto gruppo per copia finale degli oggetti virtual milling
local nVmGrpId = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'VMill')
if nVmGrpId then
EgtSetStatus( nVmGrpId, GDB_ST.ON)
EgtEmptyGroup( nVmGrpId)
else
nVmGrpId = EgtGroup( GDB_ID.ROOT)
EgtSetName( nVmGrpId, 'VMill')
EgtSetLevel( nVmGrpId, GDB_LV.TEMP)
end
-- Preparo lista oggetti da verificare per collisioni
EMT.COLLOBJ = {}
AddToCollisionCheck( 'C', 'COLLISION', EMT.COLLOBJ)
AddToCollisionCheck( 'A', 'COLLISION', EMT.COLLOBJ)
DumpCollisionCheck( EMT.COLLOBJ, 'Collision Objects :', 4)
-- Preparo lista solidi macchina con cui possono collidere gli oggetti sopra riportati (in aggiunta a VMill)
EMT.MCODET = {}
local McdData = { { Grp = 'PL1', Sub = 'COLLISION', Name = 'STM'},
{ Grp = 'PL2', Sub = 'COLLISION', Name = 'STM'},
{ Grp = 'PL3', Sub = 'COLLISION', Name = 'STM'},
{ Grp = 'PL4', Sub = 'COLLISION', Name = 'STM'},
{ Grp = 'PL5', Sub = 'COLLISION', Name = 'STM'},
{ Grp = 'PL6', Sub = 'COLLISION', Name = 'STM'}}
EgtOutLog( 'MCODET Objects :', 4)
local nMcdNullCnt = 0
for i = 1, #McdData do
local nGrpId
if McdData[i].Grp == 'Base' then
nGrpId = EgtGetBaseId( 'Base')
else
nGrpId = EgtGetAxisId( McdData[i].Grp)
end
local nId = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( nGrpId or GDB_ID.NULL, McdData[i].Sub) or GDB_ID.NULL, 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)
else
nMcdNullCnt = nMcdNullCnt + 1
EgtOutLog( 'Element ' .. McdData[i].Grp .. '/' .. McdData[i].Sub .. '/' .. McdData[i].Name .. ' is null', 4)
end
end
if nMcdNullCnt > 0 then
EgtOutLog( 'Warning : MCODET with one or more null Element(s) ')
end
-- Preparo lista collisioni vuota
EMT.COLLIDE = {}
end
---------------------------------------------------------------------
function OnSimulEnd()
-- posizioni home degli assi testa
local HomeX = EgtGetAxisHomePos( 'X')
local HomeY = EgtGetAxisHomePos( 'Y')
local HomeZ1 = EgtGetAxisHomePos( 'Z1')
local HomeC = EgtGetAxisHomePos( 'C')
local HomeA = EgtGetAxisHomePos( 'A')
SimulMoveAxes( 'X', HomeX, MCH_SIM_STEP.RAPID, 'Y', HomeY, MCH_SIM_STEP.RAPID,'Z1', HomeZ1, MCH_SIM_STEP.RAPID, 'A', HomeA, MCH_SIM_STEP.COLLROT, 'C', HomeC, MCH_SIM_STEP.COLLROT)
end
---------------------------------------------------------------------
function OnSimulDispositionStart()
EMT.OPEISDISP = true
-- se non esiste la lista con le info dei pezzi, la creo
if not EMT.PIECES or EMT.PHASE > 1 then
EMT.PIECES = {}
end
-- recupero tutte le info dei pezzi, dimensioni e posizione
local nPartRawId = EgtGetFirstRawPart()
while nPartRawId do
local vPiece = {}
-- recupero il solido
local nSolId = EgtGetFirstNameInGroup( nPartRawId, 'RawSolid')
local b3Raw = EgtGetBBoxGlob( nSolId, GDB_BB.STANDARD)
vPiece.Id = nPartRawId
vPiece.IdPiece = EgtGetFirstPartInRawPart( nPartRawId)
vPiece.SolId = nSolId
vPiece.Len = b3Raw:getDimX()
vPiece.Wid = b3Raw:getDimY()
vPiece.Thk = b3Raw:getDimZ()
vPiece.Offs = b3Raw:getMin() -- offset rispetto a zero
vPiece.Area = vPiece.Len * vPiece.Wid + vPiece.Len * vPiece.Thk + vPiece.Wid * vPiece.Thk
table.insert( EMT.PIECES, vPiece)
nPartRawId = EgtGetNextRawPart( nPartRawId)
end
-- Se prima disposizione
if EMT.PHASE == 1 then
-- Determino dimensioni del grezzo
local nSolId = EgtGetFirstNameInGroup( EgtGetFirstRawPart() or GDB_ID.NULL, 'RawSolid') or GDB_ID.NULL
local b3Sol = EgtGetBBoxGlob( nSolId, GDB_BB.STANDARD)
EMT.LB = 0
EMT.SB = 0
EMT.HB = 0
if b3Sol then
EMT.LB = b3Sol:getDimX()
EMT.SB = b3Sol:getDimY()
EMT.HB = b3Sol:getDimZ()
end
-- Carico primo utensile sulla testa 1
local sTool, nTlen = FindFirstToolOnHead( 'H11')
if sTool then
EMT.TOOL_1 = sTool
else
EMT.TOOL_1 = GetDefaultToolName()
end
EgtLoadTool( 'H11', 1, EMT.TOOL_1)
EMT.TCPOS_1 = GetToolTcPos( EMT.TOOL_1)
ShowToolInTcPos( EMT.TCPOS_1, false)
EMT.LOAD = true
-- Se vero inizio e abilitato creo gli Zmap
EMT.VMILL = {}
if not EMT.SIM1ST and EgtGetInfo( EgtGetCurrMachGroup(), 'Vm', 'b') then
for i = 1, #EMT.PIECES do
-- elimino eventuale vecchio Zmap
EgtErase( EgtGetFirstNameInGroup( EMT.PIECES[i].Id, 'VMill') or GDB_ID.NULL)
-- recupero il solido
local nPartSolId = EgtGetFirstNameInGroup( EMT.PIECES[i].Id, 'RawSolid')
local b3PartSol = EgtGetBBoxGlob( nPartSolId, GDB_BB.STANDARD)
-- determino la risoluzione dello Zmap
local dTol = 4.71
if EmtGetVMillStep then
dTol = EmtGetVMillStep( b3PartSol:getDimX(), b3PartSol:getDimY(), b3PartSol:getDimZ(), 4.71)
else
local dArea = b3PartSol:getDimX() * b3PartSol:getDimY() + b3PartSol:getDimX() * b3PartSol:getDimZ() + b3PartSol:getDimY() * b3PartSol:getDimZ()
if dArea < 0.075e6 then
dTol = 0.71
elseif dArea < 0.15e6 then
dTol = 1.01
elseif dArea < 0.3e6 then
dTol = 1.51
elseif dArea < 0.6e6 then
dTol = 1.97
elseif dArea < 1.2e6 then
dTol = 2.81
elseif dArea < 2.4e6 then
dTol = 3.77
end
end
-- creo lo Zmap
local VMillId = EgtVolZmapBox( EMT.PIECES[i].Id, EMT.PIECES[i].Offs, EMT.PIECES[i].Len, EMT.PIECES[i].Wid, EMT.PIECES[i].Thk, dTol, true, GDB_RT.GLOB)
if VMillId then
EgtSetName( VMillId, 'VMill')
EgtSetLevel( VMillId, GDB_LV.TEMP)
EgtSetColor( VMillId, EgtGetColor( nSolId), false)
-- nascondo le altre geometrie
local nId = EgtGetFirstInGroup( EMT.PIECES[i].Id)
while nId do
if nId ~= VMillId then
EgtSetStatus( nId, GDB_ST.OFF)
end
nId = EgtGetNext( nId)
end
table.insert( EMT.VMILL, VMillId)
end
end
-- se vero inizio, assegno solidi per verifica collisione
if not EMT.SIM1ST then
EMT.CODET = {}
for i = 1, #( EMT.MCODET or {}) do
EMT.CODET[i] = EMT.MCODET[i]
end
for i = 1, #( EMT.VMILL or {}) do
table.insert( EMT.CODET, EMT.VMILL[i])
end
end
end
-- fasi successive
else
EMT.LOAD = false
end
-- nascondo lavorazioni che risulterebbero in posizione diversa dai pezzi
local nMchId = EgtGetNextOperation( EgtGetPhaseDisposition( EMT.PHASE))
while nMchId do
if EgtGetOperationPhase( nMchId) ~= EMT.PHASE then break end
EgtSetOperationStatus( nMchId, false)
nMchId = EgtGetNextOperation( nMchId)
end
end
---------------------------------------------------------------------
function OnSimulDispositionEnd()
-- Se prima disposizione
if EMT.PHASE == 1 then
-- Se vero inizio e abilitato creo gli Zmap
EMT.VMILL = {}
if not EMT.SIM1ST and EgtGetInfo( EgtGetCurrMachGroup(), 'Vm', 'b') then
local nRawId = EgtGetFirstRawPart()
while nRawId do
if EgtVerifyRawPartPhase( nRawId, 1) then
-- elimino eventuale vecchio Zmap
EgtErase( EgtGetFirstNameInGroup( nRawId, 'VMill') or GDB_ID.NULL)
-- recupero il solido
local nSolId = EgtGetFirstNameInGroup( nRawId, 'RawSolid')
-- determino la risoluzione dello Zmap
local b3Sol = EgtGetBBoxGlob( nSolId, GDB_BB.STANDARD)
local dTol = EmtGetVMillStep( b3Sol:getDimX(), b3Sol:getDimY(), b3Sol:getDimZ(), 2.01)
-- creo lo Zmap
local VMillId = EgtVolZmapFromSurfTm( nRawId, nSolId, dTol, true)
if VMillId then
EgtSetName( VMillId, 'VMill')
EgtSetLevel( VMillId, GDB_LV.TEMP)
EgtSetColor( VMillId, EgtGetColor( nSolId), false)
-- nascondo le altre geometrie
local nId = EgtGetFirstInGroup( nRawId)
while nId do
if nId ~= VMillId then
EgtSetStatus( nId, GDB_ST.OFF)
end
nId = EgtGetNext( nId)
end
table.insert( EMT.VMILL, VMillId)
end
end
nRawId = EgtGetNextRawPart( nRawId)
end
end
end
EMT.OPEISDISP = false
end
---------------------------------------------------------------------
function OnSimulToolSelect()
-- carico utensile, con breve pausa
EgtPause( 100)
EgtOutText( '')
-- lo nascondo sul portautensili
ShowToolInTcPos( EMT.TCPOS, false)
-- se attivo Vmill
if EMT.VMILL then
EmtSetToolForVmill( EMT.TOOL, EMT.HEAD, EMT.EXIT, EMT.VMILL)
end
-- se attivo Collision Check
EMT.SAFEDIST = COLL_SAFE_DIST
if EMT.COLLOBJ then
for i, Coll in ipairs( EMT.COLLOBJ) do
EmtAddCollisionObjEx( i, Coll.Fr, Coll.Ty, Coll.Mv, Coll.P1, Coll.P2, Coll.P3)
end
if EMT.HEAD ~= 'H2' then
AddToolToCollisionObj( EMT.TOOL, EMT.HEAD, EMT.EXIT, 1001)
AddToolHolderToCollisionObj( EMT.TOOL, EMT.HEAD, EMT.EXIT, 1002)
else
AddToolToCollisionObj( nil, 'H1', 1, 1001)
AddToolHolderToCollisionObj( nil, 'H1', 1, 1002)
end
end
end
---------------------------------------------------------------------
function OnSimulToolDeselect()
-- se utensile non cambia e non è sega a catena, esco
if EMT.NEXTTOOL == EMT.PREVTOOL then return end
-- deposito utensile
EgtOutText( 'Tool change in progress...')
if EMT.HEAD == 'H11' then
SimulMoveAxis( 'Z1', 650, MCH_SIM_STEP.RAPID)
SimulMoveAxes( 'Y', 2000, MCH_SIM_STEP.RAPID, 'A', 0, MCH_SIM_STEP.RAPROT, 'C', 0, MCH_SIM_STEP.RAPROT)
-- visualizzo utensile su TcPos
ShowToolInTcPos( EMT.PREVTCPOS, true)
-- nascondo l'utensile sulla testa
EgtSetMode( EgtGetHeadId( EMT.PREVHEAD or '') or GDB_ID.NULL, GDB_MD.HIDDEN)
elseif EMT.NEXTHEAD == 'H11' then
SimulMoveAxis( 'Z2', 400, MCH_SIM_STEP.RAPID)
SimulMoveAxis( 'Y', 2000, MCH_SIM_STEP.RAPID)
end
end
---------------------------------------------------------------------
function OnSimulMachiningStart()
EMT.MCHTYPE = EgtGetMachiningParam( MCH_MP.TYPE)
EMT.MCHNAME = EgtGetMachiningParam(MCH_MP.NAME)
EMT.NOTES = EgtGetMachiningParam( MCH_MP.USERNOTES)
EMT.VMRS = ( EMT.MCHTYPE ~= MCH_MY.DRILLING and EgtGetValInNotes( EMT.NOTES or '', 'VMRS', 'i') ~= 0)
end
---------------------------------------------------------------------
function OnSimulMachiningEnd()
EMT.PREVTOOL = EMT.TOOL
EMT.PREVHEAD = EMT.HEAD
EMT.PREVTCPOS = EMT.TCPOS
end
---------------------------------------------------------------------
function OnSimulPathStart()
if EMT.HEAD == 'H21' then
-- attivazione uscite
EMC = { HEADID = EgtGetHeadId( 'H21'), DRACEX = EMT.DRACEX}
OnActivateDrillingUnit()
EMC = nil
-- impostazione utensili aggiuntivi per Vmill
if EMT.VMILL then
for i = 1, #( EMT.DRACEX or {}) do
local nExit = EMT.DRACEX[i]
local sTool = EgtGetLoadedTool( EMT.HEAD, nExit)
if i == 1 then
EmtSetToolForVmill( sTool, EMT.HEAD, nExit, EMT.VMILL)
else
EmtAddToolForVmill( sTool, EMT.HEAD, nExit, EMT.VMILL)
end
end
end
elseif EMT.HEAD == 'H22' then
-- attivazione testa
EMC = { HEADID = EgtGetHeadId( 'H22'), ACTIVE = true}
OnActivateAngTransm()
end
end
---------------------------------------------------------------------
function OnSimulPathEnd()
if EMT.VMILL and #EMT.VMILL > 0 and not EMT.OPEISDISP and EMT.VMRS then
-- elimino eventuali sfridi
for j = 1, #EMT.VMILL do
local vMillId = EMT.VMILL[j]
local nPart = EgtVolZmapPartCount( vMillId)
if nPart > 1 then
-- ricerca del pezzo con massimo volume
local nPartMax = 0
local dVolMax = 0
for i = 1, nPart do
local dVol = EgtVolZmapPartVolume( vMillId, i - 1)
if dVol > dVolMax then
dVolMax = dVol
nPartMax = i
end
end
-- eliminazione di tutti i pezzi piccoli
for i = nPart, 1, -1 do
if i ~= nPartMax then
EgtRemoveVolZmapPart( vMillId, i - 1)
end
end
end
end
EgtDraw()
end
end
---------------------------------------------------------------------
function OnSimulMoveStart()
end
---------------------------------------------------------------------
function OnSimulMoveEnd()
end
---------------------------------------------------------------------
function OnSimulCollision()
-- se prima collisione della lavorazione, la segnalo
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 = ''
if EMT.SIMCOBIND == 1001 then
Class = 'T_H1'
elseif EMT.SIMCOBIND == 1002 then
Class = 'TH_H1'
else
Class = EMT.COLLOBJ[EMT.SIMCOBIND].Cl
end
table.insert( EMT.COLLIDE, { Mc = EMT.MCHNAME, Cl = Class, Vm = EMT.SIMVMID})
EMT.LAST_MCHNAME_COLLIDE = EMT.MCHNAME
EMT.ERR = 1
local sErr = 'CUTID='..tostring( EMT.CUTID)..'; TASKID='..tostring( EMT.TASKID)..'; Mach='..EMT.MCHNAME..'; Class='..Class..'; VMill='..EMT.SIMVMID
EmtSetLastError( 1221, sErr, true)
EgtOutLog( 'Collision : ' .. sErr, 1)
end
end
---------------------------------------------------------------------
-- *** GENERAL ***
---------------------------------------------------------------------
function FindFirstToolOnHead( sH1)
-- salvo stato iniziale
local CurrMachId = EgtGetCurrMachining()
local CurrTool = EgtTdbGetCurrToolParam( MCH_TP.NAME)
-- cerco lavorazione con utensile su testa indicata
local sTool, nTlen
local OpId = EgtGetFirstActiveOperation()
while OpId do
local nType = EgtGetOperationType( OpId)
if nType ~= MCH_OY.NONE and nType ~= MCH_OY.DISP then
if EgtSetCurrMachining( OpId) then
local sTest = EgtGetMachiningParam( MCH_MP.TOOL)
if EgtTdbSetCurrTool( sTest) then
local sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
if sHead and ( sHead == sH1) then
sTool = sTest
nTlen = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
break
end
end
end
end
OpId = EgtGetNextActiveOperation( OpId)
end
-- ripristino stato iniziale
if CurrMachId then
EgtSetCurrMachining( CurrMachId)
else
EgtResetCurrMachining()
end
if CurrTool then
EgtTdbSetCurrTool( CurrTool)
else
EgtTdbSetCurrTool( '')
end
-- restituisco risultato
return sTool, nTlen
end
---------------------------------------------------------------------
function ShowToolInTcPos( sTcPos, bShow)
-- recupero identificativo della posizione sul TC
local TcPosId = EgtGetTcPosId( sTcPos or '')
if not TcPosId then return end
-- ciclo sulle possibili uscite
for i = 1, 100 do
-- recupero il gruppo dell'utensile
local TcExitId = EgtGetFirstNameInGroup( TcPosId, 'T'..tostring( i))
if not TcExitId then break end
-- imposto lo stato di visualizzazione
EgtSetStatus( TcExitId, EgtIf( bShow, GDB_ST.ON, GDB_ST.OFF))
end
-- recupero eventuale gruppo ausiliario da visualizzare/nascondere
local TcHSId = EgtGetFirstNameInGroup( TcPosId, sTcPos..'_HS')
if TcHSId then EgtSetStatus( TcHSId, EgtIf( bShow, GDB_ST.ON, GDB_ST.OFF)) end
end
---------------------------------------------------------------------
function GetDefaultToolName()
local DefTcPos = 'T1'
local vTools = EgtGetToolsInCurrSetupPos( DefTcPos)
if vTools and vTools[1] and #vTools[1] > 0 then
return vTools[1]
else
-- local sErr = 'Missing tool in Default Position ' .. DefTcPos
-- EgtOutLog( 'Error : ' .. sErr)
-- EgtOutBox( sErr, 'ERROR', 'ERROR')
return ''
end
end
---------------------------------------------------------------------
function GetToolTcPos( sTool)
-- salvo stato iniziale
local CurrTool = EgtTdbGetCurrToolParam( MCH_TP.NAME)
-- recupero la posizione di cambio utensile dell'utensile indicato
local sTcPos
if EgtTdbSetCurrTool( sTool) then
sTcPos = EgtTdbGetCurrToolParam( MCH_TP.TCPOS)
end
-- ripristino stato iniziale
if CurrTool then
EgtTdbSetCurrTool( CurrTool)
else
EgtTdbSetCurrTool( '')
end
-- restituisco risultato
return sTcPos
end
---------------------------------------------------------------------
function MoveHead( nGrpId, vtVers, dPos, bLoc)
local dVal = EgtGetInfo( nGrpId or GDB_ID.NULL, '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 ExecUnloading()
if EMT.VMILL then
local vMillId = EMT.VMILL
-- gruppo dei Vmill
local nVmGrpId = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'VMill')
-- creo un nuovo layer e vi inserisco il nuovo pezzo
local nLayId = EgtGroup( nVmGrpId, EgtGetGlobFrame( vMillId))
EgtRelocate( vMillId, nLayId)
EgtSetLevel( vMillId, GDB_LV.USER)
-- aggiungo gli spigoli
if EgtVolZmapSetShowEdges then
EgtVolZmapSetShowEdges( vMillId, true)
else
local nFirstId, nCount = EgtVolZmapGetEdges( vMillId, nLayId)
if nFirstId then
for nId = nFirstId, nFirstId + nCount - 1 do
EgtSetColor( nId, Color3d( 96, 96, 96))
end
end
end
-- rilascio Vmill
EMT.VMILL = nil
-- aggiorno la visualizzazione
EgtDraw()
-- se impostato di salvare i Vmill, lo faccio
local sMachIni = EgtGetCurrMachineDir() .. '\\' .. EgtGetCurrMachineName() .. '.ini'
if EgtGetStringFromIni( 'VMill', 'Save', '', sMachIni) == '1' then
local sFile = EgtGetCurrFilePath()
if sFile then
local sDir, sName, sExt = EgtSplitPath( sFile)
if sExt and sExt:lower() == ".nge" then
sName = sName .. '_VM_' .. EgtGetMachGroupName( EgtGetCurrMachGroup())
EgtSetLevel( nVmGrpId, GDB_LV.USER)
EgtSaveObjToFile( nVmGrpId, sDir .. sName .. '.Nge')
EgtSetLevel( nVmGrpId, GDB_LV.TEMP)
end
end
end
end
end
---------------------------------------------------------------------
-- *** STIMA T&L ***
---------------------------------------------------------------------
local RAPID_X_FEED = 20000 -- mm/min
local RAPID_Y_FEED = 20000 -- mm/min
local RAPID_Z_FEED = 10000 -- mm/min
local RAPID_C_FEED = 3600 -- deg/min
local RAPID_B_FEED = 3600 -- deg/min
local RAPID_MIN_T = 1.0 -- s
local UNLOAD_RAW_T = 60 -- s
---------------------------------------------------------------------
function OnEstimStart()
EMT.INCHES = not EgtUiUnitsAreMM() -- unità di misura mm/inches
end
---------------------------------------------------------------------
function OnEstimEnd()
end
---------------------------------------------------------------------
function OnEstimProgramStart()
-- imposto inizio movimenti da Home
EMT.L1 = EgtGetAxisHomePos( 'X')
EMT.L2 = EgtGetAxisHomePos( 'Y')
EMT.L3 = EgtGetAxisHomePos( 'Z1')
EMT.R1 = EgtGetAxisHomePos( 'C')
EMT.R2 = EgtGetAxisHomePos( 'A')
-- aggiorno valori come precedenti
EmtUpdatePrev()
-- totalizzatori tempi e lunghezze
EMT.TOTCUTLEN = 0
EMT.TOTCUTTIME = 0
EMT.TOTEXTLEN = 0
EMT.TOTEXTTIME = 0
-- variabile per lunghezza taglio utensili
EMT.TOOLCUTLEN = {}
-- intestazioni
EmtTleStart( EMT.INFO)
end
---------------------------------------------------------------------
function OnEstimProgramEnd()
-- stampa dei totali delle lavorazioni
EmtTleAddTotal( EmtSecToHMS( EMT.TOTCUTTIME + EMT.TOTEXTTIME), EmtLenToMF( EMT.TOTCUTLEN))
-- stampa dei totali degli utensili
for i = 1, #EMT.TOOLCUTLEN do
local TCL = EMT.TOOLCUTLEN[i]
EmtTleAddTool( TCL.Name, EmtLenToMF( TCL.Len))
end
-- completo il file
local _, _, sExt = EgtSplitPath( EMT.FILE)
EmtTleEnd( sExt:sub( 2))
-- salvo i dati principali nel progetto
EgtSetInfo( EgtGetCurrMachGroup(), 'Ttot', EgtNumToString( EMT.TOTCUTTIME + EMT.TOTEXTTIME, 0))
EgtSetInfo( EgtGetCurrMachGroup(), 'Ltot', EgtNumToString( EMT.TOTCUTLEN, 0))
end
---------------------------------------------------------------------
function OnEstimDispositionStart()
-- inizioe disposizione
EMT.OPEISDISP = true
-- non va fatto alcunché
end
---------------------------------------------------------------------
function OnEstimDispositionEnd()
-- termine disposizione
EMT.OPEISDISP = false
-- non va fatto alcunché
end
---------------------------------------------------------------------
function OnEstimToolSelect()
-- reset indice utensile in tabella lunghezze
EMT.TCLIND = 0
-- verifico che l'utensile sia definito
if #EMT.TOOL == 0 then return end
-- cerco l'utensile nella tabella
for i = 1, #EMT.TOOLCUTLEN do
if EMT.TOOLCUTLEN[i].Name == EMT.TOOL then
EMT.TCLIND = i
break
end
end
-- se non trovato, lo aggiungo
if EMT.TCLIND == 0 then
table.insert( EMT.TOOLCUTLEN, { Name = EMT.TOOL, Len = 0})
EMT.TCLIND = #EMT.TOOLCUTLEN
end
end
---------------------------------------------------------------------
function OnEstimToolDeselect()
end
---------------------------------------------------------------------
function OnEstimMachiningStart()
EMT.MCHNAME = EgtGetMachiningParam(MCH_MP.NAME)
EMT.MCHTYPE = EgtGetMachiningParam(MCH_MP.TYPE)
-- reset contatori di lavorazione
EMT.MCHCUTLEN = 0
EMT.MCHCUTTIME = 0
EMT.MCHEXTLEN = 0
EMT.MCHEXTTIME = 0
end
---------------------------------------------------------------------
function OnEstimMachiningEnd()
local sName = EgtGetName( EMT.MCHID) .. ' (' .. EMT.MCHNAME .. ')'
EmtTleAddMachining( sName, EmtSecToHMS( EMT.MCHCUTTIME + EMT.MCHEXTTIME), EmtLenToMF( EMT.MCHCUTLEN), EMT.TOOL)
-- aggiorno totali e utensili
EMT.TOTCUTLEN = EMT.TOTCUTLEN + EMT.MCHCUTLEN
EMT.TOTCUTTIME = EMT.TOTCUTTIME + EMT.MCHCUTTIME
EMT.TOTEXTLEN = EMT.TOTEXTLEN + EMT.MCHEXTLEN
EMT.TOTEXTTIME = EMT.TOTEXTTIME + EMT.MCHEXTTIME
EMT.TOOLCUTLEN[EMT.TCLIND].Len = EMT.TOOLCUTLEN[EMT.TCLIND].Len + EMT.MCHCUTLEN
end
---------------------------------------------------------------------
function OnEstimPathStart()
end
---------------------------------------------------------------------
function OnEstimPathEnd()
end
---------------------------------------------------------------------
function OnEstimRapid()
-- dati movimento
local dL1 = EMT.L1 - EMT.L1p
local dL2 = EMT.L2 - EMT.L2p
local dL3 = EMT.L3 - EMT.L3p
local dR1 = 0
if EMT.R1 and EMT.R1p then dR1 = EMT.R1 - EMT.R1p end
local dR2 = 0
if EMT.R2 and EMT.R2p then dR2 = EMT.R2 - EMT.R2p end
-- calcolo lunghezza
local dLen = sqrt( dL1 * dL1 + dL2 * dL2 + dL3 * dL3)
if not EMT.OPEISDISP then
EMT.MCHEXTLEN = EMT.MCHEXTLEN + dLen
else
EMT.DSPEXTLEN = EMT.DSPEXTLEN + dLen
end
-- calcolo tempo
local dTime = RAPID_MIN_T
local dT1 = abs( dL1) / RAPID_X_FEED * 60
if dT1 > dTime then dTime = dT1 end
local dT2 = abs( dL2) / RAPID_Y_FEED * 60
if dT2 > dTime then dTime = dT2 end
local dT3 = abs( dL3) / RAPID_Z_FEED * 60
if dT3 > dTime then dTime = dT3 end
local dT4 = abs( dR1) / RAPID_C_FEED * 60
if dT4 > dTime then dTime = dT4 end
local dT5 = abs( dR2) / RAPID_B_FEED * 60
if dT5 > dTime then dTime = dT5 end
EMT.MCHEXTTIME = EMT.MCHEXTTIME + dTime
-- aggiorno valori come precedenti
EmtUpdatePrev()
end
---------------------------------------------------------------------
function OnEstimLinear()
-- dati movimento
local dL1 = EMT.L1 - EMT.L1p
local dL2 = EMT.L2 - EMT.L2p
local dL3 = EMT.L3 - EMT.L3p
-- calcolo lunghezza
local dLen = sqrt( dL1 * dL1 + dL2 * dL2 + dL3 * dL3)
EMT.MCHCUTLEN = EMT.MCHCUTLEN + dLen
-- calcolo tempo
local dTime = dLen / ( EMT.F * 1000) * 60
EMT.MCHCUTTIME = EMT.MCHCUTTIME + dTime
EgtOutLog( string.format( ' G1 Len=%.0f Time=%.2f', dLen, dTime), 5)
-- aggiorno valori come precedenti
EmtUpdatePrev()
end
---------------------------------------------------------------------
function OnEstimArc()
-- dati movimento
local dLxy = EMT.RR * abs( EMT.AC) * pi / 180
local dLz = abs( ( Point3d( EMT.L1, EMT.L2, EMT.L3) - Point3d( EMT.L1p, EMT.L2p, EMT.L3p)) * Vector3d( EMT.EXTR))
-- calcolo lunghezza
local dLen = sqrt( dLxy * dLxy + dLz * dLz)
EMT.MCHCUTLEN = EMT.MCHCUTLEN + dLen
-- calcolo tempo
local dTime = dLen / ( EMT.F * 1000) * 60
EMT.MCHCUTTIME = EMT.MCHCUTTIME + dTime
EgtOutLog( string.format( ' G2 Len=%.0f Time=%.2f', dLen, dTime), 5)
-- aggiorno valori come precedenti
EmtUpdatePrev()
end
+21
View File
@@ -0,0 +1,21 @@
-- Processore macchina Masterwood Project265 2025/01/09
-- by EgalWare s.r.l.
--
-- Intestazioni
require( 'EmtGenerator')
EgtEnableDebug( false)
---------------------------------------------------------------------
-- *** Generic Machinings ***
---------------------------------------------------------------------
Egm = require( 'EmtGenMachining')
---------------------------------------------------------------------
-- *** OnSpecialMoveZup ***
---------------------------------------------------------------------
---------------------------------------------------------------------
-- *** OnSpecialApplyDisposition & OnPostApplyMachining ***
---------------------------------------------------------------------
--function OnSpecialApplyDisposition()
--end
Binary file not shown.
+495
View File
@@ -0,0 +1,495 @@
-- Processore generico Homag woodWOP 2025/04/01
-- by EgalWare s.r.l.
--
-- Intestazioni
require( 'EmtGenerator')
EgtEnableDebug( false)
-- Variabili di modulo
local MLE_INFO = 'Egalware-CAM5-HwW-V2.7d1'
---------------------------------------------------------------------
function OnStart()
EMT.USETO1 = true -- abilitazione uso origine tavola
EMT.MODAL = true -- abilitazione emissione modale
EMT.INCHES = false -- unità di misura mm/inches
EMT.DECNUM = EgtIf( EMT.INCHES, 4, 3) -- numero di decimali dopo la virgola
EMT.NUM = false -- abilitazione numerazione linee
end
---------------------------------------------------------------------
function OnEnd()
-- Chiusura file altri processi (qui si passa sempre, anche in caso di errore)
local sNewPath = EgtChangePathExtension( EMT.FILE, '.mpr')
EgtEraseFile( sNewPath)
EgtRenameFile( EMT.FILE, sNewPath)
end
---------------------------------------------------------------------
function OnProgramStart()
-- Definizione Tabella dati da emettere alla fine
EMT.PROCESS = {}
-- Contatore contorni
EMT.CTR = 0
end
---------------------------------------------------------------------
function OnProgramEnd()
-- Emissione linee posticipate
for i = 1, #EMT.PROCESS do
EmtOutput( EMT.PROCESS[i])
end
-- Chiusura file
EmtOutput( '')
EmtOutput( '!')
end
---------------------------------------------------------------------
function OnToolData()
end
---------------------------------------------------------------------
function OnDispositionStart()
end
---------------------------------------------------------------------
function OnDispositionEnd()
-- se prima fase
if EMT.PHASE == 1 then
-- Header
EmtOutput( '[H')
EmtOutput( 'VERSION="4.0 Alpha" \\' .. MLE_INFO .. '\\')
EmtOutput( 'HP="1"')
EmtOutput( 'IN="0"')
EmtOutput( 'GX="0"')
EmtOutput( 'BFS="1"')
EmtOutput( 'GY="0"')
EmtOutput( 'GXY="0"')
EmtOutput( 'UP="0"')
EmtOutput( 'FM="1"')
EmtOutput( 'FW="' .. EmtLenToString( XAxisHome, EMT.DECNUM) .. '"')
EmtOutput( 'ZS="50"')
EmtOutput( 'HS="0"')
EmtOutput( 'OP="0"')
EmtOutput( 'MAT="HOMAG"')
EmtOutput( 'INCH="0"')
EmtOutput( 'VIEW="NOMIRROR"')
EmtOutput( 'ANZ="1"')
EmtOutput( '_BSX=' .. EmtLenToString( EMT.LP, EMT.DECNUM))
EmtOutput( '_BSY=' .. EmtLenToString( EMT.WP, EMT.DECNUM))
EmtOutput( '_BSZ=' .. EmtLenToString( EMT.TP, EMT.DECNUM))
EmtOutput( '_FNX=0')
EmtOutput( '_FNY=0')
EmtOutput( '_RNX=0')
EmtOutput( '_RNY=0')
EmtOutput( '_RNZ=0')
EmtOutput( '_RX=' .. EmtLenToString( EMT.LP, EMT.DECNUM))
EmtOutput( '_RY=' .. EmtLenToString( EMT.WP, EMT.DECNUM))
-- Tabella delle variabili
EmtOutput( '')
EmtOutput( '[001')
EmtOutput( 'l="' .. EmtLenToString( EMT.LP, EMT.DECNUM) .. '"')
EmtOutput( 'KM="Length"')
EmtOutput( 'w="' .. EmtLenToString( EMT.WP, EMT.DECNUM) .. '"')
EmtOutput( 'KM="Width"')
EmtOutput( 'th="' .. EmtLenToString( EMT.TP, EMT.DECNUM) .. '"')
EmtOutput( 'KM="Thickness"')
-- Assegno dati pezzo (da emettere dopo)
PostOutput( '')
PostOutput( '<100 \\WerkStck\\')
PostOutput( 'LA="l"')
PostOutput( 'BR="w"')
PostOutput( 'DI="th"')
PostOutput( 'FNX="0.0"')
PostOutput( 'FNY="0.0"')
PostOutput( 'RNX="0"')
PostOutput( 'RNY="0"')
PostOutput( 'RNZ="0"')
PostOutput( 'AX="0"')
PostOutput( 'AY="0"')
end
end
---------------------------------------------------------------------
function OnTableData()
end
---------------------------------------------------------------------
function OnTableAxisData()
end
---------------------------------------------------------------------
function OnFixtureData()
end
---------------------------------------------------------------------
function OnRawMoveData()
-- Assegno dimensioni del grezzo
local b3Sol = EgtGetRawPartBBox( EMT.RAWID) or BBox3d( ORIG())
EMT.LP = b3Sol:getDimX()
EMT.WP = b3Sol:getDimY()
EMT.TP = b3Sol:getDimZ()
-- Assegno Posizione del Grezzo rispetto all'Origine Tavola (le coordinate sono riferite ad essa)
EMT.PP = b3Sol:getMin() - Point3d( EMT.TABORI1[1], EMT.TABORI1[2], EMT.TABORI1[3])
end
---------------------------------------------------------------------
function OnToolSelect()
EMT.TOOLTYPE = EgtTdbGetCurrToolParam( MCH_TP.TYPE)
EMT.TDIAM = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
EMT.TTOTDIAM = EgtTdbGetCurrToolParam( MCH_TP.TOTDIAM)
EMT.TLEN = EgtTdbGetCurrToolParam( MCH_TP.LEN)
EMT.TTOTLEN = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
EMT.TUSERNOTES = EgtTdbGetCurrToolParam( MCH_TP.USERNOTES)
local vsTok = EgtSplitString( EMT.TOOL, '_') or {}
EMT.TNO = tonumber( vsTok[1]) or 0
end
---------------------------------------------------------------------
function OnToolDeselect()
end
---------------------------------------------------------------------
function OnMachiningStart()
EMT.MCHNAME = EgtGetOperationName( EMT.MCHID)
EMT.MCHTYPE = EgtGetMachiningParam( MCH_MP.TYPE)
EMT.MCHLEADIN = EgtGetMachiningParam( MCH_MP.LEADINTYPE)
EMT.MCHLEADOUT = EgtGetMachiningParam( MCH_MP.LEADOUTTYPE)
EMT.MCHFEED = EgtGetMachiningParam( MCH_MP.FEED)
EMT.MCHUSERNOTES = EgtGetMachiningParam( MCH_MP.USERNOTES)
EMT.MCHFIRST = true
EMT.MCHMINZ = 999
end
---------------------------------------------------------------------
function OnMachiningEnd()
-- Se foratura
if EMT.MCHTYPE == MCH_MY.DRILLING then
-- recupero la geometria dei fori
local vGeom = EgtGetMachiningGeometry() or {}
-- calcolo il riferimento pezzo
local ptS = Point3d( EMT.PP)
local vtE = Vector3d( EMT.EXTR)
local refPart = Frame3d( ptS, Z_AX())
-- per ogni foro emetto la relativa lavorazione
for i = 1, #vGeom do
local nEntId = vGeom[i][1]
if nEntId and EgtGetType( nEntId) == GDB_TY.CRV_ARC then
local ptCen = EgtCP( nEntId, GDB_ID.ROOT)
ptCen:toLoc( refPart)
local dDiam = 2 * EgtArcRadius( nEntId)
local dDepth = abs( EgtCurveThickness( nEntId))
if vtE:isSmall() or AreSameVectorApprox( vtE, Z_AX()) then
PostOutput( '')
PostOutput( '<102 \\BohrVert\\')
PostOutput( 'XA="' .. EmtLenToString( ptCen:getX(), EMT.DECNUM) .. '"')
PostOutput( 'YA="' .. EmtLenToString( ptCen:getY(), EMT.DECNUM) .. '"')
PostOutput( 'BM="SS"')
PostOutput( 'TI="' .. EmtLenToString( dDepth, EMT.DECNUM) .. '"')
PostOutput( 'DU="' .. EmtLenToString( dDiam, EMT.DECNUM) .. '"')
PostOutput( 'MNM="' .. EMT.MCHNAME .. '"')
else
PostOutput( '')
PostOutput( '<103 \\BohrHoriz\\')
PostOutput( 'XA="' .. EmtLenToString( ptCen:getX(), EMT.DECNUM) .. '"')
PostOutput( 'YA="' .. EmtLenToString( ptCen:getY(), EMT.DECNUM) .. '"')
PostOutput( 'ZA="' .. EmtLenToString( ptCen:getZ(), EMT.DECNUM) .. '"')
if AreSameVectorApprox( vtE, -Y_AX()) then
PostOutput( 'BM="YP"')
elseif AreSameVectorApprox( vtE, X_AX()) then
PostOutput( 'BM="XM"')
elseif AreSameVectorApprox( vtE, Y_AX()) then
PostOutput( 'BM="YM"')
elseif AreSameVectorApprox( vtE, -X_AX()) then
PostOutput( 'BM="XP"')
else
EmtSetLastError( 1201, 'Drilling direction not allowed')
end
PostOutput( 'TI="' .. EmtLenToString( dDepth, EMT.DECNUM) .. '"')
PostOutput( 'DU="' .. EmtLenToString( dDiam, EMT.DECNUM) .. '"')
PostOutput( 'MNM="' .. EMT.MCHNAME .. '"')
end
end
end
-- altrimenti se taglio con lama
elseif EMT.MCHTYPE == MCH_MY.SAWING then
-- recupero la geometria dei percorsi
local vGeom = EgtGetMachiningGeometry() or {}
-- recupero angolo di sbandamento
local dSideAng = EgtGetMachiningParam( MCH_MP.SIDEANGLE)
if abs( dSideAng) > 0.1 then
EmtSetLastError( 1201, 'Sawing inclination not allowed')
end
-- recupero lato di lavoro
local nWorkSide = EgtGetMachiningParam( MCH_MP.WORKSIDE)
local sWorkSide = 'NOWRK'
if nWorkSide == MCH_SAW_WS.LEFT then
sWorkSide = 'WRKL'
elseif nWorkSide == MCH_SAW_WS.RIGHTT then
sWorkSide = 'WRKR'
end
-- recupero tipo di attacco
local nLeadIn = EgtGetMachiningParam( MCH_MP.LEADINTYPE)
local sMode = 'MOD2'
if nLeadIn == MCH_SAW_LI.STRICT then
sMode = 'MOD1'
elseif nLeadIn == MCH_SAW_LI.CENT then
sMode = 'MOD0'
end
-- recupero allungamenti iniziale e finale
local dAddLenSta = EgtGetMachiningParam( MCH_MP.STARTADDLEN)
local dAddLenEnd = EgtGetMachiningParam( MCH_MP.ENDADDLEN)
-- calcolo il riferimento pezzo
local ptS = Point3d( EMT.PP)
local refPart = Frame3d( ptS, Z_AX())
-- per ogni linea emetto la relativa lavorazione
for i = 1, #vGeom do
local nEntId = vGeom[i][1]
if nEntId and EgtGetType( nEntId) == GDB_TY.CRV_LINE then
local vtDir = EgtSV( nEntId, GDB_ID.ROOT)
local ptSta = EgtSP( nEntId, GDB_ID.ROOT)
ptSta = ptSta - dAddLenSta * vtDir
ptSta:toLoc( refPart)
local ptEnd = EgtEP( nEntId, GDB_ID.ROOT)
ptEnd = ptEnd + dAddLenEnd * vtDir
ptEnd:toLoc( refPart)
local dDepth = ptSta:getZ() - EMT.MCHMINZ
PostOutput( '')
PostOutput( '<109 \\Nuten\\')
PostOutput( 'XA="' .. EmtLenToString( ptSta:getX(), EMT.DECNUM) .. '"')
PostOutput( 'YA="' .. EmtLenToString( ptSta:getY(), EMT.DECNUM) .. '"')
PostOutput( 'XE="' .. EmtLenToString( ptEnd:getX(), EMT.DECNUM) .. '"')
PostOutput( 'YE="' .. EmtLenToString( ptEnd:getY(), EMT.DECNUM) .. '"')
PostOutput( 'AN="0"')
PostOutput( 'TI="' .. EmtLenToString( dDepth, EMT.DECNUM) .. '"')
PostOutput( 'RK="' .. sWorkSide .. '"')
PostOutput( 'EM="' .. sMode .. '"')
PostOutput( 'MNM="' .. EMT.MCHNAME .. '"')
end
end
end
end
---------------------------------------------------------------------
function OnPathStart()
-- Reset valori precedenti (per forzare emissione di tutti gli assi del 1° movimento)
EmtResetPrev()
EMT.IPLGL = false
EMT.IPLGLFR = nil
-- Se fresatura o svuotatura
if EMT.MCHTYPE == MCH_MY.MILLING or EMT.MCHTYPE == MCH_MY.POCKETING then
-- Inizio percorso di lavorazione
EmitStartContour()
EMT.ENT = 0
-- in tutti gli altri casi
else
EMT.ENT = nil
end
end
---------------------------------------------------------------------
function OnPathEnd()
-- Assegno dati lavorazione (da emettere dopo)
if EMT.ENT and EMT.ENT > 0 then
-- Dichiarazione lavorazione
EmitMilling()
end
end
---------------------------------------------------------------------
function OnRapid()
-- se primo movimento del percorso, calcolo piano di interpolazione
if not EMT.IPLGL then
CalcInterpPlane()
EMT.IPLGL = true
end
MyAdjustLinearAxes()
-- aggiorno valori come precedenti
EmtUpdatePrev()
end
---------------------------------------------------------------------
function OnLinear()
MyAdjustLinearAxes()
-- se entità di lavorazione con contorno e non approccio o retrazione
if EMT.ENT then
-- se non approccio o retrazione
if not IsSafeMoveIO( EMT.MOVEID) then
-- se inizio, emetto punto di partenza
if EMT.ENT == 0 then
EmtOutput( '$E0')
EmtOutput( 'KP')
EmtOutput( 'X='..EmtLenToString( EMT.L1p, EMT.DECNUM))
EmtOutput( 'Y='..EmtLenToString( EMT.L2p, EMT.DECNUM))
EmtOutput( 'Z='..EmtLenToString( EMT.L3p, EMT.DECNUM))
EmtOutput( 'KO=' .. EMT.KO)
end
-- emetto segmento di retta
EMT.ENT = EMT.ENT + 1
EmtOutput( '')
EmtOutput( '$E' .. tostring( EMT.ENT))
EmtOutput( 'KL')
EmtOutput( 'X='..EmtLenToString( EMT.L1, EMT.DECNUM))
EmtOutput( 'Y='..EmtLenToString( EMT.L2, EMT.DECNUM))
EmtOutput( 'Z='..EmtLenToString( EMT.L3, EMT.DECNUM))
-- se approccio
elseif IsSafeMoveIn( EMT.MOVEID) then
if EMT.ENT == -1 then
-- Inizio percorso di lavorazione
EmitStartContour()
EMT.ENT = 0
end
-- se retrazione
elseif IsSafeMoveOut( EMT.MOVEID) then
if EMT.ENT and EMT.ENT > 0 then
-- Dichiarazione lavorazione
EmitMilling()
EMT.ENT = -1
end
end
end
-- aggiorno minimo in Z
EMT.MCHMINZ = min( EMT.MCHMINZ, EMT.L3)
-- aggiorno valori come precedenti
EmtUpdatePrev()
end
---------------------------------------------------------------------
function OnArc()
MyAdjustLinearAxes()
-- se entità di lavorazione con contorno ( non può mai essere approccio o retrazione)
if EMT.ENT then
-- se inizio, emetto punto di partenza
if EMT.ENT == 0 then
EmtOutput( '$E0')
EmtOutput( 'KP')
EmtOutput( 'X='..EmtLenToString( EMT.L1p, EMT.DECNUM))
EmtOutput( 'Y='..EmtLenToString( EMT.L2p, EMT.DECNUM))
EmtOutput( 'Z='..EmtLenToString( EMT.L3p, EMT.DECNUM))
EmtOutput( 'KO=' .. EMT.KO)
end
-- emetto arco
EMT.ENT = EMT.ENT + 1
EmtOutput( '')
EmtOutput( '$E' .. tostring( EMT.ENT))
EmtOutput( 'KA')
EmtOutput( 'X='..EmtLenToString( EMT.L1, EMT.DECNUM))
EmtOutput( 'Y='..EmtLenToString( EMT.L2, EMT.DECNUM))
EmtOutput( 'Z='..EmtLenToString( EMT.L3, EMT.DECNUM))
EmtOutput( 'DS='..EgtIf( EMT.AC < 0, '0', '1'))
EmtOutput( 'R='..EmtLenToString( EMT.RR, EMT.DECNUM))
end
-- aggiorno minimo in Z
EMT.MCHMINZ = min( EMT.MCHMINZ, EMT.L3)
-- aggiorno valori come precedenti
EmtUpdatePrev()
end
---------------------------------------------------------------------
---------------------------------------------------------------------
function IsSafeMoveIO( nEntId)
local sName = EgtGetName( nEntId)
return ( sName == 'SI' or sName == 'SO')
end
---------------------------------------------------------------------
function IsSafeMoveIn( nEntId)
local sName = EgtGetName( nEntId)
return ( sName == 'SI')
end
---------------------------------------------------------------------
function IsSafeMoveOut( nEntId)
local sName = EgtGetName( nEntId)
return ( sName == 'SO')
end
---------------------------------------------------------------------
function IsLeadIO( nEntId)
local sName = EgtGetName( nEntId)
return ( sName == 'LI' or sName == 'LO')
end
---------------------------------------------------------------------
function CalcInterpPlane()
-- Reset
EMT.IPLGLFR = nil
-- Recupero vettore direzione utensile
local vtE = Vector3d( EMT.EXTR)
-- a seconda del piano di interpolazione Solo standard Homag 00, A0, B0, C0, D0)
if vtE:isSmall() or AreSameVectorApprox( vtE, Z_AX()) then
local ptS = Point3d( EMT.PP)
EMT.IPLGLFR = Frame3d( ptS, vtE)
EMT.KO = '00'
elseif AreSameVectorApprox( vtE, - Y_AX()) then
local ptS = Point3d( EMT.PP)
EMT.IPLGLFR = Frame3d( ptS, vtE)
EMT.KO = 'A0'
elseif AreSameVectorApprox( vtE, X_AX()) then
local ptS = Point3d( EMT.PP) + Vector3d( EMT.LP, 0, 0)
EMT.IPLGLFR = Frame3d( ptS, vtE)
EMT.KO = 'B0'
elseif AreSameVectorApprox( vtE, Y_AX()) then
local ptS = Point3d( EMT.PP) + Vector3d( EMT.LP, EMT.WP, 0)
EMT.IPLGLFR = Frame3d( ptS, vtE)
EMT.KO = 'C0'
elseif AreSameVectorApprox( vtE, - X_AX()) then
local ptS = Point3d( EMT.PP) + Vector3d( 0, EMT.WP, 0)
EMT.IPLGLFR = Frame3d( ptS, vtE)
EMT.KO = 'D0'
else
EmtSetLastError( 1201, 'Tool direction not allowed')
end
end
---------------------------------------------------------------------
function MyAdjustLinearAxes()
local MyL1o = EMT.L1
local MyL2o = EMT.L2
local MyL3o = EMT.L3
-- porto le coordinate sulla punta utensile
local bBottom = ( EMT.MCHTYPE == MCH_MY.SAWING)
local ptTip = EgtGetCalcTipFromPositions( EMT.L1, EMT.L2, EMT.L3, EMT.R1 or 0, EMT.R2 or 0, bBottom)
EMT.L1 = ptTip:getX()
EMT.L2 = ptTip:getY()
EMT.L3 = ptTip:getZ()
EmtAdjustLinearAxes()
EMT.L1o = MyL1o
EMT.L2o = MyL2o
EMT.L3o = MyL3o
end
---------------------------------------------------------------------
function EmitStartContour()
EMT.CTR = EMT.CTR + 1
EmtOutput( '')
EmtOutput( ']' .. tostring( EMT.CTR))
end
---------------------------------------------------------------------
function EmitMilling()
PostOutput( '')
PostOutput( '<105 \\Konturfraesen\\')
PostOutput( 'EA="' .. tostring( EMT.CTR) .. ':0"')
PostOutput( 'MDA="SEN"')
PostOutput( 'RK="NOWRK"')
PostOutput( 'EE="' .. tostring( EMT.CTR) .. ':' .. tostring( EMT.ENT) .. '"')
PostOutput( 'MDE="SEN_AB"')
PostOutput( 'TNO="' .. tostring( EMT.TNO) .. '"')
PostOutput( 'SM="0"')
PostOutput( 'S_="STANDARD"')
PostOutput( 'F_="' .. EgtNumToString( EMT.MCHFEED, 1) .. '"')
PostOutput( 'ZA="@0"')
PostOutput( 'MNM="' .. EMT.MCHNAME .. '"')
end
---------------------------------------------------------------------
function PostOutput( sLine)
table.insert( EMT.PROCESS, sLine)
end
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

+48
View File
@@ -0,0 +1,48 @@
; Commento per evitare BOM con UTF-8
;Index = Type, Description, Default Value
; Type : b=boolean, d=double, l=lenght, s=string
[Drilling]
[Sawing]
[Milling]
0=d,MaxElev,0
1=d,OutRaw,0
2=d,SideElev,0
3=d,TrimExt,0
4=sr,VtFaceUse,0,0,0
[Pocketing]
0=d,MaxElev,0
1=b,Open,0
2=d,OpenMinSave,0
3=d,OpenOutRaw,0
4=d,MaxOptSize,0
[Mortising]
0=d,MaxElev,0
[Chiseling]
[GenMachining]
[SurfRoughing]
[SurfFinishing]
0=b,SkipMaxDown,1
[5AxMilling]
0=l,LinTol,0.01
1=l,MaxLen,10
2=s,Type,ZigZag
3=d,SideAng,90
4=l,Step,10
5=l,OffsProj,0
6=l,LiTang,0
7=l,LiOrth,0
8=l,LiElev,0
9=l,LoTang,0
10=l,LoOrth,0
11=l,LoElev,0
12=b,DirFromGuide,1
Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

-93
View File
@@ -1,93 +0,0 @@
# Homag-Venture16L
## Getting started
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
## Add your files
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
- [ ] [Add files using the command line](https://docs.gitlab.com/topics/git/add_files/#add-files-to-a-git-repository) or push an existing Git repository with the following command:
```
cd existing_repo
git remote add origin https://gitlab.steamware.net/egalware-machines/Homag/Homag-Venture16L.git
git branch -M main
git push -uf origin main
```
## Integrate with your tools
- [ ] [Set up project integrations](https://gitlab.steamware.net/egalware-machines/Homag/Homag-Venture16L/-/settings/integrations)
## Collaborate with your team
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
- [ ] [Set auto-merge](https://docs.gitlab.com/user/project/merge_requests/auto_merge/)
## Test and Deploy
Use the built-in continuous integration in GitLab.
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/)
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
***
# Editing this README
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
## Suggestions for a good README
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
## Name
Choose a self-explaining name for your project.
## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
## Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
## Usage
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
## Support
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
## Roadmap
If you have ideas for releases in the future, it is a good idea to list them in the README.
## Contributing
State if you are open to contributions and what your requirements are for accepting them.
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
## Authors and acknowledgment
Show your appreciation to those who have contributed to the project.
## License
For open source projects, say how it is licensed.
## Project status
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
+152
View File
@@ -0,0 +1,152 @@
-- 2025/03/30 10:00:00
-- Disposition Init for Homag Venture16L machine
-- Intestazioni
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( false)
--------------------------------------------------------------------------------
-- Colore del grezzo
local ColA = Color3d( 255, 165, 0, 30)
--------------------------------------------------------------------------------
-- * Verifica esistenza MachGroup *
if not EgtGetCurrMachGroup() then
local sErr = 'InitDisp for Masterwood_Project265 : missing CurrMachGroup'
EgtOutLog( sErr)
EgtOutText( sErr)
DISP.ERR = 1
return
end
--------------------------------------------------------------------------------
-- *** Disposizione ***
-- Scelta della tavola
local sTab = 'Tab'
EgtSetTable( sTab)
EgtSetTableAreaOffset( 100, 100, 100, 100)
local frTab = Frame3d( EgtGetTableRef())
-- Se pezzo non definito, esco senza errore (modalità test macchina)
local Pz = DISP.PARTID
if not Pz or Pz == GDB_ID.NULL then
DISP.ERR = 0
return
end
-- Recupero i dati del pezzo
local Ls = EgtGetFirstNameInGroup( Pz, 'SOLID')
local Er = EgtGetFirstNameInGroup( Ls or GDB_ID.NULL, 'RAW')
local b3Part = EgtGetBBoxGlob( Pz or GDB_ID.NULL, GDB_BB.STANDARD)
local b3Solid = EgtGetBBoxGlob( Ls or GDB_ID.NULL, GDB_BB.STANDARD)
-- Se pezzo vuoto, non devo fare alcunchè
if b3Part:isEmpty() then
local sErr = 'InitDisp for Masterwood_Project265 : empty part'
EgtOutLog( sErr)
EgtOutText( sErr)
DISP.ERR = 2
return
end
-- Recupero ingombro di grezzi già inseriti
local b3PrevRaw = BBox3d()
local nPrevRawId = EgtGetFirstRawPart()
while nPrevRawId do
local b3Raw = EgtGetRawPartBBox( nPrevRawId)
b3PrevRaw:Add( b3Raw)
nPrevRawId = EgtGetNextRawPart( nPrevRawId)
end
b3PrevRaw:toLoc( frTab)
-- Richiesta posizione rispetto allo Zero tavola
local dOverMatXY = 5
local sOverMatXY = EgtNumToString( EgtToUiUnits( dOverMatXY), 0)
local dOverMatZ = 0
local sOverMatZ = EgtNumToString( EgtToUiUnits( dOverMatZ), 0)
local dSafeDist = 20
local sSafeDist = EgtNumToString( EgtToUiUnits( dSafeDist), 0)
local vVal = EgtDialogBox( 'Dati di disposizione', {'Y Position', 'CB:Front,MediumFront,MediumBack,Back'},
{'X Position', 'CB:Left,Right'},
{'Safe Dist', sSafeDist},
{'Sovramateriale XY', sOverMatXY},
{'Sovramateriale Z', sOverMatZ})
if not vVal or #vVal < 5 then
DISP.ERR = 100
return
end
local sRefY = 'B'
local vYPos = { Front='B', MediumFront='M', MediumBack='N', Back='T'}
sRefY = vYPos[vVal[1]]
local sRefX = 'L'
local vXPos = { Left='L', Right='R'}
sRefX = vXPos[vVal[2]]
dSafeDist = EgtFromUiUnits( tonumber( vVal[3]))
dOverMatXY = EgtFromUiUnits( tonumber( vVal[4]))
dOverMatZ = EgtFromUiUnits( tonumber( vVal[5]))
-- Definizione e posizionamento del grezzo
local nRaw
if Er then
nRaw = EgtAddRawPartWithPart( Pz, Er, 0, ColA)
EgtSetStatus( Er, GDB_ST.ON)
else
nRaw = EgtAddRawPartWithPart( Pz, GDB_ID.NULL, dOverMatXY, ColA)
if nRaw and dOverMatZ > 10 * GEO.EPS_SMALL then
local b3Raw = EgtGetRawPartBBox( nRaw)
local dRawH = b3Raw:getDimZ() + dOverMatZ
EgtModifyRawPartHeight( nRaw, dRawH)
end
end
if not nRaw then
local sErr = 'InitDisp for Masterwood_Project265 : error defining raw part'
EgtOutLog( sErr)
EgtOutText( sErr)
DISP.ERR = 3
return
end
local b3Raw = EgtGetRawPartBBox( nRaw)
local bVac = ( b3Raw:getDimY() >= 120)
local vtOffs, nCorn
if sRefY == 'B' and sRefX == 'L' then
vtOffs = Vector3d( 0, 0, 0)
nCorn = MCH_CR.BL
elseif sRefY == 'B' and sRefX == 'R' then
vtOffs = Vector3d( 1700, 0, 0)
nCorn = MCH_CR.BR
elseif sRefY == 'M' and sRefX == 'L' then
vtOffs = Vector3d( 0, 675-10, 0)
nCorn = MCH_CR.TL
elseif sRefY == 'M' and sRefX == 'R' then
vtOffs = Vector3d( 1700, 675-10, 0)
nCorn = MCH_CR.TR
elseif sRefY == 'N' and sRefX == 'L' then
vtOffs = Vector3d( 0, 675+10, 0)
nCorn = MCH_CR.BL
elseif sRefY == 'N' and sRefX == 'R' then
vtOffs = Vector3d( 1700, 675+10, 0)
nCorn = MCH_CR.BR
elseif sRefY == 'T' and sRefX == 'L' then
vtOffs = Vector3d( 0, 1350, 0)
nCorn = MCH_CR.TL
elseif sRefY == 'T' and sRefX == 'R' then
vtOffs = Vector3d( 1700, 1350, 0)
nCorn = MCH_CR.TR
end
if not bVac then
if sRefY == 'B' or sRefY == 'N' then
vtOffs = vtOffs + 60 * Y_AX()
else
vtOffs = vtOffs - 60 * Y_AX()
end
end
if not EgtMoveToCornerRawPart( nRaw, vtOffs, nCorn) then
local sErr = 'InitDisp for Masterwood_Project265 : error positioning raw part on table'
EgtOutLog( sErr)
EgtOutText( sErr)
DISP.ERR = 4
return
end
DISP.ERR = 0
+220
View File
@@ -0,0 +1,220 @@
--
-- EEEEEEEEEE GGGGGG TTTTTTTTTTTTTT
-- EEEEEEEEEE GGGGGGGGGG TTTTTTTTTTTTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEEEEE GGGG GGGGGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEE GGGG GGGG TTTT
-- EEEEEEEEEE GGGGGGGGGG TTTT
-- EEEEEEEEEE GGGGGG TTTT
--
-- by EgalTech s.r.l. 2023/03/30 10:30:00
-- Gestione attrezzaggio
-- Intestazioni
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( false)
-- Tavola di passaggio valori
local STU = {}
STU.TUUID = ""
STU.TCPOS = ""
STU.HEAD = ""
STU.GROUP = ""
STU.POS = ""
STU.EXIT = 0
STU.INDEX = 0
STU.HEAD1 = ""
STU.HEAD2 = ""
STU.ISVALID = false
STU.ERR = 0
_G.STU = STU
local INVALIDPOS = ""
local POS = "Pos"
-- Geom Set
local GS = {}
-- Configurazione posizioni
local PositionTable={{Pos = "Pos1", TcPos = "T1", Head = "H11", Group = "G1"},
{Pos = "Pos2", TcPos = "T2", Head = "H11", Group = "G1"},
{Pos = "Pos3", TcPos = "T3", Head = "H11", Group = "G1"},
{Pos = "Pos4", TcPos = "T4", Head = "H11", Group = "G1"},
{Pos = "Pos5", TcPos = "T5", Head = "H11", Group = "G1"},
{Pos = "Pos6", TcPos = "T6", Head = "H11", Group = "G1"},
{Pos = "Pos7", TcPos = "T7", Head = "H11", Group = "G1"},
{Pos = "Pos8", TcPos = "T8", Head = "H11", Group = "G1"},
{Pos = "Pos9", TcPos = "T9", Head = "H11", Group = "G1"},
{Pos = "Pos10", TcPos = "T10", Head = "H11", Group = "G1"},
{Pos = "Pos11", TcPos = "T11", Head = "H11", Group = "G1"},
{Pos = "Pos12", TcPos = "T12", Head = "H11", Group = "G1"},
{Pos = "Pos13", TcPos = "T13", Head = "H11", Group = "G1"},
{Pos = "Pos14", TcPos = "T14", Head = "H11", Group = "G1"},
{Pos = "Pos15", TcPos = "T15", Head = "H11", Group = "G1"},
{Pos = "Pos16", TcPos = "T16", Head = "H11", Group = "G1"},
{Pos = "Pos17", TcPos = "T17", Head = "H11", Group = "G1"},
{Pos = "Pos18", TcPos = "T18", Head = "H11", Group = "G1"},
{Pos = "Pos19", TcPos = "T81", Head = "H21", Group = "G2"},
{Pos = "Pos20", TcPos = "T82", Head = "H22", Group = "G3"}}
local UsePositionHead = false
local function IsInGeomSet( ToolHead, PosHead)
for GsIndex = 1, #GS do
local bToolHead = false
local bPosHead = false
for HIndex = 1, #GS[GsIndex] do
if GS[GsIndex][HIndex] == ToolHead then
bToolHead = true
elseif GS[GsIndex][HIndex] == PosHead then
bPosHead = true
end
if bToolHead and bPosHead then
return true
end
end
if bToolHead and bPosHead then
return true
end
end
return false
end
function STU.IsCompatibleHeads()
STU.ISVALID = false
if IsInGeomSet(STU.HEAD1, STU.HEAD2) then
STU.ISVALID = true
else
STU.ISVALID = false
end
end
function STU.GetValidHeadExitForPos()
-- se TUUID non valido restituisco errore
local ToolName = EgtTdbGetToolFromUUID( STU.TUUID)
if ToolName == nil then
STU.ERR = 1
return
end
EgtTdbSetCurrTool( ToolName)
local CurrToolHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
STU.EXIT = EgtTdbGetCurrToolParam( MCH_TP.EXIT)
-- recupero testa predefinita per la posizione corrente
local CurrPosHead
for i = 1, #PositionTable do
if PositionTable[i].TcPos == STU.TCPOS then
CurrPosHead = PositionTable[i].Head
break
end
end
-- verifico se la testa è quella della posizione predefinita
if CurrPosHead == CurrToolHead then
STU.HEAD = CurrToolHead
STU.ERR = 0
return
-- verifico se la testa è compatibile con quella della posizione predefinita
elseif IsInGeomSet( CurrToolHead, CurrPosHead) then
if UsePositionHead then
STU.HEAD = CurrPosHead
STU.ERR = 0
return
else
STU.HEAD = CurrToolHead
STU.ERR = 0
return
end
-- la testa non è compatibile con quella della posizione predefinita
else
STU.HEAD = INVALIDPOS
STU.ERR = 0
return
end
end
function STU.IsValidTcPosFromHead()
STU.ISVALID = false
for i = 1, #PositionTable do
if PositionTable[i].TcPos == STU.TCPOS then
if PositionTable[i].Head == STU.HEAD then
STU.ISVALID = true
STU.ERR = 0
return
elseif IsInGeomSet(PositionTable[i].Head, STU.HEAD) then
STU.ISVALID = true
STU.ERR = 0
return
end
STU.ISVALID = false
STU.ERR = 0
return
end
end
end
function STU.GetTcPosHeadGroupFromPos()
for i = 1, #PositionTable do
if PositionTable[i].Pos == (POS .. tostring(STU.INDEX)) then
STU.TCPOS = PositionTable[i].TcPos
STU.HEAD = PositionTable[i].Head
STU.GROUP = PositionTable[i].Group
STU.ERR = 0
return
end
end
STU.TCPOS = INVALIDPOS
STU.HEAD = INVALIDPOS
STU.GROUP = INVALIDPOS
STU.ERR = 1
end
function STU.GetPosFromTcPos()
for i = 1, #PositionTable do
if PositionTable[i].TcPos == STU.TCPOS then
STU.POS = PositionTable[i].Pos
STU.ERR = 0
return
end
end
STU.POS = INVALIDPOS
STU.ERR = 1
end
function STU.GetGroupFromTcPos()
for i = 1, #PositionTable do
if PositionTable[i].TcPos == STU.TCPOS then
STU.GROUP = PositionTable[i].Group
STU.ERR = 0
return
end
end
STU.GROUP = INVALIDPOS
STU.ERR = 1
end
function STU.GetHeadFromPos()
for i = 1, #PositionTable do
if PositionTable[i].Pos == (POS .. tostring(STU.INDEX)) then
STU.HEAD = PositionTable[i].Head
STU.ERR = 0
return
end
end
STU.HEAD = INVALIDPOS
STU.ERR = 1
end
function STU.GetTcPosFromPos()
for i = 1, #PositionTable do
if PositionTable[i].Pos == (POS .. tostring(STU.INDEX)) then
STU.TCPOS = PositionTable[i].TcPos
STU.ERR = 0
return
end
end
STU.TCPOS = INVALIDPOS
STU.ERR = 1
end
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
+43
View File
@@ -0,0 +1,43 @@
; Commento per evitare BOM con UTF-8
; Index, Type, Description, Value
; Index = 0,1,..,n
; Type : d=double, l=lenght, s=string, b=boolean, dr=double recalc, sr= string recalc, lr=lenght recalc, br=boolean recalc, th=toolholder
; Description : STEP, SIDESTEP, ...
[DRILL_STD]
0=th,TH,
1=d,STEP
2=s,DOUBLE
[SAW_STD]
0=th,TH,
1=d,STEP
2=d,SIDESTEP
3=b,LONGCUT
[SAW_FLAT]
0=th,TH,
1=d,STEP
2=d,SIDESTEP
3=b,LONGCUT
[MILL_STD]
0=th,TH,
1=d,STEP
2=d,SIDESTEP
3=d,SIDEDEPTH
4=s,DOUBLE
5=dr,TOOL_OVERHANG
[MILL_NOTIP]
0=th,TH,
1=d,STEP
2=d,SIDESTEP
3=d,SIDEDEPTH
4=s,DOUBLE
5=dr,TOOL_OVERHANG
[MORTISE_STD]
0=b,MORTISE
1=d,STEP
2=d,SIDESTEP