- Configurazione macchina in GIT

- Gestione sottopezzo per parete layer. Serve Wall 2.6i1
This commit is contained in:
andrea.villa
2024-08-30 09:01:10 +02:00
parent 0adbca26ec
commit 6aae90fd73
20 changed files with 2825 additions and 93 deletions
+17
View File
@@ -0,0 +1,17 @@
/Tools
/Machinings
/SetUp
/Beam/Ts3Data.bak
/Beam/CutData.lua
/Beam/DrillData.lua
/Beam/MillingData.lua
/Beam/PocketingData.lua
/Beam/SawingData.lua
/Beam/Ts3Data.lua
/Wall/Ts3Data.bak
/Wall/CutData.lua
/Wall/DrillData.lua
/Wall/MillingData.lua
/Wall/PocketingData.lua
/Wall/SawingData.lua
/Wall/Ts3Data.lua
+95
View File
@@ -0,0 +1,95 @@
{
"Lua.diagnostics.globals": [
"EgtSetCurrPhase",
"EmtSetLastError",
"EgtGetFirstNameInGroup",
"EgtGetCurrMachGroup",
"EgtNumToString",
"EMT",
"EgtTdbGetCurrToolParam",
"EgtTdbGetToolFromUUID",
"EgtGetMachiningParam",
"EgtGetOperationName",
"EgtExistsInfo",
"EgtSplitString",
"EgtGetVal",
"EgtExistsFile",
"EgtRenameFile",
"EgtEraseFile",
"EgtCopyFile",
"EgtScale",
"EgtMove",
"EmtAxis",
"EmtHead",
"EmtTcPos",
"EmtUnlinkAllRawPartsFromGroups",
"EmtUnlinkAllFixturesFromGroups",
"EgtSetStatus",
"EgtGetNextRawPart",
"EgtGetNext",
"EgtGetFirstRawPart",
"EgtGetFirstInGroup",
"EgtGetHeadId",
"EmtModifyAxisHome",
"EgtResetAxisPos",
"EgtSetRotAxisBlock",
"EmtModifyHeadAuxDirection",
"EmtModifyExitPosition",
"EgtTdbSetCurrTool",
"EgtSetInfo",
"EmtGeneral",
"EmtTable",
"EmtBase",
"EgtGetStringFromIni",
"EgtOutLog",
"EgtLoadTool",
"EgtGetToolsInCurrSetupPos",
"EgtGetAllTcPosNames",
"EgtSetLevel",
"EgtUnloadTool",
"EgtGetOperationType",
"EgtGetNextOperation",
"EgtGetAxisHomePos",
"EgtOutText",
"EgtPause",
"EgtGetMachiningGeometry",
"EgtRemoveVolZmapPart",
"EgtDraw",
"EgtGetAxisPos",
"EgtSetColor",
"EgtRelocate",
"EgtVolZmapGetEdges",
"EgtSaveObjToFile",
"EgtGetMachGroupName",
"EgtGetCurrMachineDir",
"EgtGetCurrFilePath",
"EgtGetCurrMachineName",
"EgtGetPhaseCount",
"EgtGetIniFile",
"EgtGetTcPosId",
"EgtGetName",
"EgtResetCurrMachining",
"EgtSetCurrMachining",
"EgtGetFirstActiveOperation",
"EgtGetCurrMachining",
"EgtUiUnitsAreMM",
"EgtGroup",
"EgtLineVolZmapInters",
"EgtVolZmapGetPartMinDist",
"EgtVolZmapPartCount",
"EgtGetFirstPartInRawPart",
"EgtGetNextPartInRawPart",
"EgtVolZmapPartVolume",
"EgtSetAxisPos",
"EmtAddCollisionObjEx",
"EgtGetNextActiveOperation",
"EgtVolZmapBox",
"EgtSetName",
"EgtErase",
"EgtSetOperationStatus",
"EgtGetFirstOperation",
"EgtEmptyGroup",
"EgtGetBaseId",
"EgtGetParent"
]
}
+735
View File
@@ -0,0 +1,735 @@
-- Processore macchina Essetre-WallXS by EgalTech s.r.l. 2023/09/11
-- Con controllo numerico TPA
-- 2021/12/10 DS Prima versione
-- 2022/05/05 DS ver 2.4e1 Ora Nailing emette feed di lavoro.
-- 2022/05/12 DS ver 2.4e3 Ora Nailing usa Z di lavorazione come PodBau (affondamento == lunghezza utensile).
-- Variabili di modulo
local MLE_INFO = 'Essetre-WallXS.TPA.mlpe ver.'..PP_VER..' by Egalware s.r.l.'
local TEST_USE = false
---------------------------------------------------------------------
-- *** GENERATION ***
---------------------------------------------------------------------
function OnStart()
-- controllo versione programma
if not EMT.VER or EMT.VER < '2.5g1' then
EmtSetLastError( 1200, 'A newer version of the program is required (minimum EgtMachKernel 2.5g1)')
end
EMT.USETO1 = false -- abilitazione uso origine tavola
EMT.MODAL = true -- abilitazione emissione modale
EMT.INCHES = false -- unità di misura mm/inches
EMT.NUM = false -- abilitazione numerazione linee
--EMT.Nt = 'N' -- token per la numerazione di linea
--EMT.LINENBR = 0 -- numero di linea
--EMT.LINEINC = 1 -- incremento numerazione linee
--EMT.Ft = 'F' -- token per feed
--EMT.St = 'S' -- token per speed
end
---------------------------------------------------------------------
function OnEnd()
-- Ripristino fase iniziale come corrente
EgtSetCurrPhase( 1)
end
---------------------------------------------------------------------
function OnProgramStart()
-- Info da gruppo BtlInfo
local BtlInfoId = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or EgtGetCurrMachGroup() or GDB_ID.NULL
EMT.LOAD90 = EgtGetInfo( BtlInfoId, 'LOAD90', 'i') or 0
local nRefPos = EgtClamp( EgtGetInfo( BtlInfoId, 'REFPOS', 'i') or 1, 1, 8)
if nRefPos <= 4 then
EMT.ORIG = nRefPos
else
EMT.ORIG = nRefPos + 6
end
-- Intestazioni
if not TEST_USE then
EMT.PRODID = EgtGetInfo( BtlInfoId, 'PRODID', 'i') or 0
EMT.PATTID = EgtGetInfo( BtlInfoId, 'PATTID', 'i') or 0
end
EmtOutput( ';LISTA = ' .. tostring( EMT.PRODID or 0))
if EMT.INFO then
EmtOutput( ';'..EMT.INFO)
else
EmtOutput( ';Program Start')
end
EmtOutput( ';'.. MLE_INFO)
-- Indice lavorazione
EMT.CNT = 0
-- Non effettuate lavorazioni con sega a catena sul fianco
EMT.CSAWFIRST = true
-- Non effettuata pausa per rimozione sfridi
EMT.SCRAPFIRST = true
-- Cerco primo utensile su testa 1
EMT.TOOL_1, EMT.TLEN_1 = FindFirstToolOnHead( 'H1')
-- Inizializzazioni varie
EmtOutput( 'M6 T000000')
EmtOutput( 'G49')
-- Inizio lista utensili
EmtOutput( 'M993 (Tool List Start)')
end
---------------------------------------------------------------------
function OnProgramEnd()
EmtOutput( '; *** Program End ***')
EmitCount( false)
EmtOutput( 'M117 P1=0')
-- Dichiarazione conclusione pezzi
if EMT.PRODID then
local sOut = 'M113 P1='..tostring( EMT.PRODID)..' P2='..tostring( EMT.PATTID)..' P3='..tostring( -1)..' P4=2'
EmtOutput( sOut)
end
-- Arresto mandrino
EmtOutput( 'M05')
-- Comando di scarico (M116 P1=indice origine, P2=parcheggio in Zero Macchina)
if not TEST_USE then
EmtOutput( 'M116 P1='..EgtNumToString( EMT.ORIG, 0)..' P2='..EgtNumToString( -ParkY, 0))
end
-- Termino il programma
EmtOutput( 'M02')
end
---------------------------------------------------------------------
function OnToolData()
-- emissione dati utensili
if EMT.HEAD == 'H1' then
local sOut = 'M992 P1=' .. EMT.TCPOS:gsub( 'T', '') .. ' P2=' .. EmtLenToString( EMT.TLEN, 3) .. ' P3=' .. EmtLenToString( EMT.TDIAM, 3) ..
' P4=' .. EmtLenToString( EMT.SMAX, 3) .. ' P5=' .. EmtLenToString( EMT.TTOTLEN, 3)
EmtOutput( sOut)
-- cerco posizione di attrezzaggio del primo utensile di lavorazione
if EMT.TOOL == EMT.TOOL_1 and EMT.TLEN_1 < 215.5 then
EMT.TCPOS_1 = EMT.TCPOS
end
-- emissione dati lama
elseif EMT.HEAD == 'H2' then
local sData = ' P2=' .. EmtLenToString( -SawOffsZ + EMT.TLEN, 3) .. ' P3=' .. EmtLenToString( EMT.TDIAM, 3) ..
' P4=' .. EmtLenToString( EMT.SMAX, 3) .. ' P5=' .. EmtLenToString( EMT.TTOTLEN, 3)
EmtOutput( 'M992 P1=9' .. sData)
EmtOutput( 'M992 P1=10' .. sData)
-- emissione dati sega a catena
elseif EMT.HEAD == 'H3' then
local sData = ' P2=' .. EmtLenToString( ChSawLen, 3) .. ' P3=' .. EmtLenToString( EMT.TLEN, 3) ..
' P4=' .. EmtLenToString( EMT.SMAX, 3) .. ' P5=' .. EmtLenToString( ChSawLen, 3)
EmtOutput( 'M992 P1=101' .. sData)
EmtOutput( 'M992 P1=102' .. sData)
EmtOutput( 'M992 P1=103' .. sData)
EmtOutput( 'M992 P1=104' .. sData)
end
end
---------------------------------------------------------------------
function OnDispositionStart()
--EmtOutput( '(Disposition '..EMT.DISPIND..' = '..EMT.DISPID..')')
EMT.OPEISDISP = true
-- Se prima disposizione
if EMT.PHASE == 1 then
-- terminazione lista utensili
EmtOutput( 'G990 (Tool List End)')
-- Parametri macchina
local d1stNailX, d1stNailY, d1stNailZ = 0, 0, 0
if Nail11 ~= 0 then
d1stNailX = DeltaTabY + DimTabY - Nail11DeltaY
d1stNailY = -DeltaTabX + Nail11DeltaX
d1stNailZ = DeltaTabZ - Nail11DeltaZ
end
local d2ndNailX, d2ndNailY, d2ndNailZ = 0, 0, 0
if Nail12 ~= 0 then
d2ndNailX = DeltaTabY + DimTabY - Nail12DeltaY
d2ndNailY = -DeltaTabX + Nail12DeltaX
d2ndNailZ = DeltaTabZ - Nail12DeltaZ
end
local sOut = 'M114'..' P1='..EgtNumToString( DeltaTabY + DimTabY, 2)..' P2='..EgtNumToString( -DeltaTabX, 2)..
' P3='..EgtNumToString( DeltaTabZ - MillOffs, 2)..' P4='..EgtNumToString( d1stNailX, 2)..
' P5='..EgtNumToString( d1stNailY, 2)..' P6='..EgtNumToString( d1stNailZ, 2)..
' P7='..EgtNumToString( d2ndNailX, 2)..' P8='..EgtNumToString( d2ndNailY, 2)..
' P9='..EgtNumToString( d2ndNailZ, 2)..' P10='..EgtNumToString( MillOffs, 2)
EmtOutput( sOut)
local sOu2 = 'M118'..' P1='..EgtNumToString( Orig2DeltaY, 2)..' P2='..EgtNumToString( -Orig2DeltaX, 2)..' P3='..EgtNumToString( Orig2DeltaZ, 2)..
' P4='..EgtNumToString( Orig3DeltaY, 2)..' P5='..EgtNumToString( -Orig3DeltaX, 2)..' P6='..EgtNumToString( Orig3DeltaZ, 2)..
' P7='..EgtNumToString( Orig4DeltaY, 2)..' P8='..EgtNumToString( -Orig4DeltaX, 2)..' P9='..EgtNumToString( Orig4DeltaZ, 2)..
' P10='..EgtNumToString( Orig5DeltaY, 2)..' P11='..EgtNumToString( -Orig5DeltaX, 2)..' P12='..EgtNumToString( Orig5DeltaZ, 2)..
' P13='..EgtNumToString( Orig6DeltaY, 2)..' P14='..EgtNumToString( -Orig6DeltaX, 2)..' P15='..EgtNumToString( Orig6DeltaZ, 2)..
' P16='..EgtNumToString( Orig7DeltaY, 2)..' P17='..EgtNumToString( -Orig7DeltaX, 2)..' P18='..EgtNumToString( Orig7DeltaZ, 2)..
' P19='..EgtNumToString( Orig8DeltaY, 2)..' P20='..EgtNumToString( -Orig8DeltaX, 2)..' P21='..EgtNumToString( Orig8DeltaZ, 2)
EmtOutput( sOu2)
end
end
---------------------------------------------------------------------
function OnDispositionEnd()
-- Se prima disposizione
if EMT.PHASE == 1 then
-- Dimensioni grezzo
local b3Raw = EgtGetRawPartBBox( EMT.RAWID)
local sOut = 'M115 P1='..EgtNumToString( b3Raw:getDimY(), 0)..' P2='..EgtNumToString( b3Raw:getDimX(), 0)..
' P3='..EgtNumToString( b3Raw:getDimZ(), 0)..' P4='..EgtNumToString( EMT.ORIG, 0)
EmtOutput( sOut)
EMT.ST = b3Raw:getDimZ()
-- Posizione cuffia
--local dHCuff = b3Raw:getDimZ() + 32
--EmtOutput( 'E30039=' .. EgtNumToString( dHCuff * 1000, 0))
-- Eventuale salto a lavorazione in corso
--EmtOutput( 'G79 NE80000')
-- Lancio del carico
if not TEST_USE then
; --EmtOutput( 'M26 E30054=' .. EgtNumToString( EMT.ORIG, 0))
end
-- Dichiarazione inizio lavorazione pezzi
if EMT.PRODID then
local sOut = 'M113 P1='..tostring( EMT.PRODID)..' P2='..tostring( EMT.PATTID)..' P3='..tostring( -1)..' P4=1'
EmtOutput( sOut)
end
end
EMT.OPEISDISP = false
end
---------------------------------------------------------------------
function OnTableData()
end
---------------------------------------------------------------------
function OnFixtureData()
end
---------------------------------------------------------------------
function OnRawMoveData()
end
---------------------------------------------------------------------
function OnToolSelect()
-- se utensile definito (non definito per disposizioni con movimento)
if EMT.TOOL ~= '' then
-- verifiche su utensile
local sTool = EgtTdbGetToolFromUUID( EgtGetMachiningParam( MCH_MP.TUUID) or "")
if sTool ~= EMT.TOOL then error( "Tool name mismatch") end
-- predefinite EMT.TCPOS EMT.HEAD EMT.EXIT
EMT.TOOLTYPE = EgtTdbGetCurrToolParam( MCH_TP.TYPE)
EMT.TOOLSEL = EMT.TCPOS..' M06'
EMT.TDIAM = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
EMT.TTOTDIAM = EgtTdbGetCurrToolParam( MCH_TP.TOTDIAM)
EMT.TLEN = EgtTdbGetCurrToolParam( MCH_TP.LEN)
EMT.TTOTLEN = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
end
end
---------------------------------------------------------------------
function OnToolDeselect()
end
---------------------------------------------------------------------
function OnMachiningStart()
--EMT.MCHLIBNAME = EgtGetMachiningParam( MCH_MP.NAME)
EMT.MCHNAME = EgtGetOperationName( EMT.MCHID)
EMT.MCHTYPE = EgtGetMachiningParam(MCH_MP.TYPE)
-- non ancora iniziata la lavorazione
EMT.MCHFIRST = true
-- primo posizionamento sempre in globale
EMT.REFLOC = nil
EMT.IPLGL = false
end
---------------------------------------------------------------------
function OnMachiningEnd()
if not EMT.ZMAX then
EmtOutput( 'G27')
EmtOutput( 'M6 T000000')
EmtOutput( 'M99')
EmtOutput( 'M117 P1='..tostring( EMT.CNT+1))
end
EMT.PREVTOOL = EMT.TOOL
end
---------------------------------------------------------------------
function OnPathStart()
-- reset valori precedenti (per forzare emissione di tutti gli assi del 1° movimento)
EmtResetPrev()
EMT.FEED_FIRST = true
end
---------------------------------------------------------------------
function OnPathEnd()
if IsNailingHead( EMT.HEAD) then
EmtOutput( EgtIf( EMT.HEAD == 'H11', 'M6 T200000', 'M6 T300000'))
EmtOutput( 'M101 P1='..EmtLenToString( EMT.NAIL_START_L2o, 3)..' P2='..EmtLenToString( -EMT.NAIL_START_L1o, 3)..' P3='..EmtLenToString( EMT.NAIL_START_L3o, 3))
EmtOutput( 'G24'..EMT.NAIL_END)
EmtOutput( 'M24'..EMT.NAIL_END_M)
local bMoreNails = ( abs( EMT.NAIL_END_L1 - EMT.NAIL_START_L1) > 10 or abs( EMT.NAIL_END_L2 - EMT.NAIL_START_L2) > 10)
local dStep = GetValNotes( EgtGetMachiningParam( MCH_MP.USERNOTES), 'Par', 'd') or 100
local dSafeZ = EMT.ST + ( max( EgtGetMachiningParam( MCH_MP.STARTPOS), 10) or 20)
local dDepth = EMT.NAIL_START_L3
EMT.FP = nil
EMT.F = EgtGetMachiningParam( MCH_MP.FEED) or 9876
local sFeed = EmtGetFeed()
EmtOutput( 'G0 X'..EmtLenToString( EMT.NAIL_START_L1, 3)..' Y'..EmtLenToString( EMT.NAIL_START_L2, 3)..' Z'..EmtLenToString( dSafeZ, 3))
EmtOutput( EgtIf( EMT.HEAD == 'H11', 'M121', 'M131'))
EmtOutput( 'G1 X'..EmtLenToString( EMT.NAIL_START_L1, 3)..' Y'..EmtLenToString( EMT.NAIL_START_L2, 3)..' Z'..EmtLenToString( dDepth, 3)..sFeed)
if bMoreNails then
EmtOutput( EgtIf( EMT.HEAD == 'H11', 'M122', 'M132')..' P1='..EmtLenToString( dStep, 3))
EmtOutput( 'G1 X'..EmtLenToString( EMT.NAIL_END_L1, 3)..' Y'..EmtLenToString( EMT.NAIL_END_L2, 3)..' Z'..EmtLenToString( dDepth, 3)..sFeed)
EmtOutput( EgtIf( EMT.HEAD == 'H11', 'M123', 'M133'))
EmtOutput( 'G0 X'..EmtLenToString( EMT.NAIL_END_L1, 3)..' Y'..EmtLenToString( EMT.NAIL_END_L2, 3)..' Z'..EmtLenToString( dSafeZ, 3))
else
EmtOutput( EgtIf( EMT.HEAD == 'H11', 'M122', 'M132')..' P1=0')
EmtOutput( EgtIf( EMT.HEAD == 'H11', 'M123', 'M133'))
EmtOutput( 'G0 X'..EmtLenToString( EMT.NAIL_START_L1, 3)..' Y'..EmtLenToString( EMT.NAIL_START_L2, 3)..' Z'..EmtLenToString( dSafeZ, 3))
end
end
EMT.FEED_FIRST = nil
end
---------------------------------------------------------------------
function OnRapid()
-- se primo movimento della lavorazione, gestione speciale
if EMT.MCHFIRST and not EMT.OPEISDISP then
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
EmtOutput( '; *** '..EMT.MCHNAME..'/'..EMT.TOOL..' ***')
EmitCount( true)
-- se lavorazione con sega a catena
if EMT.HEAD == 'H3' then
-- se prima lavorazione sui fianchi con sega a catena
if EMT.CSAWFIRST and string.sub( EMT.MCHNAME, 1, 5) == 'Csaw_' then
EMT.CSAWFIRST = false
-- pausa per rimozione sfridi
local b3Raw = EgtGetRawPartBBox( EMT.RAWID)
local ParkY = min( -( b3Raw:getMin():getX() - 2000), -MinY)
EmtOutput( ';M104 Y' .. EmtLenToString( ParkY, 3) .. ' ET1' .. GetEF())
-- pre-posizionamento
EmtResetPrev()
local sOut = 'M101' .. GetAxisParam( 'R1', 'P5=')
EmtOutput( sOut)
end
-- altrimenti verifico se necessaria pausa
else
if EMT.SCRAPFIRST and EgtExistsInfo( EMT.MCHID, 'MOVE_AFTER') then
EMT.SCRAPFIRST = false
-- pausa per rimozione sfridi
local b3Raw = EgtGetRawPartBBox( EMT.RAWID)
local ParkY = min( -( b3Raw:getMin():getX() - 2000), -MinY)
EmtOutput( ';M104 Y' .. EmtLenToString( ParkY, 3) .. ' ET1' .. GetEF())
end
end
-- dichiarazione testa e utensile
if not IsNailingHead( EMT.HEAD) then
EmtOutput( 'M6 T101' .. AdjustTcPos( true))
local Speed = EMT.S * EgtIf( EMT.HEAD ~= 'H2', 1, 1.65)
if Speed > 0 then
EmtOutput( 'M3 S' .. EgtNumToString( abs( Speed), 0))
else
EmtOutput( 'M4 S' .. EgtNumToString( abs( Speed), 0))
end
-- primo posizionamento
EmtResetPrev()
local sOut = 'M101' .. GetAxisParam( 'L2', 'P1=') .. GetAxisParam( 'L1', 'P2=') .. GetAxisParam( 'L3', 'P3=') ..
GetAxisParam( 'R2', 'P4=') .. GetAxisParam( 'R1', 'P5=')
EmtOutput( sOut)
end
EMT.REFLOC = 0
EMT.MCHFIRST = false
EMT.ZMAX = false
-- se standard
elseif EMT.FLAG == 0 or EMT.FLAG == 1 or EMT.FLAG == 2 then
-- se necessario, impostazione riferimento locale
if EMT.REFLOC == 0 then
-- calcolo per piano generico
CalcInterpPlane()
EMT.REFLOC = 1
if not IsNailingHead( EMT.HEAD) then
EmtOutput( 'G24'..EMT.IPLGLSTR)
EmtOutput( 'M24'..EMT.IPLGLSTR_M)
end
-- trasformo i punti nel piano
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
EMT.L1p = nil
EMT.L2p = nil
EMT.L3p = nil
EMT.R1p = nil
EMT.R2p = nil
-- emissione movimento
if not IsNailingHead( EMT.HEAD) then
local sOut = 'G0'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..
EmtGetAxis('R2')..EmtGetAxis('R1')
EmtOutput( sOut)
else
EMT.NAIL_START_L1o = EMT.L1o
EMT.NAIL_START_L2o = EMT.L2o
EMT.NAIL_START_L3o = EMT.L3o
EMT.NAIL_START_L1 = EMT.L1
EMT.NAIL_START_L2 = EMT.L2
EMT.NAIL_START_L3 = EMT.L3
EMT.NAIL_END_L1 = EMT.L1
EMT.NAIL_END_L2 = EMT.L2
EMT.NAIL_END = EMT.IPLGLSTR
EMT.NAIL_END_M = EMT.IPLGLSTR_M
end
else
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
-- emissione movimento
if not IsNailingHead( EMT.HEAD) then
local sOut = 'G0'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..
EmtGetAxis('R2')..EmtGetAxis('R1')
EmtOutput( sOut)
else
if EMT.L1 then EMT.NAIL_END_L1 = EMT.L1 end
if EMT.L2 then EMT.NAIL_END_L2 = EMT.L2 end
if EMT.L3 and EMT.L3 < EMT.NAIL_START_L3 then
EMT.NAIL_START_L3 = EMT.L3
end
end
end
-- se altrimenti risalita a Z max a fine lavorazione
elseif EMT.FLAG == 3 then
if not IsNailingHead( EMT.HEAD) then
if EMT.REFLOC then
EMT.REFLOC = nil
EMT.IPLGL = false
EmtResetPrev()
-- dichiarazione fine lavorazione
EmtOutput( 'G27')
EmtOutput( 'M6 T000000')
EmtOutput( 'M99')
EmtOutput( 'M117 P1='..tostring( EMT.CNT+1))
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
local sOut = 'M101' .. GetAxisParam( 'L3', 'P3=') .. GetAxisParam( 'R2', 'P4=') .. GetAxisParam( 'R1', 'P5=')
EmtOutput( sOut)
EMT.ZMAX = true
end
else
EMT.TO_ZMAX = true
end
-- se altrimenti movimento in Home
elseif EMT.FLAG == 4 then
-- non previsto
-- altrimenti errore
else
error( "Unknown Rapid flag")
end
-- aggiorno valori come precedenti
EmtUpdatePrev()
end
---------------------------------------------------------------------
function OnLinear()
-- se necessario, impostazione riferimento locale
if EMT.REFLOC == 0 then
-- calcolo per piano generico
CalcInterpPlane()
EMT.REFLOC = 1
-- salvo posizione attuale
local OldL1 = EMT.L1
local OldL2 = EMT.L2
local OldL3 = EMT.L3
local OldR1p = EMT.R1p
local OldR2p = EMT.R2p
-- imposto posizione precedente
EMT.L1 = EMT.L1o
EMT.L2 = EMT.L2o
EMT.L3 = EMT.L3o
EMT.R1p = nil
EMT.R2p = nil
-- trasformo i punti nel piano
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
if not IsNailingHead( EMT.HEAD) then
EmtOutput( 'G24'..EMT.IPLGLSTR)
EmtOutput( 'M24'..EMT.IPLGLSTR_M)
end
-- emissione movimento
if not IsNailingHead( EMT.HEAD) then
local sOut = 'G0'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..
EmtGetAxis('R2')..EmtGetAxis('R1')
EmtOutput( sOut)
EmtUpdatePrev()
EMT.Fp = nil
else
EMT.NAIL_START_L1o = EMT.L1o
EMT.NAIL_START_L2o = EMT.L2o
EMT.NAIL_START_L3o = EMT.L3o
EMT.NAIL_START_L1 = EMT.L1
EMT.NAIL_START_L2 = EMT.L2
EMT.NAIL_START_L3 = EMT.L3
EMT.NAIL_END_L1 = EMT.L1
EMT.NAIL_END_L2 = EMT.L2
EMT.NAIL_END = EMT.IPLGLSTR
EMT.NAIL_END_M = EMT.IPLGLSTR_M
end
-- ripristino posizione attuale
EMT.L1 = OldL1
EMT.L2 = OldL2
EMT.L3 = OldL3
EMT.R1p = OldR1p
EMT.R2p = OldR2p
end
-- aggiustamento valori
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
if not IsNailingHead( EMT.HEAD) then
-- se inizio lavorazione
if EMT.FEED_FIRST then
EmtOutput( 'M98')
EMT.FEED_FIRST = nil
end
-- valori degli assi
local sAxes = EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..
EmtGetAxis('R2')..EmtGetAxis('R1')
-- se nulla da emettere, esco
if #sAxes == 0 then
return
end
-- aggiungo feed
local sFeed = EmtGetFeed()
-- emetto linea
EmtOutput( "G1"..sAxes..sFeed)
-- eventuale gestione fondo foro
if EMT.FLAG == 101 and EMT.HEAD == 'H5' then
EmtOutput( 'M155')
end
else
if EMT.L1 then EMT.NAIL_END_L1 = EMT.L1 end
if EMT.L2 then EMT.NAIL_END_L2 = EMT.L2 end
if EMT.L3 and EMT.L3 < EMT.NAIL_START_L3 then
EMT.NAIL_START_L3 = EMT.L3
end
end
-- aggiorno valori come precedenti
EmtUpdatePrev()
end
---------------------------------------------------------------------
function OnArc()
-- non modale su archi
local dPrevZ = EMT.L3p
EmtResetPrevLinear()
-- aggiustamento valori
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
if not IsNailingHead( EMT.HEAD) then
-- valori degli assi
local sAxes = EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..
EmtGetAxis('R2')..EmtGetAxis('R1')
-- se nulla da emettere, esco
if #sAxes == 0 then
return
end
-- valori delle coordinate del centro
EmtAdjustCenterAxes()
-- coordinate centro (per ora solo archi nel piano XY)
--local sCen = ' ' .. EMT.C1t .. EmtLenToString(EMT.C1,3) ..
-- ' ' .. EMT.C2t .. EmtLenToString(EMT.C2,3)
-- raggio
local sRad = ' ' .. EMT.RRt .. EmtLenToString(EMT.RR,3)
-- aggiungo feed
local sFeed = EmtGetFeed()
-- tipo arco
local sArc = 'G' .. EgtNumToString(EMT.MOVE,0)
-- emetto arco
EmtOutput( sArc..sAxes..sRad..sFeed)
else
-- Archi non previsti con chiodature
EmtSetLastError( 1212, 'Arcs non allowed with nailing')
end
-- aggiorno valori come precedenti
EmtUpdatePrev()
end
---------------------------------------------------------------------
function MyAdjustLinearAxes()
local MyL1o = EMT.L1
local MyL2o = EMT.L2
local MyL3o = EMT.L3
if EMT.REFLOC then
local vtDelta = V_NULL()
local vtE = V_NULL()
if EMT.HEAD == 'H1' then
local Len = EMT.TLEN + MillOffs
local LenRef = MillOffs
local vtTool = EgtGetCalcToolDirFromAngles( EMT.R1, EMT.R2, EMT.R3)
vtE = vtTool * Len - Z_AX() * LenRef
elseif EMT.HEAD == 'H2' then
local Len = EMT.TLEN + MillOffs - SawOffsZ
local LenRef = MillOffs
local vtTool = EgtGetCalcToolDirFromAngles( EMT.R1, EMT.R2, EMT.R3)
vtE = vtTool * Len - Z_AX() * LenRef
elseif EMT.HEAD == 'H3' then
local Len = ChSawLen + MillOffs
local LenRef = MillOffs
local vtAux = EgtGetCalcAuxDirFromAngles( EMT.R1, EMT.R2, EMT.R3)
vtE = vtAux * Len - Z_AX() * LenRef
elseif EMT.HEAD == 'H11' then
vtDelta = -Vector3d( Nail11DeltaX, Nail11DeltaY, Nail11DeltaZ)
vtE = Z_AX() * EMT.TLEN
elseif EMT.HEAD == 'H12' then
vtDelta = -Vector3d( Nail12DeltaX, Nail12DeltaY, Nail12DeltaZ)
vtE = Z_AX() * EMT.TLEN
end
EMT.L1 = EMT.L1 - vtDelta:getX() - vtE:getX()
EMT.L2 = EMT.L2 - vtDelta:getY() - vtE:getY()
EMT.L3 = EMT.L3 - vtDelta:getZ() - DeltaTabZ - vtE:getZ()
end
EmtAdjustLinearAxes()
EMT.L1o = MyL1o
EMT.L2o = MyL2o
EMT.L3o = MyL3o
if not EMT.REFLOC then
EMT.L1 = - EMT.L1
EMT.L1t = 'Y'
EMT.L2t = 'X'
else
EMT.L1t = 'X'
EMT.L2t = 'Y'
end
end
---------------------------------------------------------------------
function CalcInterpPlane()
-- origine del piano
local xS = EMT.START[1]
local yS = EMT.START[2]
local zS = 0
local ptS = Point3d( xS, yS, zS)
-- calcolo per piano generico
local vtE
if EMT.HEAD ~= 'H3' then
vtE = EgtGetCalcToolDirFromAngles( EMT.R1, EMT.R2, EMT.R3)
else
vtE = EgtGetCalcAuxDirFromAngles( EMT.R1, EMT.R2, EMT.R3)
end
EMT.IPLGLFR = Frame3d( ptS, vtE)
--EmtOutput( 'IPLGLFR='..tostring(EMT.IPLGLFR))
local vtX = EMT.IPLGLFR:getVersX()
local vtY = EMT.IPLGLFR:getVersY()
local vtZ = EMT.IPLGLFR:getVersZ()
-- A seconda del corner di riferimento scelto
local xOut = yS - DeltaTabY - DimTabY
local yOut = - ( xS - DeltaTabX)
local zOut = zS
if EMT.ORIG == 2 then
xOut = yS - DeltaTabY
yOut = - ( xS - DeltaTabX)
elseif EMT.ORIG == 3 then
xOut = yS - DeltaTabY - DimTabY
yOut = - ( xS - DeltaTabX - Orig3DeltaX)
elseif EMT.ORIG == 4 then
xOut = yS - DeltaTabY
yOut = - ( xS - DeltaTabX - Orig3DeltaX)
elseif EMT.ORIG == 11 then
xOut = yS - DeltaTabY - DimTabY
yOut = - ( xS - DeltaTabX - Orig5DeltaX)
elseif EMT.ORIG == 12 then
xOut = yS - DeltaTabY
yOut = - ( xS - DeltaTabX - Orig5DeltaX)
elseif EMT.ORIG == 13 then
xOut = yS - DeltaTabY - DimTabY
yOut = - ( xS - DeltaTabX - DimTabX)
elseif EMT.ORIG == 14 then
xOut = yS - DeltaTabY
yOut = - ( xS - DeltaTabX - DimTabX)
end
EMT.IPLGLSTR = ' X' .. EmtLenToString( xOut) ..' Y' .. EmtLenToString( yOut) .. ' Z' .. EmtLenToString( zOut)..
' A' .. EgtNumToString( vtX:getY(), 6) .. ' B' .. EgtNumToString( -vtX:getX(), 6) .. ' C' .. EgtNumToString( vtX:getZ(), 6) ..
' I' .. EgtNumToString( vtY:getY(), 6) .. ' J' .. EgtNumToString( -vtY:getX(), 6) .. ' K' .. EgtNumToString( vtY:getZ(), 6) ..
' P' .. EgtNumToString( vtZ:getY(), 6) .. ' Q' .. EgtNumToString( -vtZ:getX(), 6) .. ' R' .. EgtNumToString( vtZ:getZ(), 6)
EMT.IPLGLSTR_M = ' P1=' .. EmtLenToString( xOut) ..' P2=' .. EmtLenToString( yOut) .. ' P3=' .. EmtLenToString( zOut)..
' P11=' .. EgtNumToString( vtX:getY(), 6) .. ' P12=' .. EgtNumToString( -vtX:getX(), 6) .. ' P13=' .. EgtNumToString( vtX:getZ(), 6) ..
' P14=' .. EgtNumToString( vtY:getY(), 6) .. ' P15=' .. EgtNumToString( -vtY:getX(), 6) .. ' P16=' .. EgtNumToString( vtY:getZ(), 6) ..
' P17=' .. EgtNumToString( vtZ:getY(), 6) .. ' P18=' .. EgtNumToString( -vtZ:getX(), 6) .. ' P19=' .. EgtNumToString( vtZ:getZ(), 6)
EMT.IPLGL = true
end
---------------------------------------------------------------------
function AdjustTcPos( bLen3, sTcPos, dAxR3)
if not sTcPos then sTcPos = EMT.TCPOS end
local sPos = sTcPos:gsub( 'T', '')
if sPos == '9' then
if not dAxR3 then dAxR3 = EMT.R3 end
if abs( dAxR3 - 0) < 0.1 then
sPos = '9'
elseif abs( dAxR3 + 90) < 0.1 then
sPos = '10'
else
EmtSetLastError( 1210, 'Saw orientation not allowed')
end
elseif sPos == '101' then
if not dAxR3 then dAxR3 = EMT.R3 end
if abs( dAxR3 - 0) < 0.1 then
sPos = '101'
elseif abs( dAxR3 - 270) < 0.1 then
sPos = '102'
elseif abs( dAxR3 - 180) < 0.1 then
sPos = '103'
elseif abs( dAxR3 - 90) < 0.1 then
sPos = '104'
else
EmtSetLastError( 1210, 'Chain saw orientation not allowed')
end
end
if bLen3 then
if #sPos == 1 then
sPos = '00' .. sPos
elseif #sPos == 2 then
sPos = '0' .. sPos
end
end
return sPos
end
---------------------------------------------------------------------
function GetEF()
return ' EF60000'
end
---------------------------------------------------------------------
function GetAxisParam( Ax, sPar)
if EMT[Ax] then
local nDec = EMT.DECNUM or 3
if not EMT.INCHES or (( Ax == 'R1' or Ax == 'R2' or Ax == 'R3' or Ax == 'R4')) then
return ' ' .. sPar .. EgtNumToString( EMT[Ax], nDec), true
else
return ' ' .. sPar .. EgtNumToString( EMT[Ax] / GEO.ONE_INCH, nDec + 1), true
end
end
return '', false
end
---------------------------------------------------------------------
function EmitCount( bJump)
EMT.CNT = EMT.CNT + 1
if bJump then
EmtOutput( 'N'..tostring( EMT.CNT)..' IF VGPL > '..tostring( EMT.CNT)..' GOTO N'..tostring( EMT.CNT+1))
else
EmtOutput( 'N'..tostring( EMT.CNT))
end
end
---------------------------------------------------------------------
function IsNailingHead( sHead)
return ( sHead == 'H11' or sHead == 'H12')
end
---------------------------------------------------------------------
function GetValNotes( sNotes, sKey, sType)
local vsChunk = EgtSplitString( sNotes or '', ';')
local dVal
for i = 1, #vsChunk do
local dTmp = EgtGetVal( vsChunk[i], sKey, sType)
if dTmp then dVal = dTmp end
end
return dVal
end
---------------------------------------------------------------------
-- *** END GENERATION ***
---------------------------------------------------------------------
+1022
View File
File diff suppressed because it is too large Load Diff
+11
View File
@@ -0,0 +1,11 @@
-- Special Operations macchina Essetre-WALL by EgalTech s.r.l. 2020/11/16
-- Intestazioni
require( 'EmtGenerator')
EgtEnableDebug( false)
EgtOutLog ( '** Essetre-WALL.mlse '..PP_VER..' **', 1)
---------------------------------------------------------------------
--function OnSpecialMoveZup()
--end
+58
View File
@@ -0,0 +1,58 @@
; Commento per evitare BOM con UTF-8
[General]
Material=Beam
[Tools]
Drillbit=1
Sawblade=1
Mill=1
Mortise=1
Chisel=0
DrillMaker=MakeWoodDrill.lua
SawbladeMaker=MakeSawblade.lua
MillMaker=MakeWoodCylMill.lua
MortiseMaker=MakeMortise.lua
ChiselMaker=MakeChisel.lua
Active=1
[ToolHolder]
H1.1=Standard.nge
H1.1:MILL_NOTIP=MillNoTip.nge
H2.1=Saw.nge
H3.1=ChainSaw.nge
[Machinings]
Drilling=1
Sawing=1
Milling=1
Pocketing=1
Mortising=1
Chiseling=0
SawRoughing=0
SawFinishing=0
[Machining]
InitScript=InitMach.lua
ExitScript=ExitMach.lua
[Disposition]
;InitScript=InitDisp.lua
[Heads]
; 5 axis head
H1=6608
; 5 axis saw
H2=6615
; Chainsaw
H3=6616
[SetUp]
Default=Standard
[Estimations]
Enable=1
WinPlace=0,514,138,628,810
[VMill]
Enable=1
Save=0
+450
View File
@@ -0,0 +1,450 @@
-- Descrizione macchina Essetre-WallXS0018 by EgalTech s.r.l. 2024/01/29
-- Macchina Wall.
-- 2023/07/05 ver 2.5g1 DS Prima versione partende da WallXS0014.
-- 2023/07/10 ver 2.5g2 DS Corretto aggiornamento Orig2 da dati TS3.
-- 2023/09/07 ver 2.5i1 DS Gestione posizione ruotata per lama (T9 e T10).
-- 2023/09/08 ver 2.5i2 DS Piccola modifica per usare direttamente le note utente dell'utensile se passate.
-- 2023/09/11 ver 2.5i3 DS Modificato solido collisione per asse C per renderlo più vicino al reale.
-- 2024/01/29 ver 2.6a1 In generazione dopo ogni G24 aggiunta scrittura M24 con gli stessi parametri.
-- 2024/08/30 ver 2.6h1 Gestione sottopezzo per parete layer. Serve Wall 2.6i1. Se Wall antecedente, funziona alla vecchia, con pezzo e sottopezzo unico oggetto.
-- Configurazione macchina in GIT
require( 'EmtGenerator')
EgtEnableDebug( false)
PP_VER = '2.6h1'
-- Parametri macchina
NumericalControl = 'TPA' -- NUM o TPA
MinY = 0.0
MaxY = 31000.0
ParkY = 16500.0
MinX = -5400.0
MaxX = 45.0
MinZ = -900.0
MaxZ = 0.0
MinB = -120.0
MaxB = 120.0
MinC = -360.0
MaxC = 360.0
MillOffs = 92.5
ChainSaw = 0
SawOffsX = 0.0
SawOffsY = 111.0
SawOffsZ = -150.0
ChSawLen = 90.0
Nail11 = 1
Nail11DeltaX = 330.0
Nail11DeltaY = 272.6
Nail11DeltaZ = -76.5
Nail12 = 1
Nail12DeltaX = 330.0
Nail12DeltaY = -272.6
Nail12DeltaZ = -76.5
Orig2DeltaX = 0
Orig2DeltaY = -3500
Orig2DeltaZ = 0
Orig3DeltaX = 12160
Orig3DeltaY = 0
Orig3DeltaZ = 0
Orig4DeltaX = 12160
Orig4DeltaY = -3500
Orig4DeltaZ = 0
Orig5DeltaX = 17620
Orig5DeltaY = 0
Orig5DeltaZ = 0
Orig6DeltaX = 17620
Orig6DeltaY = -3500
Orig6DeltaZ = 0
Orig7DeltaX = 28940
Orig7DeltaY = 0
Orig7DeltaZ = 0
Orig8DeltaX = 28940
Orig8DeltaY = -3500
Orig8DeltaZ = 0
DimTabX = 28940.0
DimTabY = 3500.0
DeltaTabX = 1040.0
DeltaTabY = -4580.0
DeltaTabZ = -705.0 + MillOffs -- -612.5
CoeffVM = 1.5
-- Aggiornamento con dati da TechnoEssetre7
local sTs3Data = EgtGetStringFromIni( 'Wall', 'DATA_DIR', "C:\\TechnoEssetre7\\EgtData", EgtGetIniFile()).."\\Essetre-Wall_XS0018.data"
local sData = EgtGetSourceDir().."\\Wall\\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 and Machine.Offsets then
local MchOffs = Machine.Offsets
NumericalControl = EgtIf( MchOffs.TIPO_CN ~= 1, 'NUM', 'TPA')
if MchOffs.MAX_Y then MinY = -MchOffs.MAX_Y end
if MchOffs.MIN_Y then MaxY = -MchOffs.MIN_Y end
if MchOffs.PARK_Y then ParkY = EgtClamp( -MchOffs.PARK_Y, MinY, MaxY) end
MinX = MchOffs.MIN_X or MinX
MaxX = MchOffs.MAX_X or MaxX
MinZ = MchOffs.MIN_Z or MinZ
MaxZ = MchOffs.MAX_Z or MaxZ
MinB = MchOffs.MIN_B or MinB
MaxB = MchOffs.MAX_B or MaxB
MinC = MchOffs.MIN_C or MinC
MaxC = MchOffs.MAX_C or MaxC
MillOffs = MchOffs.PIVOT or MillOffs
if MchOffs.ZERO_Y then DeltaTabX = -MchOffs.ZERO_Y end
if MchOffs.ZERO_X then DeltaTabY = MchOffs.ZERO_X - DimTabY end
if MchOffs.ZERO_Z then DeltaTabZ = MchOffs.ZERO_Z + MillOffs end
ChainSaw = ( MchOffs.CHAIN_SAW or 0)
Nail11 = ( MchOffs.NAIL11 or 0)
if Nail11 ~= 0 and MchOffs.ZERO_Y and MchOffs.ZERO_NAIL11_Y then Nail11DeltaX = - ( MchOffs.ZERO_Y - MchOffs.ZERO_NAIL11_Y) end
if Nail11 ~= 0 and MchOffs.ZERO_X and MchOffs.ZERO_NAIL11_X then Nail11DeltaY = ( MchOffs.ZERO_X - MchOffs.ZERO_NAIL11_X) end
if Nail11 ~= 0 and MchOffs.ZERO_Z and MchOffs.ZERO_NAIL11_Z then Nail11DeltaZ = ( MchOffs.ZERO_Z + MillOffs - MchOffs.ZERO_NAIL11_Z) end
Nail12 = ( MchOffs.NAIL12 or 0)
if Nail12 ~= 0 and MchOffs.ZERO_Y and MchOffs.ZERO_NAIL12_Y then Nail12DeltaX = - ( MchOffs.ZERO_Y - MchOffs.ZERO_NAIL12_Y) end
if Nail12 ~= 0 and MchOffs.ZERO_X and MchOffs.ZERO_NAIL12_X then Nail12DeltaY = ( MchOffs.ZERO_X - MchOffs.ZERO_NAIL12_X) end
if Nail12 ~= 0 and MchOffs.ZERO_Z and MchOffs.ZERO_NAIL12_Z then Nail12DeltaZ = ( MchOffs.ZERO_Z + MillOffs - MchOffs.ZERO_NAIL12_Z) end
if MchOffs.OFFSET_ZERO2_Y then Orig2DeltaX = -MchOffs.OFFSET_ZERO2_Y end
if MchOffs.OFFSET_ZERO2_X then Orig2DeltaY = MchOffs.OFFSET_ZERO2_X end
if MchOffs.OFFSET_ZERO2_Z then Orig2DeltaZ = MchOffs.OFFSET_ZERO2_Z end
if MchOffs.OFFSET_ZERO3_Y then Orig3DeltaX = -MchOffs.OFFSET_ZERO3_Y end
if MchOffs.OFFSET_ZERO3_X then Orig3DeltaY = MchOffs.OFFSET_ZERO3_X end
if MchOffs.OFFSET_ZERO3_Z then Orig3DeltaZ = MchOffs.OFFSET_ZERO3_Z end
if MchOffs.OFFSET_ZERO4_Y then Orig4DeltaX = -MchOffs.OFFSET_ZERO4_Y end
if MchOffs.OFFSET_ZERO4_X then Orig4DeltaY = MchOffs.OFFSET_ZERO4_X end
if MchOffs.OFFSET_ZERO4_Z then Orig4DeltaZ = MchOffs.OFFSET_ZERO4_Z end
if MchOffs.OFFSET_ZERO11_Y then Orig5DeltaX = -MchOffs.OFFSET_ZERO11_Y end
if MchOffs.OFFSET_ZERO11_X then Orig5DeltaY = MchOffs.OFFSET_ZERO11_X end
if MchOffs.OFFSET_ZERO11_Z then Orig5DeltaZ = MchOffs.OFFSET_ZERO11_Z end
if MchOffs.OFFSET_ZERO12_Y then Orig6DeltaX = -MchOffs.OFFSET_ZERO12_Y end
if MchOffs.OFFSET_ZERO12_X then Orig6DeltaY = MchOffs.OFFSET_ZERO12_X end
if MchOffs.OFFSET_ZERO12_Z then Orig6DeltaZ = MchOffs.OFFSET_ZERO12_Z end
if MchOffs.OFFSET_ZERO13_Y then Orig7DeltaX = -MchOffs.OFFSET_ZERO13_Y end
if MchOffs.OFFSET_ZERO13_X then Orig7DeltaY = MchOffs.OFFSET_ZERO13_X end
if MchOffs.OFFSET_ZERO13_Z then Orig7DeltaZ = MchOffs.OFFSET_ZERO13_Z end
if MchOffs.OFFSET_ZERO14_Y then Orig8DeltaX = -MchOffs.OFFSET_ZERO14_Y end
if MchOffs.OFFSET_ZERO14_X then Orig8DeltaY = MchOffs.OFFSET_ZERO14_X end
if MchOffs.OFFSET_ZERO14_Z then Orig8DeltaZ = MchOffs.OFFSET_ZERO14_Z end
DimTabX = Orig7DeltaX
end
end
-- Spostamenti delle chiodatrici rispetto al disegno
local Nail11OffsX = Nail11DeltaX - 330.0
local Nail11OffsY = Nail11DeltaY - 272.6
local Nail11OffsZ = Nail11DeltaZ + 76.5
local Nail12OffsX = Nail12DeltaX - 330.0
local Nail12OffsY = Nail12DeltaY + 272.6
local Nail12OffsZ = Nail12DeltaZ + 76.5
EmtGeneral {
File='Essetre-WALL_XS0018.nge',
Offset = Vector3d( 5420.0, -2830.0, -1408.5),
AxisMaxAdjust = 3250,
ExitMaxAdjust = 3250,
Special = 'Essetre-WALL_XS.mlse',
Processor = 'Essetre-WALL_XS.mlpe'}
local BaseId = EmtBase {
Name = 'Base',
Geo='BASE/GEO',
Aux={'BASE/TAB_PRE', 'BASE/TAB_1', 'BASE/TAB_MID', 'BASE/TAB_2', 'BASE/COLLISION'}}
local vtMove = Vector3d( DeltaTabX - 1040.0, DeltaTabY + 4580.0, DeltaTabZ + 612.5)
EgtMove( BaseId, vtMove, GDB_RT.GLOB)
-- Tavola
local TabId = EmtTable {
Name = 'Tab',
Parent = 'Base',
Type = MCH_TT.FLAT,
Ref1 = Point3d( DeltaTabX, DeltaTabY, DeltaTabZ),
Scale = {DimTabX/28940, DimTabY/3500, 1},
Geo = 'TABLE/GEO'}
-- sposto le linee alla giusta quota
EgtMove( EgtGetFirstNameInGroup( TabId, 'Mid'), Vector3d( Orig3DeltaX, 0, 0), GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( TabId, 'New'), Vector3d( Orig5DeltaX, 0, 0), GDB_RT.GLOB)
-- sposto e scalo le tavole
EgtScale( EgtGetFirstNameInGroup( BaseId, 'TAB_1'), Frame3d( Point3d( DeltaTabX, 0, 0)), ( Orig3DeltaX - 0) / ( 12160 - 0), 1, 1, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( BaseId, 'TAB_MID'), Vector3d( Orig3DeltaX - 12160, 0, 0), GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( BaseId, 'TAB_2'), Vector3d( Orig5DeltaX - 17620, 0, 0), GDB_RT.GLOB)
EgtScale( EgtGetFirstNameInGroup( BaseId, 'TAB_2'), Frame3d( Point3d( DeltaTabX + Orig5DeltaX, 0, 0)), ( Orig7DeltaX - Orig5DeltaX) / ( 28940 - 17620), 1, 1, GDB_RT.GLOB)
-- Traversa
local YId = EmtAxis {
Name = 'Y',
Parent = 'Base',
Invert = true,
Type = MCH_AT.LINEAR,
Dir = X_AX(),
Pos = Point3d( 0, 0, 0),
Stroke = {MinY, MaxY},
Home = ParkY,
Geo = 'Y_AXIS/GEO',
Aux = {'Y_AXIS/SOLID'}}
-- Testa cambia utensili
EmtAxis {
Name = 'X',
Parent = 'Y',
Token = 'X',
Type = MCH_AT.LINEAR,
Dir = Y_AX(),
Pos = Point3d( 0, 0, 0),
Stroke = {MinX, MaxX},
Home = ( MinX + MaxX) / 2,
Geo = 'X_AXIS/GEO',
Aux = {'X_AXIS/SOLID'}}
EmtAxis {
Name = 'Z',
Parent = 'X',
Token = 'Z',
Type = MCH_AT.LINEAR,
Dir = Z_AX(),
Pos = Point3d( 0, 0, 0),
Stroke = {MinZ, MaxZ},
Home = 0,
Geo = 'Z_AXIS/GEO',
Aux = {'Z_AXIS/SOLID'}}
-- Chiodatrici
local H11Id, H12Id
if Nail11 ~= 0 then
H11Id = EmtHead {
Name = 'H11',
Parent = 'Z',
HSet = 'H11',
Type = MCH_HT.STD,
Pos = Point3d( Nail11DeltaX, Nail11DeltaY, Nail11DeltaZ),
TDir = Z_AX(),
Geo = 'H11_HEAD/GEO',
Aux = {'H11_HEAD/SOLID'}}
EgtMove( EgtGetFirstNameInGroup( H11Id, 'SOLID'), Vector3d( Nail11OffsX, Nail11OffsY, Nail11OffsZ), GDB_RT.GLOB)
end
if Nail12 ~= 0 then
H12Id = EmtHead {
Name = 'H12',
Parent = 'Z',
HSet = 'H12',
Type = MCH_HT.STD,
Pos = Point3d( Nail12DeltaX, Nail12DeltaY, Nail12DeltaZ),
TDir = Z_AX(),
Geo = 'H12_HEAD/GEO',
Aux = {'H12_HEAD/SOLID'}}
EgtMove( EgtGetFirstNameInGroup( H12Id, 'SOLID'), Vector3d( Nail12OffsX, Nail12OffsY, Nail12OffsZ), GDB_RT.GLOB)
end
-- Assi rotanti
EmtAxis {
Name = 'C',
Parent = 'Z',
Token = 'C',
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'}}
EmtAxis {
Name = 'B',
Parent = 'C',
Token = 'B',
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'}}
-- Testa principale
EmtHead {
Name = 'H1',
Parent = 'B',
HSet = 'H1',
Type = MCH_HT.STD,
Pos = Point3d( 0, 0, 0),
TDir = Z_AX(),
ADir = Y_AX(),
Rot1W = 0.1,
OthColl = {'B/SOLID', 'C/SOLID'},
Geo = 'H1_HEAD/GEO'}
-- Lama su aggregato
EmtAxis {
Name = 'A2',
Parent = 'B',
Token = '**',
Type = MCH_AT.ROTARY,
Dir = Z_AX(),
Pos = Point3d( 0, 0, 0),
Stroke = { -90, 0},
Home = 0,
Geo = 'A2_AXIS/GEO'}
local H2Id = EmtHead {
Name = 'H2',
Parent = 'A2',
HSet = 'H1',
Type = MCH_HT.STD,
Pos = Point3d( SawOffsX, SawOffsY, SawOffsZ),
TDir = Z_AX(),
ADir = -Y_AX(),
Rot1W = 0.1,
OthColl = {'B/SOLID', 'C/SOLID'},
Geo = 'H2_HEAD/GEO'}
EgtSetInfo( H2Id, 'Gearbox', 1)
-- ToolChanger
local ptTcC = Point3d( -288, 5, -533.5)
local ptTc9 = Point3d( 0, -5630, -303.5)
EmtTcPos {
Name = 'T1',
Parent = 'Y',
Pos = ptTcC + VectorFromPolar( 288, 0),
TDir = Z_AX(),
ADir = -Y_AX(),
Geo = 'Y_AXIS/T1'}
EmtTcPos {
Name = 'T2',
Parent = 'Y',
Pos = ptTcC + VectorFromPolar( 288, 45),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'Y_AXIS/T2'}
EmtTcPos {
Name = 'T3',
Parent = 'Y',
Pos = ptTcC + VectorFromPolar( 288, 90),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'Y_AXIS/T3'}
EmtTcPos {
Name = 'T4',
Parent = 'Y',
Pos = ptTcC + VectorFromPolar( 288, 135),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'Y_AXIS/T4'}
EmtTcPos {
Name = 'T5',
Parent = 'Y',
Pos = ptTcC + VectorFromPolar( 288, 180),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'Y_AXIS/T5'}
EmtTcPos {
Name = 'T6',
Parent = 'Y',
Pos = ptTcC + VectorFromPolar( 288, 225),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'Y_AXIS/T6'}
EmtTcPos {
Name = 'T7',
Parent = 'Y',
Pos = ptTcC + VectorFromPolar( 288, 270),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'Y_AXIS/T7'}
EmtTcPos {
Name = 'T8',
Parent = 'Y',
Pos = ptTcC + VectorFromPolar( 288, 315),
TDir = Z_AX(),
ADir = X_AX(),
Geo = 'Y_AXIS/T8'}
EmtTcPos {
Name = 'T9',
Parent = 'Y',
Pos = ptTc9 + Vector3d( SawOffsX, -SawOffsY, SawOffsZ),
TDir = Z_AX(),
ADir = Y_AX(),
Geo = 'Y_AXIS/T9'}
---------------------------------------------------------------------
-- Funzioni richiamate per modificare i dati macchina in casi particolari
--function OnSetTable()
--end
---------------------------------------------------------------------
local function MoveGroup( 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 OnSetHead()
if H11Id then
local dPos = EgtIf( EMC.HEAD == 'H11', 0, 650)
MoveGroup( EgtGetFirstNameInGroup( H11Id, 'SOLID'), Z_AX(), dPos, true)
MoveGroup( EgtGetFirstNameInGroup( H11Id, 'T1'), Z_AX(), dPos, true)
end
if H12Id then
local dPos = EgtIf( EMC.HEAD == 'H12', 0, 650)
MoveGroup( EgtGetFirstNameInGroup( H12Id, 'SOLID'), Z_AX(), dPos, true)
MoveGroup( EgtGetFirstNameInGroup( H12Id, 'T1'), Z_AX(), dPos, true)
end
if EMC.HEAD == 'H11' or EMC.HEAD == 'H12' then
EmtModifyAxisHome( 'B', 90)
EgtResetAxisPos( 'B')
else
if EMC.HEAD == 'H2' then
if not EMC.USERNOTES then
local sCurrTool = EgtTdbGetCurrToolParam( MCH_TP.NAME)
if sCurrTool ~= EMC.TOOL then
EgtTdbSetCurrTool( EMC.TOOL)
EMC.USERNOTES = EgtTdbGetCurrToolParam( MCH_TP.USERNOTES)
EgtTdbSetCurrTool( sCurrTool)
else
EMC.USERNOTES = EgtTdbGetCurrToolParam( MCH_TP.USERNOTES)
end
end
local nPos = EgtGetValInNotes( EMC.USERNOTES, 'POS', 'i')
if nPos == 2 then
EmtModifyHeadAuxDirection( 'H2', X_AX())
EmtModifyAxisHome( 'A2', -90)
EgtResetAxisPos( 'A2')
EgtSetRotAxisBlock( 'A2', -90)
else
EmtModifyHeadAuxDirection( 'H2', -Y_AX())
EmtModifyAxisHome( 'A2', 0)
EgtResetAxisPos( 'A2')
EgtSetRotAxisBlock( 'A2', 0)
end
elseif EMC.HEAD == 'H3' then
-- aggiustamenti per distanza da naso mandrino
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
EmtModifyAxisHome( 'B', 0)
end
end
---------------------------------------------------------------------
-- Funzione per resettare tutte le attivazioni della macchina
function OnResetMachine()
EmtUnlinkAllRawPartsFromGroups()
EmtUnlinkAllFixturesFromGroups()
EMC = { HEAD='H1'}
OnSetHead()
-- nascondo Vmill
local nRawId = EgtGetFirstRawPart()
while nRawId do
local nId = EgtGetFirstInGroup( nRawId)
while nId do
if EgtGetInfo( nId, 'N', 's') == 'VMill' then
EgtSetStatus( nId, GDB_ST.OFF)
else
EgtSetStatus( nId, GDB_ST.ON)
end
nId = EgtGetNext( nId)
end
nRawId = EgtGetNextRawPart( nRawId)
end
EgtSetStatus( EgtGetFirstNameInGroup( GDB_ID.ROOT, 'VMill') or GDB_ID.NULL, GDB_ST.OFF)
end
Binary file not shown.
-93
View File
@@ -1,93 +0,0 @@
# Essetre-WALL_XS0018
## 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/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
```
cd existing_repo
git remote add origin https://gitlab.steamware.net/egalware-machines/essetre/essetre-wall_xs0018.git
git branch -M main
git push -uf origin main
```
## Integrate with your tools
- [ ] [Set up project integrations](https://gitlab.steamware.net/egalware-machines/essetre/essetre-wall_xs0018/-/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/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
## 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/index.html)
- [ ] [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.
+36
View File
@@ -0,0 +1,36 @@
-- 2018/11/21 17:30:00
-- Machining Exit for Essetre-FAST machine
-- Intestazioni
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( false)
--------------------------------------------------------------------------------
-- *** Uscita da Lavorazioni ***
-- Nascondo il pezzo così marcato e le geometrie aggiunte, visualizzo il Box
local function ProcessPart( PartId)
-- visualizzo il Box
EgtSetStatus( EgtGetFirstNameInGroup( PartId, 'Box') or GDB_ID.NULL, GDB_ST.ON)
end
-- Disabilito segnalazione modifica progetto
local bEnMod = EgtGetEnableModified()
EgtDisableModified()
-- Processo i pezzi nella radice (già chiusi tutti i gruppi di lavoro)
local PartId = EgtGetFirstPart()
while PartId do
ProcessPart( PartId)
PartId = EgtGetNextPart( PartId)
end
EgtZoom( SCE_ZM.ALL, false)
-- Ripristino segnalazione modifica progetto
if bEnMod then
EgtEnableModified()
end
MACH.ERR = 0
+44
View File
@@ -0,0 +1,44 @@
-- 2018/11/21 16:30:00
-- Machining Init for Essetre-FAST machine
-- Intestazioni
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( false)
--------------------------------------------------------------------------------
-- *** Ingresso in Lavorazioni ***
-- Rendo visibile il pezzo e le geometrie aggiunte, nascondo il Box
local function ProcessPart( PartId)
-- nascondo il Box
EgtSetStatus( EgtGetFirstNameInGroup( PartId, 'Box') or GDB_ID.NULL, GDB_ST.OFF)
end
-- Disabilito segnalazione modifica progetto
local bEnMod = EgtGetEnableModified()
EgtDisableModified()
-- Processo i pezzi nella radice
local PartId = EgtGetFirstPart()
while PartId do
ProcessPart( PartId)
PartId = EgtGetNextPart( PartId)
end
-- Processo i pezzi già nei gruppi di lavoro (quando appena lanciata Process)
local GhostId = EgtGetFirstGhostPart()
while GhostId do
local PartId = EgtGetInfo( GhostId, GDB_SI.SOURCE, 'i')
if PartId then
ProcessPart( PartId)
end
GhostId = EgtGetNextGhostPart( GhostId)
end
-- Ripristino segnalazione modifica progetto
if bEnMod then
EgtEnableModified()
end
MACH.ERR = 0
+209
View File
@@ -0,0 +1,209 @@
-- 2023/09/07
-- Gestione attrezzaggio per Essetre-WallXS0018
-- 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 = "T9", Head = "H2", Group = "G1"},
{Pos = "Pos2", TcPos = "T1", Head = "H1", Group = "G2"},
{Pos = "Pos3", TcPos = "T2", Head = "H1", Group = "G2"},
{Pos = "Pos4", TcPos = "T3", Head = "H1", Group = "G2"},
{Pos = "Pos5", TcPos = "T4", Head = "H1", Group = "G2"},
{Pos = "Pos6", TcPos = "T5", Head = "H1", Group = "G2"},
{Pos = "Pos7", TcPos = "T6", Head = "H1", Group = "G2"},
{Pos = "Pos8", TcPos = "T7", Head = "H1", Group = "G2"},
{Pos = "Pos9", TcPos = "T8", Head = "H1", Group = "G2"}}
local bNail11 = ( EgtGetHeadId( 'H11') ~= nil)
local bNail12 = ( EgtGetHeadId( 'H12') ~= nil)
if bNail11 then
table.insert( PositionTable, {Pos = "Pos10", TcPos = "T11", Head = "H11", Group = "G3"})
end
if bNail12 then
if bNail11 then
table.insert( PositionTable, {Pos = "Pos11", TcPos = "T12", Head = "H12", Group = "G3"})
else
table.insert( PositionTable, {Pos = "Pos10", TcPos = "T12", Head = "H12", Group = "G3"})
end
end
local UsePositionHead = true
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 == nill 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.
BIN
View File
Binary file not shown.
Binary file not shown.
+24
View File
@@ -0,0 +1,24 @@
[Cut]
1=Standard
[Drill]
1=Drill
2=Pocket
[Milling]
1=FreeContour
2=Side
3=SideGroove
4=DtMortise
5=Mark
6=Text
7=CleanCorner60
8=CleanCorner30
9=Nailing
[Pocketing]
1=Pocket
2=Mortise
[Sawing]
1=Sawing
+3
View File
@@ -0,0 +1,3 @@
[WALL]
Kerf=10
Offset=25
+112
View File
@@ -0,0 +1,112 @@
-- WallData.lua by Egaltech s.r.l. 2022/07/05
-- Raccolta dati generali per Pareti
EgtOutLog( ' Wall_XS0018-WallData started', 1)
-- Tabella per definizione modulo
local WallData = {
MIN_LENGTH = 100, -- lunghezza minima del grezzo
MIN_WIDTH = 100, -- larghezza minima del grezzo
MIN_HEIGHT = 10, -- altezza minima del grezzo
MAX_LENGTH = 18000, -- lunghezza massima del grezzo
MAX_WIDTH = 4900, -- larghezza massima del grezzo
MAX_HEIGHT = 400, -- altezza massima del grezzo
STD_RAW_LENGTH = 10000, -- lunghezza standard del grezzo
STD_RAW_WIDTH = 4000, -- larghezza standard del grezzo
OVM_HEAD = 60, -- sovramateriale testa
OVM_MID = 50, -- sovramateriale intermedio
COLL_SIC = 5, -- distanza di sicurezza per collisioni
CUT_SIC = 20, -- distanza di sicurezza per tagli
CUT_EXTRA = 0, -- affondamento extra standard per tagli di lama e fresature
CUT_EXTRA_MIN = 0, -- affondamento extra ridotto per tagli di lama e fresature
NZ_MINA = 0.5, -- componente limite in Z normale di una faccia (-30deg)
NZ_MINB = -0.4, -- componente limite in Z normale di un insieme di facce (-23deg)
DRILL_TOL = 0.5, -- tolleranza tra diametro foro e diametro punta
DRILL_VZ_MIN = 0.5, -- componente limite in Z del versore di un foro
DRILL_VX_MAX = 0.866, -- componente limite in X del versore di un foro sulle facce laterali
DRILL_OVERLAP = 5, -- sovrapposizione tra due mezze forature
MILL_OVERLAP = 5, -- sovrapposizione tra due mezze fresature
RAWCOL = { 255, 160, 32, 30}, -- colore del grezzo
SIMUL_VIEW_DIR = 3, -- direzione di vista predefinita per la simulazione (1=NW, 2=SW, 3=NE, 4=SE)
ORIG_CORNER = 'TL', -- angolo tavola per origine di battuta (BR (default), TR, BL, TL)
MAX_CLEAN_CRN30 = 60, -- massimo spessore per pulitura angolo con fresa 30deg
MIN_DIM_ALLOW_CLEAN = 200, -- apertura minima per lavorazione pulitura spigolo
USE_POSY = true, -- utilizzare POSY di BTL (spostamento sullo spessore per pareti a layer)
MILL_MAX_DEPTH_AS_MAT = true, -- massimo affondamento frese uguale ad altezza tagliente (max materiale)
CHECK_MIN_Z_SAW = false, -- controlla la quota minima della lama rispetto alla tavola (default true)
TAB_EXTRA_XP = 3000, -- extra spazio su tavola per grezzo in X più
TAB_EXTRA_XM = 0, -- extra spazio su tavola per grezzo in X meno
TAB_EXTRA_YP = 0, -- extra spazio su tavola per grezzo in Y più
TAB_EXTRA_YM = 100, -- extra spazio su tavola per grezzo in Y meno
MID_REF = 11980, -- offset X per origini TM e BM
NEW_REF = 17440, -- offset X per origini TN e BN
DELTA_Y = 0, -- allontanamento in Y dai riferimenti
DELTA_Z = 0 -- sollevamento dalla tavola
}
-- Aggiornamento con dati da TechnoEssetre7
local sTs3Data = EgtGetStringFromIni( 'Wall', 'DATA_DIR', "C:\\TechnoEssetre7\\EgtData", EgtGetIniFile()).."\\Essetre-Wall_XS0018.data"
local sData = EgtGetSourceDir().."\\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.Trave then
WallData.MIN_LENGTH = Machine.Trave.YMIN or WallData.MIN_LENGTH
WallData.MIN_WIDTH = Machine.Trave.XMIN or WallData.MIN_WIDTH
WallData.MIN_HEIGHT = Machine.Trave.ZMIN or WallData.MIN_HEIGHT
WallData.MAX_LENGTH = Machine.Trave.YMAX or WallData.MAX_LENGTH
WallData.MAX_WIDTH = Machine.Trave.XMAX or WallData.MAX_WIDTH
WallData.MAX_HEIGHT = Machine.Trave.ZMAX or WallData.MAX_HEIGHT
end
if Machine.Offsets then
WallData.DELTA_Y = Machine.Offsets.DELTA_X or WallData.DELTA_Y
WallData.DELTA_Z = Machine.Offsets.DELTA_Z or WallData.DELTA_Z
WallData.MID_REF = - ( Machine.Offsets.OFFSET_ZERO3_Y or - WallData.MID_REF)
WallData.NEW_REF = - ( Machine.Offsets.OFFSET_ZERO11_Y or - WallData.NEW_REF)
end
end
end
-------------------------------------------------------------------------------------------------------------
local function GetSawHeadSide( dSpeed, sHead)
local sMchNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
if not sMchNotes or not string.find( sMchNotes, 'PULL;', 1, true) then
return EgtIf( dSpeed < 0, MCH_SAW_HS.LEFT, MCH_SAW_HS.RIGHT)
else
return EgtIf( dSpeed > 0, MCH_SAW_HS.LEFT, MCH_SAW_HS.RIGHT)
end
end
WallData.GetSawHeadSide = GetSawHeadSide
-------------------------------------------------------------------------------------------------------------
local function GetOrigCorner( RefPos)
if RefPos == 1 then
return 'TL'
elseif RefPos == 2 then
return 'BL'
elseif RefPos == 3 then
return 'TM'
elseif RefPos == 4 then
return 'BM'
elseif RefPos == 5 then
return 'TN'
elseif RefPos == 6 then
return 'BN'
elseif RefPos == 7 then
return 'TR'
elseif RefPos == 8 then
return 'BR'
else
return 'TL'
end
end
WallData.GetOrigCorner = GetOrigCorner
---------------------------------------------------------------------
return WallData
+9
View File
@@ -0,0 +1,9 @@
-- %TABLE_NAME%.lua by Egaltech s.r.l. %DATE_TIME%
-- Gestione dati lavorazioni per Travi
-- Tabella per definizione modulo
local %TABLE_NAME% = {
}
---------------------------------------------------------------------
return %TABLE_NAME%