Compare commits

..

41 Commits

Author SHA1 Message Date
luca.mazzoleni b0b8e88c30 - Alcune correzioni minori
- Sistemati commenti
2023-06-06 12:54:35 +02:00
luca.mazzoleni d020fa143c - aggiunta gestione step verticale
- correzioni minori
2023-05-29 18:01:59 +02:00
luca.mazzoleni eeb34638cf - da testare funzionamento corretto
- da implementare step verticali
2023-05-26 18:12:53 +02:00
luca.mazzoleni 7f2d1895a1 Merge branch 'feature/OperationPriorityFromBtl' into develop 2023-05-26 13:03:54 +02:00
luca.mazzoleni 766bd61981 - sistemati commenti
- lettura costante BTL_PRIORITY da WallData
- altre piccole correzioni
2023-05-25 15:58:00 +02:00
luca.mazzoleni 1102a7c23a -aggiunta possibilità di scegliere l'ordine del sorting crescente o decrescente
-manca costante da WD
2023-05-24 17:45:28 +02:00
luca.mazzoleni 358df3cfdb prima versione funzionante completamente 2023-05-24 11:48:51 +02:00
luca.mazzoleni bd0dbbb41c modificata funzioni di sorting per gestire priorità 2023-05-23 18:25:16 +02:00
luca.mazzoleni 2606cf4f13 Merge branch 'develop' into feature/OperationPriorityFromBtl 2023-05-16 16:42:47 +02:00
luca.mazzoleni e63b498902 piccola correzione messaggio 2023-05-16 16:42:32 +02:00
luca.mazzoleni 63a3cfe698 primo implemento ciclo priorità 2023-05-15 13:31:33 +02:00
luca.mazzoleni 78cf115748 update gitignore 2023-05-09 09:02:27 +02:00
luca.mazzoleni ac853fc74c Merge remote-tracking branch 'origin/master' into develop 2023-05-04 12:53:19 +02:00
DarioS a5cc30adfc DataWall 2.5e1 :
- modifiche per gestione traduzione messaggi (possibile solo con interfaccia utente B&W).
2023-05-04 12:21:34 +02:00
luca.mazzoleni 1a1d48a2c1 update log modifiche 2023-04-21 10:13:00 +02:00
luca.mazzoleni a05741f7be Merge remote-tracking branch 'origin/master' into develop 2023-04-18 09:00:39 +02:00
DarioS 5da9d312d8 DataWall :
- in gestione batch TS3v7 aggiunta gestione flag per rotazione grezzo di 180deg (da parametro macchina WD.RAWPART_ROT)
- in DoubleCut passate a LapJoint si trasforma il Gruppo da 1 a 3 e da 2 a 4 (altrimenti sbaglia a ordinare le facce)
- in FreeContour e LapJoint la lavorazione CleanCorner viene sempre forzata con lato di lavoro in centro
- in LapJoint razionalizzata gestione parametri Q ed eliminta gestione forzatura lama non usatain realtà.
2023-04-17 17:40:28 +02:00
luca.mazzoleni d704e899a2 Merge remote-tracking branch 'origin/master' into develop 2023-04-17 10:26:42 +02:00
DarioS 5b0a274f00 DataWall 2.5d2 :
- in gestione batch TS3v7 aggiunta gestione flag per taglio feature con outline (da parametro macchina WD.CUT_WITH_OUTLINE)
- in FreeContour e assimilati aggiunta pulitura spigoli Q05=1 anche su sole fresature
- in LapJoint e assimilati corretta scelta tipo lavorazione 'SideGroove' aggiungendo massimo spessore
- in LapJoint con lavorazione di lato se MCH_SCC.ADIR_NEAR fa fallire Apply si riprova con MCH_SCC.ADIR_FAR.
2023-04-17 09:38:38 +02:00
DarioS 5fb1ffb86b Merge remote-tracking branch 'origin/master' 2023-04-14 19:13:16 +02:00
luca.mazzoleni c6cf8c9df3 Merge branch 'develop' 2023-04-06 16:00:29 +02:00
luca.mazzoleni 39d1c1dbd8 update log modifiche 2023-04-06 16:00:04 +02:00
luca.mazzoleni a0668a0f6d Merge tag '2.5d1' into develop
Finish Release: 2.5d1
2023-04-06 12:53:39 +02:00
luca.mazzoleni 53c68f8126 Merge branch 'release/2.5d1' 2023-04-06 12:53:38 +02:00
luca.mazzoleni ce835200c2 update version 2023-04-06 12:53:01 +02:00
luca.mazzoleni a941ba0d0d Merge branch 'release/2.5d1' 2023-04-06 12:51:00 +02:00
luca.mazzoleni e475c01057 Merge tag '2.5d1' into develop
Finish Release: 2.5d1
2023-04-06 12:51:00 +02:00
luca.mazzoleni 03647ee74c Merge branch 'master' into develop 2023-04-06 11:44:22 +02:00
DarioS 22f100ff6c DataWall 2.5c6 :
- aggiornamento versione.
2023-03-27 20:58:17 +02:00
SaraP 3d0d6526ca DataWall :
- nel nesting aggiunti valori di default per alcuni dati letti dal WallData
- migliorie stilistiche.
2023-03-24 11:13:17 +01:00
luca.mazzoleni a911191d5b Merge tag '2.5c5' into develop
Finish Release: 2.5c5
2023-03-22 17:42:46 +01:00
luca.mazzoleni aeba5edbad Merge branch 'release/2.5c5' 2023-03-22 17:42:46 +01:00
luca.mazzoleni 763ca86371 2.5c5:
- In LapJoint -> MakeByMill gestito correttamente il caso di Workside destro
2023-03-22 16:36:20 +01:00
luca.mazzoleni e6e9790a9c Merge remote-tracking branch 'origin/master' into develop 2023-03-22 16:34:12 +01:00
Samuele Locatelli becd669f6d Merge branch 'develop' 2023-03-21 15:26:22 +01:00
Samuele Locatelli 2fb6729240 Fix compilazione su disco rete lua scripts 2023-03-21 15:25:54 +01:00
DarioS a3ad73b4a0 DataWall :
- corretta replica come Beam.
2023-03-21 12:02:32 +01:00
DarioS e88e056c89 DataWall :
- aggiunti a Version.lua NAME e MIN_EXE.
2023-03-21 10:16:50 +01:00
luca.mazzoleni 3853e7c0c7 piccola correzione alle fessure poco inclinate con lama 2023-03-10 11:29:36 +01:00
luca.mazzoleni 4c41ecc7cb 2.5c4:
- in LapJoint aggiunta lavorazione fessure poco inclinate con lama
2023-03-09 17:40:24 +01:00
luca.mazzoleni b7384b9635 Merge branch 'BugFix/MisrecognizedUShapeLapjoint' into develop 2023-03-09 09:38:22 +01:00
19 changed files with 751 additions and 771 deletions
+1
View File
@@ -19,3 +19,4 @@
/bin/*.ini /bin/*.ini
/bin/LuaLibs/*.lua /bin/LuaLibs/*.lua
/bin/Images/*.png /bin/Images/*.png
.vscode/settings.json
+16 -13
View File
@@ -2,7 +2,7 @@ variables:
VERS_MAIN: '1.0' VERS_MAIN: '1.0'
APP_NAME: 'Wall' APP_NAME: 'Wall'
NEW_REL: '' NEW_REL: ''
NET_SHARE_R: '\\10.74.82.201\EgwTech' NET_SHARE_X: '\\10.74.82.201\EgwTech'
NET_SHARE_Z: '\\10.74.82.201\Artifacts' NET_SHARE_Z: '\\10.74.82.201\Artifacts'
NET_USERQ: 'steamw\egalware' NET_USERQ: 'steamw\egalware'
@@ -34,29 +34,32 @@ variables:
echo "lua54 -o bin\LuaLibs\$FileName LuaLibs\$FileName" echo "lua54 -o bin\LuaLibs\$FileName LuaLibs\$FileName"
} }
# helper copia SORGENTI verso cartella di rete R:\ dei SORGENTI # helper copia SORGENTI verso cartella di rete X:\ dei SORGENTI
.CodeReplicaR: &CodeReplicaR .CodeReplicaR: &CodeReplicaR
- | - |
net use R: /delete net use X: /delete
net use R: $env:NET_SHARE_R /u:$env:NET_USERQ $ZDRIVE_PASSWD
ROBOCOPY . R:\EgtData\$env:APP_NAME /MIR /XF .git* /XD .git
SLEEP 2 SLEEP 2
net use R: /delete net use X: $env:NET_SHARE_X /u:$env:NET_USERQ $ZDRIVE_PASSWD
ROBOCOPY . X:\EgtData\$env:APP_NAME /MIR /XF .git* /XD .git
SLEEP 2
net use X: /delete
# helper copia script verso cartella di rete R:\ delle cartelle bin # helper copia script verso cartella di rete X:\ delle cartelle bin
.ReplicaR: &ReplicaR .ReplicaR: &ReplicaR
- | - |
net use R: /delete net use X: /delete
net use R: $env:NET_SHARE_R /u:$env:NET_USERQ $ZDRIVE_PASSWD
ROBOCOPY /MIR bin R:\EgtData\$env:APP_NAME\bin
ROBOCOPY /MIR Images R:\EgtData\$env:APP_NAME\bin\Images
SLEEP 2 SLEEP 2
net use R: /delete net use X: $env:NET_SHARE_X /u:$env:NET_USERQ $ZDRIVE_PASSWD
ROBOCOPY /MIR bin X:\EgtData\$env:APP_NAME\bin
ROBOCOPY /MIR Images X:\EgtData\$env:APP_NAME\bin\Images
SLEEP 2
net use X: /delete
# helper copia script verso cartella di rete R:\ delle cartelle bin # helper copia script verso cartella di rete X:\ delle cartelle bin
.ReplicaZ: &ReplicaZ .ReplicaZ: &ReplicaZ
- | - |
net use Z: /delete net use Z: /delete
SLEEP 2
net use Z: $env:NET_SHARE_Z /u:$env:NET_USERQ $ZDRIVE_PASSWD net use Z: $env:NET_SHARE_Z /u:$env:NET_USERQ $ZDRIVE_PASSWD
ROBOCOPY /MIR bin Z:\EgtData\$env:APP_NAME\bin ROBOCOPY /MIR bin Z:\EgtData\$env:APP_NAME\bin
ROBOCOPY /MIR Images Z:\EgtData\$env:APP_NAME\bin\Images ROBOCOPY /MIR Images Z:\EgtData\$env:APP_NAME\bin\Images
+13 -4
View File
@@ -1,4 +1,4 @@
-- BatchProcess.lua by Egaltech s.r.l. 2022/05/09 -- BatchProcess.lua by Egaltech s.r.l. 2023/04/17
-- Gestione calcolo batch disposizione e lavorazioni per Pareti -- Gestione calcolo batch disposizione e lavorazioni per Pareti
-- 2020/07/24 Nuvola di punti riferita allo Zero Tavola. -- 2020/07/24 Nuvola di punti riferita allo Zero Tavola.
-- 2020/10/28 Corretto spostamento pezzi per rotazioni (0 o 180) e inversioni( 0, 90, 180, o 270). -- 2020/10/28 Corretto spostamento pezzi per rotazioni (0 o 180) e inversioni( 0, 90, 180, o 270).
@@ -12,6 +12,8 @@
-- 2022/02/24 Se ricalcolo si aggiorna il setup. In ogni caso si verifica prima di simulazione. -- 2022/02/24 Se ricalcolo si aggiorna il setup. In ogni caso si verifica prima di simulazione.
-- 2022/04/28 In info generazione aggiunta indicazione se 64bit. -- 2022/04/28 In info generazione aggiunta indicazione se 64bit.
-- 2022/05/02 Consentito allargamento area disponibile per grezzi su tavola da WallData. -- 2022/05/02 Consentito allargamento area disponibile per grezzi su tavola da WallData.
-- 2023/04/09 Aggiunta gestione flag per taglio feature con outline (da WD.CUT_WITH_OUTLINE).
-- 2023/04/17 Aggiunta gestione flag per rotazione grezzo di 180deg (da WD.RAWPART_ROT).
-- Intestazioni -- Intestazioni
require( 'EgtBase') require( 'EgtBase')
@@ -179,9 +181,11 @@ if bToProcess then
if bBtl then if bBtl then
-- cancello eventuale vecchio progetto omonimo -- cancello eventuale vecchio progetto omonimo
EgtEraseFile( sNgeFile) EgtEraseFile( sNgeFile)
-- flag di importazione
local nFlag = EIB_FL.TS3_POS + EIB_FL.USEUATTR + EgtIf( WD.CUT_WITH_OUTLINE, EIB_FL.TRIM_WITH_OUTLINE or 128, EIB_FL.NONE)
-- eseguo import -- eseguo import
EgtNewFile() EgtNewFile()
if not EgtImportBtl( WALL.FILE, EIB_FL.TS3_POS + EIB_FL.USEUATTR) then if not EgtImportBtl( WALL.FILE, nFlag) then
WALL.ERR = 13 WALL.ERR = 13
WALL.MSG = 'Error importing BTL file : ' .. WALL.FILE WALL.MSG = 'Error importing BTL file : ' .. WALL.FILE
WriteErrToLogFile( WALL.ERR, WALL.MSG) WriteErrToLogFile( WALL.ERR, WALL.MSG)
@@ -241,7 +245,7 @@ if bToProcess then
end end
if #vWall == 0 then if #vWall == 0 then
WALL.ERR = 14 WALL.ERR = 14
WALL.MSG = 'Error no beams in the file : ' .. WALL.FILE WALL.MSG = 'Error no walls in the file : ' .. WALL.FILE
WriteErrToLogFile( WALL.ERR, WALL.MSG) WriteErrToLogFile( WALL.ERR, WALL.MSG)
PostErrView( WALL.ERR, WALL.MSG) PostErrView( WALL.ERR, WALL.MSG)
return return
@@ -392,7 +396,12 @@ if bToProcess then
PostErrView( WALL.ERR, WALL.MSG) PostErrView( WALL.ERR, WALL.MSG)
return return
end end
-- Se richiesto per la macchina, ruoto il grezzo di 180 gradi attorno a Z
if WD.RAWPART_ROT and abs( WD.RAWPART_ROT - 180) < 1 then
EgtRotateRawPart( EgtGetFirstRawPart() or GDB_ID.NULL, Z_AX(), 180)
end
-- Imposto Nome file CN -- Imposto Nome file CN
local _, sName, _ = EgtSplitPath( WALL.FILE) local _, sName, _ = EgtSplitPath( WALL.FILE)
EgtSetInfo( EgtGetCurrMachGroup(), 'NcName', sName .. '.cnc') EgtSetInfo( EgtGetCurrMachGroup(), 'NcName', sName .. '.cnc')
+20 -17
View File
@@ -1,4 +1,4 @@
-- BatchProcess.lua by Egaltech s.r.l. 2022/05/09 -- BatchProcess.lua by Egaltech s.r.l. 2023/05/04
-- Gestione calcolo batch disposizione e lavorazioni per Pareti -- Gestione calcolo batch disposizione e lavorazioni per Pareti
-- 2021/01/15 Per nuova interfaccia Egt. -- 2021/01/15 Per nuova interfaccia Egt.
-- 2021/11/10 Aggiunta modifica per gestione modifiche manuali come in Beam. -- 2021/11/10 Aggiunta modifica per gestione modifiche manuali come in Beam.
@@ -7,6 +7,7 @@
-- 2022/01/20 Si aggiorna il setup anche quando si creano le lavorazioni (MachGroup vecchio...). -- 2022/01/20 Si aggiorna il setup anche quando si creano le lavorazioni (MachGroup vecchio...).
-- 2022/04/28 In info generazione aggiunta indicazione se 64bit. -- 2022/04/28 In info generazione aggiunta indicazione se 64bit.
-- 2022/05/02 Consentito allargamento area disponibile per grezzi su tavola da WallData. -- 2022/05/02 Consentito allargamento area disponibile per grezzi su tavola da WallData.
-- 2023/05/04 Traduzione messaggi ora fatta direttamente (eliminata codifica $$nn).
-- Intestazioni -- Intestazioni
require( 'EgtBase') require( 'EgtBase')
@@ -45,6 +46,18 @@ EgtOutLog( sLog)
local sLogFile = EgtChangePathExtension( WALL.FILE, '.txt') local sLogFile = EgtChangePathExtension( WALL.FILE, '.txt')
EgtEraseFile( sLogFile) EgtEraseFile( sLogFile)
-- Funzione per traduzione messaggi
local function BWMessageId( nMsgId, sMsg, params)
local sFmt
if WALL.BW and nMsgId and nMsgId > 0 then
sFmt = EgtMsg( 65000 + nMsgId)
end
if not sFmt or #sFmt == 0 then
sFmt = sMsg
end
return string.format( sFmt, table.unpack( params))
end
-- Funzioni per scrittura su file di log specifico -- Funzioni per scrittura su file di log specifico
local function WriteErrToLogFile( nErr, sMsg, nRot, nCutId, nTaskId) local function WriteErrToLogFile( nErr, sMsg, nRot, nCutId, nTaskId)
local hFile = io.open( sLogFile, 'a') local hFile = io.open( sLogFile, 'a')
@@ -55,17 +68,6 @@ local function WriteErrToLogFile( nErr, sMsg, nRot, nCutId, nTaskId)
hFile:write( 'TASKID=' .. tostring( nTaskId or 0) .. '\n') hFile:write( 'TASKID=' .. tostring( nTaskId or 0) .. '\n')
hFile:close() hFile:close()
end end
local function BWMessageId( nMsgId, sMsg, params)
if WALL.BW and nMsgId and nMsgId > 0 then
local sFinalMsg = '$$' .. nMsgId
for Index = 1, #params do
sFinalMsg = sFinalMsg .. ',' .. params[Index]
end
return sFinalMsg
else
return string.format( sMsg, table.unpack( params))
end
end
local function WriteTimeToLogFile( dTime) local function WriteTimeToLogFile( dTime)
local hFile = io.open( sLogFile, 'a') local hFile = io.open( sLogFile, 'a')
@@ -228,7 +230,7 @@ if bToProcess then
end end
if #vWall == 0 then if #vWall == 0 then
WALL.ERR = 14 WALL.ERR = 14
WALL.MSG = 'Error no beams in the file : ' .. WALL.FILE WALL.MSG = 'Error no walls in the file : ' .. WALL.FILE
WriteErrToLogFile( WALL.ERR, WALL.MSG) WriteErrToLogFile( WALL.ERR, WALL.MSG)
PostErrView( WALL.ERR, WALL.MSG) PostErrView( WALL.ERR, WALL.MSG)
return return
@@ -383,8 +385,8 @@ if bToProcess then
if dRawL > WD.MAX_LENGTH + 10 * GEO.EPS_SMALL or dRawW > WD.MAX_WIDTH + 10 * GEO.EPS_SMALL or dRawH > WD.MAX_HEIGHT + 10 * GEO.EPS_SMALL then if dRawL > WD.MAX_LENGTH + 10 * GEO.EPS_SMALL or dRawW > WD.MAX_WIDTH + 10 * GEO.EPS_SMALL or dRawH > WD.MAX_HEIGHT + 10 * GEO.EPS_SMALL then
ResetMachGroup( vWall) ResetMachGroup( vWall)
local sOut = BWMessageId( 1, 'Grezzo (%s x %s x %s) oltre il limite della macchina (%s x %s x %s)', local sOut = BWMessageId( 1, 'Grezzo (%s x %s x %s) oltre il limite della macchina (%s x %s x %s)',
{EgtNumToString( dRawL, 2), EgtNumToString( dRawW, 2), EgtNumToString( dRawH, 2), {EgtNumToString( dRawL, 2), EgtNumToString( dRawW, 2), EgtNumToString( dRawH, 2),
EgtNumToString( WD.MAX_LENGTH, 2), EgtNumToString( WD.MAX_WIDTH, 2), EgtNumToString( WD.MAX_HEIGHT, 2)}) EgtNumToString( WD.MAX_LENGTH, 2), EgtNumToString( WD.MAX_WIDTH, 2), EgtNumToString( WD.MAX_HEIGHT, 2)})
WALL.ERR = 17 WALL.ERR = 17
WALL.MSG = sOut WALL.MSG = sOut
WriteErrToLogFile( WALL.ERR, WALL.MSG) WriteErrToLogFile( WALL.ERR, WALL.MSG)
@@ -395,8 +397,9 @@ if bToProcess then
-- Verifico dimensioni minime del grezzo -- Verifico dimensioni minime del grezzo
if dRawL < WD.MIN_LENGTH - 10 * GEO.EPS_SMALL or dRawW < WD.MIN_WIDTH - 10 * GEO.EPS_SMALL or dRawH < WD.MIN_HEIGHT - 10 * GEO.EPS_SMALL then if dRawL < WD.MIN_LENGTH - 10 * GEO.EPS_SMALL or dRawW < WD.MIN_WIDTH - 10 * GEO.EPS_SMALL or dRawH < WD.MIN_HEIGHT - 10 * GEO.EPS_SMALL then
ResetMachGroup( vWall) ResetMachGroup( vWall)
local sOut = 'Grezzo (' .. EgtNumToString( dRawL, 2) .. ' x ' .. EgtNumToString( dRawW, 2) .. ' x ' .. EgtNumToString( dRawH, 2) .. ') ' .. local sOut = BWMessageId( 2, 'Grezzo (%s x %s x %s) sotto il limite della macchina (%s x %s x %s)',
'sotto il limite della macchina ('..EgtNumToString( WD.MIN_LENGTH, 2)..' x '..EgtNumToString( WD.MIN_WIDTH, 2)..' x '..EgtNumToString( WD.MIN_HEIGHT, 2)..')' {EgtNumToString( dRawL, 2), EgtNumToString( dRawW, 2), EgtNumToString( dRawH, 2),
EgtNumToString( WD.MIN_LENGTH, 2), EgtNumToString( WD.MIN_WIDTH, 2), EgtNumToString( WD.MIN_HEIGHT, 2)})
WALL.ERR = 17 WALL.ERR = 17
WALL.MSG = sOut WALL.MSG = sOut
WriteErrToLogFile( WALL.ERR, WALL.MSG) WriteErrToLogFile( WALL.ERR, WALL.MSG)
+15 -3
View File
@@ -1,8 +1,10 @@
-- MachiningLib.lua by Egaltech s.r.l. 2022/01/12 -- MachiningLib.lua by Egaltech s.r.l. 2022/01/12
-- Libreria ricerca lavorazioni per Pareti -- Libreria ricerca lavorazioni per Pareti
-- 2023/03/09 Piccola correzione alla SideDepth in FindMilling
-- In FindMilling aggiunta gestione spessore e massimo materiale nel caso di lam
-- 2023/05/25 Aggiunta funzione AddMachining che incapsula EgtAddMachining trascrivendo le priorità btl dalle feature alle lavorazioni.
-- Tabella per definizione modulo -- Tabella per definizione modulo
-- 2023/03/09 Piccola correzione alla SideDepth in FindMilling
local WMachiningLib = {} local WMachiningLib = {}
-- Include -- Include
@@ -56,14 +58,15 @@ function WMachiningLib.FindMilling( sType, dDepth, sTuuid, nTool_ID, dMaxDiam, d
for i = 1, #Millings do for i = 1, #Millings do
local Milling = Millings[i] local Milling = Millings[i]
if Milling.On and Milling.Type == sType and SetCurrMachiningAndTool( Milling.Name) then if Milling.On and Milling.Type == sType and SetCurrMachiningAndTool( Milling.Name) then
local bIsBlade = ( EgtTdbGetCurrToolParam( MCH_TP.TYPE) & MCH_TF.SAWBLADE ~= 0) or false
local nMchType = EgtMdbGetCurrMachiningParam( MCH_MP.TYPE) local nMchType = EgtMdbGetCurrMachiningParam( MCH_MP.TYPE)
local sMyTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) local sMyTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
local dTMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) local dTMaxMat = EgtIf( bIsBlade, EgtTdbGetCurrToolParam( MCH_TP.THICK), EgtTdbGetCurrToolParam( MCH_TP.MAXMAT))
local dTMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, dTMaxMat, EgtTdbGetCurrToolMaxDepth()) local dTMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, dTMaxMat, EgtTdbGetCurrToolMaxDepth())
local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
local dTDiamTh = EgtTdbGetCurrToolThDiam() or 0 local dTDiamTh = EgtTdbGetCurrToolThDiam() or 0
local dTTipFeed = EgtTdbGetCurrToolParam( MCH_TP.TIPFEED) local dTTipFeed = EgtTdbGetCurrToolParam( MCH_TP.TIPFEED)
local dTMaxDepthOnSide = min( EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDEDEPTH', 'd') or 999, 0.5 * ( dTDiam - dTDiamTh)) local dTMaxDepthOnSide = EgtIf( bIsBlade, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), min( EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDEDEPTH', 'd') or 999, 0.5 * ( dTDiam - dTDiamTh)))
local nMyTool_ID = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'Tool_ID', 'i') local nMyTool_ID = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'Tool_ID', 'i')
if nMchType == MCH_MY.MILLING and if nMchType == MCH_MY.MILLING and
( not sTuuid or sTuuid == sMyTuuid) and ( not sTuuid or sTuuid == sMyTuuid) and
@@ -178,5 +181,14 @@ function WMachiningLib.FindSurfacing( sType)
end end
end end
-- incapsulo EgtAddMachining e trascrivo le priorità all'interno delle note della lavorazione
---------------------------------------------------------------------
function WMachiningLib.AddMachining( nProcId, sName, sMachining)
local nMchId, sFinalName = EgtAddMachining( sName, sMachining)
local nPriority = EgtGetInfo( nProcId, 'PRIORITY', 'i')
EgtSetInfo( nMchId, 'PRIORITY', nPriority)
return nMchId, sFinalName
end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
return WMachiningLib return WMachiningLib
+5 -2
View File
@@ -1,5 +1,6 @@
-- WProcessDoubleCut.lua by Egaltech s.r.l. 2021/04/28 -- WProcessDoubleCut.lua by Egaltech s.r.l. 2023/04/17
-- Gestione calcolo doppi tagli di lama per Pareti -- Gestione calcolo doppi tagli di lama per Pareti
-- 2023/04/17 Quando si chiama LapJoint si trasforma il Gruppo da 1 a 3 e da 2 a 4.
-- Tabella per definizione modulo -- Tabella per definizione modulo
local WPDC = {} local WPDC = {}
@@ -58,7 +59,9 @@ function WPDC.Make( Proc, nRawId, b3Raw)
-- se singola faccia, passo a quella lavorazione -- se singola faccia, passo a quella lavorazione
if Proc.Fct == 1 then return Cut.Make( Proc, nRawId, b3Raw) end if Proc.Fct == 1 then return Cut.Make( Proc, nRawId, b3Raw) end
-- altrimenti due facce e passo alla LapJoint -- altrimenti due facce e passo alla LapJoint
return LapJoint.Make( Proc, nRawId, b3Raw) local LapProc = { PartId = Proc.PartId, Id = Proc.Id, Grp = Proc.Grp + 2, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
Diam = Proc.Diam, Fcs = Proc.Fcs, Fce = Proc.Fce, CutId = Proc.CutId, TaskId = Proc.TaskId}
return LapJoint.Make( LapProc, nRawId, b3Raw)
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
+4 -3
View File
@@ -8,6 +8,7 @@
-- 2022/01/29 DS Corretta gestione ingombro portautensili per fori inclinati da sopra. -- 2022/01/29 DS Corretta gestione ingombro portautensili per fori inclinati da sopra.
-- 2022/02/22 ES Aggiunta gestione prefori. -- 2022/02/22 ES Aggiunta gestione prefori.
-- 2022/03/08 DS Vanno accettati fori orizzontali sul bordo anche senza foratori orizzontali speciali. -- 2022/03/08 DS Vanno accettati fori orizzontali sul bordo anche senza foratori orizzontali speciali.
-- 2023/05/25 Funzioni EgtAddMachining sostituite da WM.AddMachining in modo da trascrivere le priorità da btl alle lavorazioni.
-- Tabella per definizione modulo -- Tabella per definizione modulo
local WPD = {} local WPD = {}
@@ -137,7 +138,7 @@ function WPD.RotateClassify( Proc)
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
local ptCen = EgtCP( AuxId, GDB_RT.GLOB) local ptCen = EgtCP( AuxId, GDB_RT.GLOB)
-- se foro orizzontale con punta lunga -- se foro orizzontale con punta lunga
if dDiam <= WD.HOR_DRILL_DIAM + WD.DRILL_TOL and dDiam >= WD.HOR_DRILL_DIAM - WD.DRILL_TOL and vtExtr:getZ() > -0.1 and vtExtr:getZ() < 0.1 then if dDiam <= ( WD.HOR_DRILL_DIAM or 35) + WD.DRILL_TOL and dDiam >= ( WD.HOR_DRILL_DIAM or 35) - WD.DRILL_TOL and vtExtr:getZ() > -0.1 and vtExtr:getZ() < 0.1 then
-- se orientato perpendicolare ad X -- se orientato perpendicolare ad X
if AreSameOrOppositeVectorApprox( vtExtr, X_AX()) then if AreSameOrOppositeVectorApprox( vtExtr, X_AX()) then
nRot0 = 0 nRot0 = 0
@@ -375,7 +376,7 @@ function WPD.Make( Proc, nRawId, b3Raw)
end end
-- inserisco la lavorazione -- inserisco la lavorazione
local sName = EgtIf( sHead == 'H5' or sHead == 'H6', 'LhDrill_', 'Drill_') .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName = EgtIf( sHead == 'H5' or sHead == 'H6', 'LhDrill_', 'Drill_') .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchId = EgtAddMachining( sName, sDrilling) local nMchId = WM.AddMachining( Proc.Id, sName, sDrilling)
if not nMchId then if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sDrilling local sErr = 'Error adding machining ' .. sName .. '-' .. sDrilling
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -505,7 +506,7 @@ function WPD.Make( Proc, nRawId, b3Raw)
-- inserisco la lavorazione -- inserisco la lavorazione
local sName = 'PreDrill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName = 'PreDrill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchId = EgtAddMachining( sName, sDrilling) local nMchId = WM.AddMachining( Proc.Id, sName, sDrilling)
if not nMchId then if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sDrilling local sErr = 'Error adding machining ' .. sName .. '-' .. sDrilling
EgtOutLog( sErr) EgtOutLog( sErr)
+3 -2
View File
@@ -2,6 +2,7 @@
-- Gestione calcolo mortase a coda di rondine per Pareti -- Gestione calcolo mortase a coda di rondine per Pareti
-- Tabella per definizione modulo -- Tabella per definizione modulo
-- 2023/05/25 Funzioni EgtAddMachining sostituite da WM.AddMachining in modo da trascrivere le priorità da btl alle lavorazioni.
local WPDM= {} local WPDM= {}
-- Include -- Include
@@ -159,7 +160,7 @@ function WPDM.Make( Proc, nRawId, b3Raw)
end end
-- inserisco la lavorazione di svuotatura -- inserisco la lavorazione di svuotatura
local sName = 'DtMtPck_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName = 'DtMtPck_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sName, sPocketing) local nMchFId = WM.AddMachining( Proc.Id, sName, sPocketing)
if not nMchFId then if not nMchFId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -189,7 +190,7 @@ function WPDM.Make( Proc, nRawId, b3Raw)
for i = nPass, 1, -1 do for i = nPass, 1, -1 do
-- inserisco la lavorazione di contornatura -- inserisco la lavorazione di contornatura
local sNameF = 'DtMt_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( nPass) local sNameF = 'DtMt_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( nPass)
local nMchFId = EgtAddMachining( sNameF, sMilling) local nMchFId = WM.AddMachining( Proc.Id, sNameF, sMilling)
if not nMchFId then if not nMchFId then
local sErr = 'Error adding machining ' .. sNameF .. '-' .. sMilling local sErr = 'Error adding machining ' .. sNameF .. '-' .. sMilling
EgtOutLog( sErr) EgtOutLog( sErr)
+95 -31
View File
@@ -1,4 +1,4 @@
-- ProcessFreeContour.lua by Egaltech s.r.l. 2023/03/08 -- ProcessFreeContour.lua by Egaltech s.r.l. 2023/04/17
-- Gestione calcolo profilo libero per Pareti -- Gestione calcolo profilo libero per Pareti
-- 2021/11/15 Penna e chiodature sono sempre riportate sulla faccia sopra anche se nel progetto sono sotto. -- 2021/11/15 Penna e chiodature sono sempre riportate sulla faccia sopra anche se nel progetto sono sotto.
-- 2021/12/10 In taglio con lama aggiunta gestione SCC per testa Gearbox. -- 2021/12/10 In taglio con lama aggiunta gestione SCC per testa Gearbox.
@@ -16,6 +16,10 @@
-- 2022/12/14 Aggiunto l'accorciamento della lama in caso di facce vicine orientate verso il basso -- 2022/12/14 Aggiunto l'accorciamento della lama in caso di facce vicine orientate verso il basso
-- 2023/02/28 In lavorazioni con sega a catena per invertire lato mandrino ora Invert + Left invece di MCH_SCC.OPPOSITE. -- 2023/02/28 In lavorazioni con sega a catena per invertire lato mandrino ora Invert + Left invece di MCH_SCC.OPPOSITE.
-- 2023/03/08 In lavorazione con fresa, se imposto Tool_ID non si controlla più possa lavorare di testa. -- 2023/03/08 In lavorazione con fresa, se imposto Tool_ID non si controlla più possa lavorare di testa.
-- 2023/04/14 Aggiunta pulitura spigoli Q05=1 anche su sole fresature.
-- 2023/04/17 Lavorazione CleanCorner sempre forzata con lato di lavoro in centro.
-- 2023/05/25 Funzioni EgtAddMachining sostituite da WM.AddMachining in modo da trascrivere le priorità da btl alle lavorazioni.
-- 2023/06/06 Aggiunta gestione lavorazione per lamatura speciale affondata con Tool_ID specifico.
-- Tabella per definizione modulo -- Tabella per definizione modulo
local WPF = {} local WPF = {}
@@ -64,6 +68,7 @@ function WPF.Classify( Proc, b3Raw)
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
-- recupero il tipo di lavorazione -- recupero il tipo di lavorazione
local nCntType = EgtGetInfo( Proc.Id, 'CNT_TYPE', 'i') or 0 local nCntType = EgtGetInfo( Proc.Id, 'CNT_TYPE', 'i') or 0
local nTool_ID = EgtGetInfo( Proc.Id, 'CNT_DATA', 'i')
-- se tasca -- se tasca
if bPocket then if bPocket then
-- cerco la faccia di fondo della superfice (deve avere direzione circa quella di estrusione della curva) -- cerco la faccia di fondo della superfice (deve avere direzione circa quella di estrusione della curva)
@@ -84,10 +89,10 @@ function WPF.Classify( Proc, b3Raw)
-- se penna o chiodatura va sempre bene (vengono sempre riportati sopra) -- se penna o chiodatura va sempre bene (vengono sempre riportati sopra)
elseif nCntType == 10 or nCntType == 20 then elseif nCntType == 10 or nCntType == 20 then
return true return true
-- se altrimenti profilo verticale che non interessa tutta la sezione -- se altrimenti profilo verticale che non interessa tutta la sezione e non caso speciale con lamatura affondata
elseif Proc.Box:getMax():getZ() < b3Raw:getMax():getZ() - 2 then elseif ( Proc.Box:getMax():getZ() < b3Raw:getMax():getZ() - 2) and ( not nTool_ID or ( nTool_ID ~= ( WD.RECESSED_COUNTERBORE_TOOLID or 0)) or ( not EgtCurveIsACircle( AuxId))) then
return false return false
-- altrimenti è profilo verticale che interessa tutta la sezione -- altrimenti è profilo verticale che interessa tutta la sezione o caso speciale con lamatura affondata
else else
return true return true
end end
@@ -97,8 +102,8 @@ end
-- Classificazione del flip della feature per nesting -- Classificazione del flip della feature per nesting
-- return nFlip0, nFlip1 -- return nFlip0, nFlip1
function WPF.FlipClassify( Proc, b3Raw) function WPF.FlipClassify( Proc, b3Raw)
local nFlip0 = 0 local nFlip0 = 0
local nFlip1 = 0 local nFlip1 = 0
-- verifico se di tipo pocket -- verifico se di tipo pocket
local bPocket = ( EgtGetInfo( Proc.Id, 'PCKT', 'i') == 1) local bPocket = ( EgtGetInfo( Proc.Id, 'PCKT', 'i') == 1)
@@ -299,7 +304,7 @@ local function ReorderFaces( nIdSurf, nNumFacet)
end end
-- ordino le facce in modo da avere una sequenza di facce concatenate -- ordino le facce in modo da avere una sequenza di facce concatenate
for i = 1, #vAdj - 1 do for i = 1, #vAdj - 1 do
-- recupero l'angolo con la faccia precedente -- recupero l'angolo con la faccia successiva
local bAdj, _, _, _ = EgtSurfTmFacetsContact( nIdSurf, i-1, i, GDB_ID.ROOT) local bAdj, _, _, _ = EgtSurfTmFacetsContact( nIdSurf, i-1, i, GDB_ID.ROOT)
-- se non ho adiacenza -- se non ho adiacenza
if not bAdj then if not bAdj then
@@ -1015,7 +1020,7 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
end end
-- inserisco la lavorazione -- inserisco la lavorazione
local sName = 'Clean_' .. ( EgtGetName( nNewProc) or tostring( nNewProc)) local sName = 'Clean_' .. ( EgtGetName( nNewProc) or tostring( nNewProc))
local nMchId = EgtAddMachining( sName, sMilling) local nMchId = WM.AddMachining( nNewProc.Id, sName, sMilling)
if not nMchId then if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -1041,10 +1046,11 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 10) EgtSetMachiningParam( MCH_MP.ENDADDLEN, 10)
-- setto affondamento 0 -- setto affondamento 0
EgtSetMachiningParam( MCH_MP.DEPTH, 0) EgtSetMachiningParam( MCH_MP.DEPTH, 0)
-- forzo lato correzione a centrato
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.CENTER)
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill -- Note utente con dichiarazione nessuna generazione sfridi per Vmill
local sUserNotes = 'VMRS=0;' local sUserNotes = 'VMRS=0;'
-- aggiungo alle note massima elevazione -- aggiungo alle note massima elevazione
-- sUserNotes = sUserNotes .. 'MaxElev=' .. EgtNumToString( dMaxDepth, 1) .. ';'
sUserNotes = sUserNotes .. 'MaxElev=' .. EgtNumToString( 0.0, 1) .. ';' sUserNotes = sUserNotes .. 'MaxElev=' .. EgtNumToString( 0.0, 1) .. ';'
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes) EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
if not EgtApplyMachining( true, false) then if not EgtApplyMachining( true, false) then
@@ -1309,7 +1315,7 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
if ( vFace[i].Type & 1) ~= 0 and ( not j or vFace[j].Type == 0 or vFace[j].Type == 1 or abs( vFace[i].SideAng) > 0.1 or abs( vFace[j].SideAng) > 0.1) then if ( vFace[i].Type & 1) ~= 0 and ( not j or vFace[j].Type == 0 or vFace[j].Type == 1 or abs( vFace[i].SideAng) > 0.1 or abs( vFace[j].SideAng) > 0.1) then
-- inserisco la lavorazione -- inserisco la lavorazione
local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId))
local nMchId = EgtAddMachining( sName, sMilling) local nMchId = WM.AddMachining( Proc.Id, sName, sMilling)
if not nMchId then if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -1403,7 +1409,7 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
if ( vFace[i].Type & 2) ~= 0 or ( vFace[i].Type == 4 and ( vFace[i].Edges > 3 and not vFace[i].Is3EdgesApprox)) then if ( vFace[i].Type & 2) ~= 0 or ( vFace[i].Type == 4 and ( vFace[i].Edges > 3 and not vFace[i].Is3EdgesApprox)) then
-- inserisco la lavorazione -- inserisco la lavorazione
local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId))
local nMchId = EgtAddMachining( sName, sMilling) local nMchId = WM.AddMachining( Proc.Id, sName, sMilling)
if not nMchId then if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -1604,7 +1610,7 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
if vFace[i].Split then if vFace[i].Split then
-- inserisco la lavorazione -- inserisco la lavorazione
local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) .. '_M' local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) .. '_M'
local nMchId = EgtAddMachining( sName, sMilling) local nMchId = WM.AddMachining( Proc.Id, sName, sMilling)
if not nMchId then if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -1695,7 +1701,7 @@ local function AddSawings( sSawing, vFace, Proc, nRawId, b3Raw)
if ( vFace[i].Type & 1) ~= 0 then if ( vFace[i].Type & 1) ~= 0 then
-- inserisco la lavorazione -- inserisco la lavorazione
local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId))
local nMchId = EgtAddMachining( sName, sSawing) local nMchId = WM.AddMachining( Proc.Id, sName, sSawing)
if not nMchId then if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sSawing local sErr = 'Error adding machining ' .. sName .. '-' .. sSawing
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -1743,7 +1749,7 @@ local function AddSawings( sSawing, vFace, Proc, nRawId, b3Raw)
if ( vFace[i].Type & 2) ~= 0 or ( vFace[i].Type == 4 and ( vFace[i].Edges > 3 and not vFace[i].Is3EdgesApprox) and vFace[i].Len > dSawDiam + 1) then if ( vFace[i].Type & 2) ~= 0 or ( vFace[i].Type == 4 and ( vFace[i].Edges > 3 and not vFace[i].Is3EdgesApprox) and vFace[i].Len > dSawDiam + 1) then
-- inserisco la lavorazione -- inserisco la lavorazione
local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId))
local nMchId = EgtAddMachining( sName, sSawing) local nMchId = WM.AddMachining( Proc.Id, sName, sSawing)
if not nMchId then if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sSawing local sErr = 'Error adding machining ' .. sName .. '-' .. sSawing
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -1814,7 +1820,7 @@ local function AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick)
local h = EgtIf( i > 1, i - 1, EgtIf( bClosed, #vFace, nil)) local h = EgtIf( i > 1, i - 1, EgtIf( bClosed, #vFace, nil))
-- inserisco la lavorazione -- inserisco la lavorazione
local sName = 'Cut_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) .. '_' .. tostring( i) local sName = 'Cut_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) .. '_' .. tostring( i)
local nMchId = EgtAddMachining( sName, sCutting) local nMchId = WM.AddMachining( Proc.Id, sName, sCutting)
if not nMchId then if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sCutting local sErr = 'Error adding machining ' .. sName .. '-' .. sCutting
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -2013,8 +2019,7 @@ local function MakeByCut( Proc, nRawId, b3Raw)
if ( nConeCut == 1 and nMlOk == 1 and dThick <= ( WD.MAX_CLEAN_CRN60 + 20 * GEO.EPS_SMALL)) or if ( nConeCut == 1 and nMlOk == 1 and dThick <= ( WD.MAX_CLEAN_CRN60 + 20 * GEO.EPS_SMALL)) or
( nConeCut == 2 and dThick <= ( WD.MAX_CLEAN_CRN30 + 20 * GEO.EPS_SMALL)) then ( nConeCut == 2 and dThick <= ( WD.MAX_CLEAN_CRN30 + 20 * GEO.EPS_SMALL)) then
local bMcok, sMcErr = AddMillCorner( nConeCut, vFace, Proc, nRawId, b3Raw, local bMcok, sMcErr = AddMillCorner( nConeCut, vFace, Proc, nRawId, b3Raw,
sMlErr, nAddGrpId, dThick, nNewProc, 0, sMlErr, nAddGrpId, dThick, nNewProc, 0, true)
true)
if not bMcok then return bMcok, sMcErr end if not bMcok then return bMcok, sMcErr end
else else
-- messaggi nel log -- messaggi nel log
@@ -2044,8 +2049,7 @@ local function MakeByCut( Proc, nRawId, b3Raw)
-- se abilitata la lavorazione corner con stop macchina e lavorazione precedente passante e spessore sotto il limite -- se abilitata la lavorazione corner con stop macchina e lavorazione precedente passante e spessore sotto il limite
if nConeCut == 1 and nCsOk == 1 and dThick <= ( WD.MAX_CLEAN_CRN60 + 20 * GEO.EPS_SMALL) then if nConeCut == 1 and nCsOk == 1 and dThick <= ( WD.MAX_CLEAN_CRN60 + 20 * GEO.EPS_SMALL) then
local bMcok, sMcErr = AddMillCorner( nConeCut, vFace, Proc, nRawId, b3Raw, local bMcok, sMcErr = AddMillCorner( nConeCut, vFace, Proc, nRawId, b3Raw,
sCSErr, nAddGrpId, nil, nNewProc, 0, sCSErr, nAddGrpId, nil, nNewProc, 0, true)
true)
if not bMcok then return bMcok, sMcErr end if not bMcok then return bMcok, sMcErr end
else else
if nConeCut == 1 then if nConeCut == 1 then
@@ -2075,8 +2079,7 @@ local function MakeByCut( Proc, nRawId, b3Raw)
if ( nConeCut == 1 and nMlOk == 1 and dThick <= ( WD.MAX_CLEAN_CRN60 + 20 * GEO.EPS_SMALL)) or if ( nConeCut == 1 and nMlOk == 1 and dThick <= ( WD.MAX_CLEAN_CRN60 + 20 * GEO.EPS_SMALL)) or
( nConeCut == 2 and dThick <= ( WD.MAX_CLEAN_CRN30 + 20 * GEO.EPS_SMALL)) then ( nConeCut == 2 and dThick <= ( WD.MAX_CLEAN_CRN30 + 20 * GEO.EPS_SMALL)) then
local bMcok, sMcErr = AddMillCorner( nConeCut, vFace, Proc, nRawId, b3Raw, local bMcok, sMcErr = AddMillCorner( nConeCut, vFace, Proc, nRawId, b3Raw,
sMlErr, nAddGrpId, dThick, nNewProc, 0, sMlErr, nAddGrpId, dThick, nNewProc, 0, true)
true)
if not bMcok then return bMcok, sMcErr end if not bMcok then return bMcok, sMcErr end
else else
-- messaggi nel log -- messaggi nel log
@@ -2125,6 +2128,8 @@ local function MakeByMill( Proc, nRawId, b3Raw)
local b3Aux = EgtGetBBoxGlob( AuxId, GDB_BB.STANDARD) local b3Aux = EgtGetBBoxGlob( AuxId, GDB_BB.STANDARD)
local bToolInv = ( vtExtr:getZ() < -0.1) local bToolInv = ( vtExtr:getZ() < -0.1)
local nTool_ID = EgtGetInfo( Proc.Id, 'CNT_DATA', 'i') local nTool_ID = EgtGetInfo( Proc.Id, 'CNT_DATA', 'i')
-- lettura parametri (probabile/i parametro/i Q)
local nConeCut = VerifyCornerType( Proc)
-- recupero la lavorazione -- recupero la lavorazione
local bTipFeed = EgtIf( nTool_ID, false, true) local bTipFeed = EgtIf( nTool_ID, false, true)
local sMilling = WM.FindMilling( 'FreeContour', nil, nil, nTool_ID, nil, nil, bTipFeed) local sMilling = WM.FindMilling( 'FreeContour', nil, nil, nTool_ID, nil, nil, bTipFeed)
@@ -2135,27 +2140,27 @@ local function MakeByMill( Proc, nRawId, b3Raw)
return false, sErr return false, sErr
end end
-- recupero i dati dell'utensile -- recupero i dati dell'utensile
local dMillDiam = 20
local dMaxDepth = 0 local dMaxDepth = 0
if EgtMdbSetCurrMachining( sMilling) then if EgtMdbSetCurrMachining( sMilling) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam
dMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), EgtTdbGetCurrToolMaxDepth()) or dMaxDepth dMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), EgtTdbGetCurrToolMaxDepth()) or dMaxDepth
end end
end end
-- eventuale spezzatura sul tratto più lungo se curva chiusa
--BL.PutStartOnLonger( AuxId)
-- verifiche per affondamento -- verifiche per affondamento
if b3Aux:getDimZ() > b3Raw:getDimZ() - 1.0 then if b3Aux:getDimZ() > b3Raw:getDimZ() - 1.0 then
dDepth = min( dDepth, b3Raw:getDimZ()) + WD.CUT_EXTRA dDepth = min( dDepth, b3Raw:getDimZ())
end end
if dDepth > dMaxDepth then dDepth = dDepth + WD.CUT_EXTRA
-- lo limito e tolgo eventuali Tabs local bReducedDepth = ( dDepth > dMaxDepth)
if bReducedDepth then
dDepth = dMaxDepth dDepth = dMaxDepth
EgtSetMachiningParam( MCH_MP.LEAVETAB, false)
end end
-- inserisco la lavorazione -- inserisco la lavorazione
local sName = 'Free_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName = 'Free_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchId = EgtAddMachining( sName, sMilling) local nMchId = WM.AddMachining( Proc.Id, sName, sMilling)
if not nMchId then if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -2170,6 +2175,8 @@ local function MakeByMill( Proc, nRawId, b3Raw)
if bToolInv then if bToolInv then
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
end end
-- tolgo i Tabs se non passante o devo rimuovere lo sfrido
if bReducedDepth or nConeCut == 1 then EgtSetMachiningParam( MCH_MP.LEAVETAB, false) end
-- assegno affondamento -- assegno affondamento
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth) EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
-- assegno lato di lavoro -- assegno lato di lavoro
@@ -2180,6 +2187,37 @@ local function MakeByMill( Proc, nRawId, b3Raw)
elseif ( Proc.Grp == 3 and bToolInv) or ( Proc.Grp == 4 and not bToolInv) then elseif ( Proc.Grp == 3 and bToolInv) or ( Proc.Grp == 4 and not bToolInv) then
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
end end
-- se lamatura affondata speciale, setto attacco e stacco al centro
local bIsRecessedCounterBore = ( Proc.Box:getMax():getZ() < b3Raw:getMax():getZ() + 10 * GEO.EPS_SMALL) and
( nTool_ID == WD.RECESSED_COUNTERBORE_TOOLID or 0) and
( EgtCurveIsACircle( AuxId))
if bIsRecessedCounterBore then
local _, _, _, dContourRadius = EgtCurveIsACircle( AuxId)
-- setto attacco
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.TANGENT)
EgtSetMachiningParam( MCH_MP.STARTADDLEN, 0)
EgtSetMachiningParam( MCH_MP.LITANG, 0)
EgtSetMachiningParam( MCH_MP.LIPERP, dContourRadius - 0.5 * dMillDiam)
EgtSetMachiningParam( MCH_MP.LIELEV, 0)
-- setto stacco
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.LINEAR)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 0)
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
EgtSetMachiningParam( MCH_MP.LOPERP, dContourRadius - 0.5 * dMillDiam)
EgtSetMachiningParam( MCH_MP.LOELEV, 0)
-- imposto step
local dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or 0
local dStep = EgtGetMachiningParam( MCH_MP.STEP)
if dStep < GEO.EPS_SMALL then dStep = 0.75 * dMaxMat end
local nStep = ceil( ( dDepth - dMaxMat) / dStep)
dStep = max( ( dDepth - dMaxMat) / max( nStep, 1), 0)
local dMaxElev = max( ( nStep + 1) * dStep - GEO.EPS_SMALL, 0)
EgtSetMachiningParam( MCH_MP.STEP, dStep)
-- imposto elevazione
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMaxElev, 1) .. ';')
end
-- posizione braccio porta testa -- posizione braccio porta testa
local nSCC = MCH_SCC.ADIR_ZP local nSCC = MCH_SCC.ADIR_ZP
if AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then if AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then
@@ -2192,6 +2230,32 @@ local function MakeByMill( Proc, nRawId, b3Raw)
EgtSetOperationMode( nMchId, false) EgtSetOperationMode( nMchId, false)
return false, sErr return false, sErr
end end
-- se abilitata la lavorazione corner con stop macchina, ci sono almeno due facce e fresata passante per consentire eliminazione sfrido
if nConeCut == 1 and Proc.Fct >= 2 and not bReducedDepth then
-- gruppo ausiliario
local nAddGrpId = WL.GetAddGroup( Proc.PartId)
-- recupero i dati di tutte le facce
local vFace, dMaxWidth, nNewProc = GetFacesData( Proc, bOpposite, false, dMillDiam, dMaxDepth, (dMillDiam/2), nAddGrpId, b3Raw)
-- se affondamento non superiore al limite
if dDepth <= ( WD.MAX_CLEAN_CRN60 + 20 * GEO.EPS_SMALL) then
local bMcok, sMcErr = AddMillCorner( nConeCut, vFace, Proc, nRawId, b3Raw,
dMillDiam, nAddGrpId, nil, nNewProc, 0, true)
if not bMcok then return bMcok, sMcErr end
else
EgtErase( nNewProc)
if nConeCut == 1 then
local sErr = 'Clean corner 60° not applid because thickness: ' .. EgtNumToString( dThick, 2) ..
' is bigger than parameter MAX_CLEAN_CRN60: ' .. EgtNumToString( WD.MAX_CLEAN_CRN60 , 2)
EgtOutLog( sErr)
end
end
elseif nConeCut == 2 then
local sErr = 'Clean corner 30° is not applied on milling'
EgtOutLog( sErr)
elseif nConeCut == 3 then
local sErr = 'Clean corner with undercut is not applied on milling'
EgtOutLog( sErr)
end
return true return true
end end
@@ -2229,7 +2293,7 @@ local function MakeByMark( Proc, nRawId, b3Raw)
end end
-- inserisco la lavorazione -- inserisco la lavorazione
local sName = 'FreeMark_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName = 'FreeMark_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchId = EgtAddMachining( sName, sMilling) local nMchId = WM.AddMachining( Proc.Id, sName, sMilling)
if not nMchId then if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -2294,7 +2358,7 @@ local function MakeByNail( Proc, nRawId, b3Raw)
end end
-- inserisco la lavorazione -- inserisco la lavorazione
local sName = 'Nail_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName = 'Nail_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchId = EgtAddMachining( sName, sNailing) local nMchId = WM.AddMachining( Proc.Id, sName, sNailing)
if not nMchId then if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sNailing local sErr = 'Error adding machining ' .. sName .. '-' .. sNailing
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -2433,7 +2497,7 @@ local function MakeByPocket( Proc, nRawId, b3Raw)
end end
-- inserisco la lavorazione di svuotatura -- inserisco la lavorazione di svuotatura
local sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sName, sPocketing) local nMchFId = WM.AddMachining( Proc.Id, sName, sPocketing)
if not nMchFId then if not nMchFId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing
EgtOutLog( sErr) EgtOutLog( sErr)
+56 -44
View File
@@ -1,4 +1,4 @@
-- WProcessLapJoint.lua by Egaltech s.r.l. 2022/12/22 -- WProcessLapJoint.lua by Egaltech s.r.l. 2023/04/17
-- Gestione calcolo mezzo-legno per Pareti -- Gestione calcolo mezzo-legno per Pareti
-- 2021/08/27 DS Se tre o più facce con flag PCKT=1 forzo svuotatura con fresa (per Variant). -- 2021/08/27 DS Se tre o più facce con flag PCKT=1 forzo svuotatura con fresa (per Variant).
-- 2021/08/29 DS Se svuotatura di fianco setto flag per farla dopo i tagli. -- 2021/08/29 DS Se svuotatura di fianco setto flag per farla dopo i tagli.
@@ -14,7 +14,13 @@
-- 2022/11/15 DS Con lama massima inclinazione 60deg. -- 2022/11/15 DS Con lama massima inclinazione 60deg.
-- 2022/12/01 Per 2 facce con angolo > 90° implementata lavorazione principale verticale. Se da sopra, aggiunta ripresa del lato inclinato. -- 2022/12/01 Per 2 facce con angolo > 90° implementata lavorazione principale verticale. Se da sopra, aggiunta ripresa del lato inclinato.
-- 2022/12/14 Nel caso di 2 facce piccola correzione al modo di ordinare le facce. -- 2022/12/14 Nel caso di 2 facce piccola correzione al modo di ordinare le facce.
-- 2023/03/09 Gestito caso riconoscimento errato Stype 3 -- 2023/03/09 Gestito caso riconoscimento errato Stype 3.
-- 2023/03/09 In MakeMoreFaces aggiunta la possibilità di lavorare le fessure con la lama.
-- 2023/03/17 In MakeByMill gestito correttamente il caso di Workside destro.
-- 2023/04/15 Corretta scelta tipo lavorazione 'SideGroove' aggiungendo massimo spessore.
-- 2023/04/17 Sistemata gestione parametri Q, eliminando quello non usato di forzatura lama e abilitandoli anche per DoubleCut.
-- Lavorazione CleanCorner sempre forzata con lato di lavoro in centro.
-- 2023/05/25 Funzioni EgtAddMachining sostituite da WM.AddMachining in modo da trascrivere le priorità da btl alle lavorazioni.
-- Tabella per definizione modulo -- Tabella per definizione modulo
local WPL = {} local WPL = {}
@@ -34,11 +40,10 @@ local WHISK_SAFE = 5
local MIN_LEN_CUT = 30 local MIN_LEN_CUT = 30
-- variabili assegnazione parametri Q -- variabili assegnazione parametri Q
local Q_FORCE_BLADE = '' -- i
local Q_SIDE_MILL = '' -- d local Q_SIDE_MILL = '' -- d
local Q_CORNER_CUT = '' -- i local Q_CORNER_CUT = '' -- i
-- variabile settaggio doppia lavorazione su angoo > 90 -- variabile settaggio doppia lavorazione su angolo > 90
local bMakeTwinCut = true local bMakeTwinCut = true
-- angolo sottosquadra ammesso per fresa cono 30° -- angolo sottosquadra ammesso per fresa cono 30°
local dAngleSmall = 70 local dAngleSmall = 70
@@ -59,20 +64,19 @@ end
local function AssignQIdent( Proc) local function AssignQIdent( Proc)
-- reset assegnazione parametri Q -- reset assegnazione parametri Q
Q_FORCE_BLADE = ''
Q_SIDE_MILL = '' Q_SIDE_MILL = ''
Q_CORNER_CUT = '' Q_CORNER_CUT = ''
if Proc.Grp == 0 and Proc.Prc == 12 then if Proc.Prc == 11 then
Q_FORCE_BLADE = 'Q01' -- i Q_SIDE_MILL = 'Q02' -- i
Q_CORNER_CUT = 'Q05' -- i
elseif Proc.Prc == 12 then
Q_SIDE_MILL = 'Q02' -- i Q_SIDE_MILL = 'Q02' -- i
Q_CORNER_CUT = '' -- i Q_CORNER_CUT = '' -- i
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 30 then elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 30 then
Q_FORCE_BLADE = '' -- i
Q_SIDE_MILL = 'Q08' -- i Q_SIDE_MILL = 'Q08' -- i
Q_CORNER_CUT = 'Q05' -- i Q_CORNER_CUT = 'Q05' -- i
else else
Q_FORCE_BLADE = 'Q01' -- i
Q_SIDE_MILL = 'Q03' -- i Q_SIDE_MILL = 'Q03' -- i
Q_CORNER_CUT = 'Q05' -- i Q_CORNER_CUT = 'Q05' -- i
end end
@@ -82,11 +86,6 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
local function EvaluateQParam( Proc) local function EvaluateQParam( Proc)
local bForceUseBlade = false
if #Q_FORCE_BLADE == 0 or EgtGetInfo( Proc.Id, Q_FORCE_BLADE, 'i') == 1 then
bForceUseBlade = true
end
-- Verifico se utilizzare la fresa di lato : -- Verifico se utilizzare la fresa di lato :
-- 0 : niente -- 0 : niente
-- 1 : utilizzo fresa di lato (alla faccia selezionata) -- 1 : utilizzo fresa di lato (alla faccia selezionata)
@@ -99,7 +98,7 @@ local function EvaluateQParam( Proc)
-- 3 : scarico corner (tipo foro). -- 3 : scarico corner (tipo foro).
local nTypeCornerCut = EgtGetInfo( Proc.Id, Q_CORNER_CUT, 'i') or 0 local nTypeCornerCut = EgtGetInfo( Proc.Id, Q_CORNER_CUT, 'i') or 0
return nTypeCornerCut, nUseSideMillAsBlade, bForceUseBlade return nTypeCornerCut, nUseSideMillAsBlade
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -986,7 +985,7 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
end end
-- inserisco la lavorazione -- inserisco la lavorazione
local sName = 'Clean_' .. ( EgtGetName( nNewProc) or tostring( nNewProc)) local sName = 'Clean_' .. ( EgtGetName( nNewProc) or tostring( nNewProc))
local nMchId = EgtAddMachining( sName, sMilling) local nMchId = WM.AddMachining( nNewProc.Id, sName, sMilling)
if not nMchId then if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -1012,10 +1011,11 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 10) EgtSetMachiningParam( MCH_MP.ENDADDLEN, 10)
-- setto affondamento 0 -- setto affondamento 0
EgtSetMachiningParam( MCH_MP.DEPTH, 0) EgtSetMachiningParam( MCH_MP.DEPTH, 0)
-- forzo lato correzione a centrato
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.CENTER)
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill -- Note utente con dichiarazione nessuna generazione sfridi per Vmill
local sUserNotes = 'VMRS=0;' local sUserNotes = 'VMRS=0;'
-- aggiungo alle note massima elevazione -- aggiungo alle note massima elevazione
-- sUserNotes = sUserNotes .. 'MaxElev=' .. EgtNumToString( dMaxDepth, 1) .. ';'
sUserNotes = sUserNotes .. 'MaxElev=' .. EgtNumToString( 0.0, 1) .. ';' sUserNotes = sUserNotes .. 'MaxElev=' .. EgtNumToString( 0.0, 1) .. ';'
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes) EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
if not EgtApplyMachining( true, false) then if not EgtApplyMachining( true, false) then
@@ -1276,7 +1276,7 @@ local function MakeByChainSaw( Proc, nFacet, nRawId, b3Raw, dElev, dH, dV)
for i = 1, nStep do for i = 1, nStep do
-- Applico la lavorazione con sega a catena a questa faccia -- Applico la lavorazione con sega a catena a questa faccia
local sName = 'Csaw_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( i) local sName = 'Csaw_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( i)
local nMchFId = EgtAddMachining( sName, sSawing) local nMchFId = WM.AddMachining( Proc.Id, sName, sSawing)
if not nMchFId then if not nMchFId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sSawing local sErr = 'Error adding machining ' .. sName .. '-' .. sSawing
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -1363,7 +1363,7 @@ local function MakeByMill( Proc, nFacet, nOthFac, nRawId, b3Raw, dSideDist)
end end
-- inserisco la lavorazione di contornatura -- inserisco la lavorazione di contornatura
local sName = 'Mill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName = 'Mill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sName, sMilling) local nMchFId = WM.AddMachining( Proc.Id, sName, sMilling)
if not nMchFId then if not nMchFId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -1380,6 +1380,13 @@ local function MakeByMill( Proc, nFacet, nOthFac, nRawId, b3Raw, dSideDist)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 0) -- -dMillDiam/2 + dAddLen) EgtSetMachiningParam( MCH_MP.ENDADDLEN, 0) -- -dMillDiam/2 + dAddLen)
EgtSetMachiningParam( MCH_MP.LOTANG, 0) EgtSetMachiningParam( MCH_MP.LOTANG, 0)
EgtSetMachiningParam( MCH_MP.LOPERP, dSideDist + WD.CUT_SIC) EgtSetMachiningParam( MCH_MP.LOPERP, dSideDist + WD.CUT_SIC)
-- setto inversione in base al workside
local bIsWorkSideRight = ( EgtGetMachiningParam( MCH_MP.WORKSIDE) == MCH_MILL_WS.RIGHT)
local bInvert = false
if bIsWorkSideRight then
bInvert = true
end
EgtSetMachiningParam( MCH_MP.INVERT, bInvert)
-- imposto posizione braccio porta testa -- imposto posizione braccio porta testa
local nSCC = MCH_SCC.ADIR_ZP local nSCC = MCH_SCC.ADIR_ZP
if AreSameOrOppositeVectorApprox( vtN, Z_AX()) then if AreSameOrOppositeVectorApprox( vtN, Z_AX()) then
@@ -1422,7 +1429,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
sMilling = sCustomMach sMilling = sCustomMach
-- altrimenti la cerco -- altrimenti la cerco
else else
sMilling = WM.FindMilling( 'SideGroove') sMilling = WM.FindMilling( 'SideGroove', nil, nil, nil, nil, min( dH, dV))
end end
if not sMilling then if not sMilling then
local sErr = 'Error : SideGroove not found in library' local sErr = 'Error : SideGroove not found in library'
@@ -1726,7 +1733,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
end end
-- inserisco la lavorazione di fresatura -- inserisco la lavorazione di fresatura
local sNameGorge = 'Gorge_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. tostring( nFacet) .. '_' .. tostring( nNm) local sNameGorge = 'Gorge_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. tostring( nFacet) .. '_' .. tostring( nNm)
local nMchFId = EgtAddMachining( sNameGorge, sMillingGorge) local nMchFId = WM.AddMachining( Proc.Id, sNameGorge, sMillingGorge)
if not nMchFId then if not nMchFId then
local sErr = 'Error adding machining ' .. sNameGorge .. '-' .. sMillingGorge local sErr = 'Error adding machining ' .. sNameGorge .. '-' .. sMillingGorge
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -1777,7 +1784,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
nNm = nNm + 1 nNm = nNm + 1
-- inserisco la lavorazione di taglio sfrido gorge -- inserisco la lavorazione di taglio sfrido gorge
local sNameGorge = 'GorgeCut_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. tostring( nFacet) .. '_' .. tostring( nNm) local sNameGorge = 'GorgeCut_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. tostring( nFacet) .. '_' .. tostring( nNm)
local nMchFId = EgtAddMachining( sNameGorge, sCuttingGorge) local nMchFId = WM.AddMachining( Proc.Id, sNameGorge, sCuttingGorge)
if not nMchFId then if not nMchFId then
local sErr = 'Error adding machining ' .. sNameGorge .. '-' .. sCuttingGorge local sErr = 'Error adding machining ' .. sNameGorge .. '-' .. sCuttingGorge
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -1836,7 +1843,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
if not bExcludeSideMill then if not bExcludeSideMill then
-- inserisco la lavorazione di ribasso o gola -- inserisco la lavorazione di ribasso o gola
local sName = EgtIf( bEnablePreMill ~= nil, 'SideMill_', 'Mill_') .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName = EgtIf( bEnablePreMill ~= nil, 'SideMill_', 'Mill_') .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sName, sMilling) local nMchFId = WM.AddMachining( Proc.Id, sName, sMilling)
if not nMchFId then if not nMchFId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -1850,10 +1857,6 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
-- aggiungo geometria -- aggiungo geometria
EgtSetMachiningGeometry( {{ Proc.Id, nFacet}}) EgtSetMachiningGeometry( {{ Proc.Id, nFacet}})
-- imposto posizione braccio porta testa -- imposto posizione braccio porta testa
--local nSCC = MCH_SCC.ADIR_ZP
--if abs( vtN:getZ()) < GEO.EPS_SMALL then
-- nSCC = EgtIf( Proc.Box:getDimX() >= Proc.Box:getDimY(), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_XP)
--end
local nSCC = MCH_SCC.ADIR_NEAR local nSCC = MCH_SCC.ADIR_NEAR
EgtSetMachiningParam( MCH_MP.SCC, nSCC) EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- imposto modo di lavorare la faccia -- imposto modo di lavorare la faccia
@@ -1946,9 +1949,14 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
end end
-- eseguo -- eseguo
if not EgtApplyMachining( true, false) then if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() -- provo a invertire posizione braccio porta testa
EgtSetOperationMode( nMchFId, false) nSCC = MCH_SCC.ADIR_FAR
return false, sErr EgtSetMachiningParam( MCH_MP.SCC, nSCC)
if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchFId, false)
return false, sErr
end
end end
else else
sWarn = 'Warning in LapJoint : upside down groove with obtuse angle not completed' sWarn = 'Warning in LapJoint : upside down groove with obtuse angle not completed'
@@ -1959,7 +1967,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
if dAng and dAng > -90 + 10 * GEO.EPS_SMALL and not bExcludeFinishing then if dAng and dAng > -90 + 10 * GEO.EPS_SMALL and not bExcludeFinishing then
-- inserisco la lavorazione di contornatura -- inserisco la lavorazione di contornatura
local sName = 'Mill_Oth_Fac_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName = 'Mill_Oth_Fac_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sName, sMilling) local nMchFId = WM.AddMachining( Proc.Id, sName, sMilling)
if not nMchFId then if not nMchFId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -2147,7 +2155,7 @@ local function MakeByPocketing( Proc, nFacet, nRawId, b3Raw, bCheckQPar)
end end
-- inserisco la lavorazione di svuotatura -- inserisco la lavorazione di svuotatura
local sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sName, sPocketing) local nMchFId = WM.AddMachining( Proc.Id, sName, sPocketing)
if not nMchFId then if not nMchFId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -2224,7 +2232,7 @@ local function MakeOneFace( Proc, nRawId, b3Raw)
end end
-- eseguo il taglio di lama -- eseguo il taglio di lama
local sName = 'Cut_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) .. '_' .. tostring( Proc.Id) local sName = 'Cut_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) .. '_' .. tostring( Proc.Id)
local nMchId = EgtAddMachining( sName, sCutting) local nMchId = WM.AddMachining( Proc.Id, sName, sCutting)
if not nMchId then if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sCutting local sErr = 'Error adding machining ' .. sName .. '-' .. sCutting
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -2502,7 +2510,7 @@ local function MakeTwoFaces( Proc, nRawId, b3Raw)
for i = 1, 2 do for i = 1, 2 do
-- inserisco la lavorazione -- inserisco la lavorazione
local sName = 'Cut_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) .. '_' .. tostring( Proc.Id) .. '_' .. tostring( i) local sName = 'Cut_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) .. '_' .. tostring( Proc.Id) .. '_' .. tostring( i)
local nMchId = EgtAddMachining( sName, sCutting) local nMchId = WM.AddMachining( Proc.Id, sName, sCutting)
if not nMchId then if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sCutting local sErr = 'Error adding machining ' .. sName .. '-' .. sCutting
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -2546,15 +2554,17 @@ local function MakeMoreFaces( Proc, nRawId, b3Raw)
end end
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT) local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT)
local _, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT) local _, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT)
local dMaxSlotThicknessForBlade = 25
local bIsSmallSlot = ( Proc.Fct == 3 and ( min( dH, dV) < dMaxSlotThicknessForBlade + 10 * GEO.EPS_SMALL) and vtN:getZ() > -0.01)
-- se di fianco -- se di fianco
if not bPckt and Proc.Fct >= 3 and vtN:getZ() < WD.NZ_MINA then if not bPckt and Proc.Fct >= 3 and ( ( vtN:getZ() < WD.NZ_MINA) or bIsSmallSlot) then
-- recupero elevazione faccia in feature -- recupero elevazione faccia in feature
local dSideElev = WL.GetFaceElevation( Proc.Id, nFacInd) local dSideElev = WL.GetFaceElevation( Proc.Id, nFacInd)
-- se abilitata lavorazione ribasso con fresa di fianco e parametro Q03 abilitato -- se abilitata lavorazione ribasso con fresa di fianco e parametro Q03 abilitato
local sMillOnSide, dTMaxDepth, dMaxMat, dDiam = WM.FindMilling( 'SideMill', nil, nil, nil, nil, min( dH, dV), nil, dSideElev) local sMillOnSide, dTMaxDepth, dMaxMat, dDiam = WM.FindMilling( 'SideMill', nil, nil, nil, nil, min( dH, dV), nil, dSideElev)
local _, nUseMillOnSide = EvaluateQParam( Proc) local _, nUseMillOnSide = EvaluateQParam( Proc)
-- se ho abilitata lavorazione di fresa di fianco -- se ho abilitata lavorazione di fresa di fianco
if Proc.Fct >= 3 and sMillOnSide and nUseMillOnSide >= 1 then if Proc.Fct >= 3 and sMillOnSide and nUseMillOnSide >= 1 and not bIsSmallSlot then
-- cerco nei parametri utensili la nota di affondamento di fianco SIDEDEPTH -- cerco nei parametri utensili la nota di affondamento di fianco SIDEDEPTH
local dMaxDepthOnSide = 0 local dMaxDepthOnSide = 0
local dMillDiam = 0 local dMillDiam = 0
@@ -2596,15 +2606,17 @@ local function MakeMoreFaces( Proc, nRawId, b3Raw)
end end
else else
-- fresatura (se definita) -- fresatura (se definita)
local sMilling = WM.FindMilling( 'SideGroove') local sMilling = WM.FindMilling( 'SideGroove', nil, nil, nil, nil, min( dH, dV))
-- recupero i dati dell'utensile -- recupero i dati dell'utensile
local dMaxMat = 1000 local dMaxMat = 1000
local dMaxDepthOnSide = 0 local dMaxDepthOnSide = 0
local bIsBlade = false
if sMilling and EgtMdbSetCurrMachining( sMilling) then if sMilling and EgtMdbSetCurrMachining( sMilling) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
local dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam local dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam
if ( EgtTdbGetCurrToolParam( MCH_TP.TYPE) & MCH_TF.SAWBLADE) ~= 0 then bIsBlade = EgtTdbGetCurrToolParam( MCH_TP.TYPE) & MCH_TF.SAWBLADE ~= 0
if bIsBlade then
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dMaxMat dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dMaxMat
dMaxDepthOnSide = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) dMaxDepthOnSide = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT)
else else
@@ -2617,12 +2629,12 @@ local function MakeMoreFaces( Proc, nRawId, b3Raw)
end end
end end
end end
if sMilling and dElev < dMaxDepthOnSide and dMaxMat <= min( dH, dV) + 20 * GEO.EPS_SMALL then if sMilling and dElev < dMaxDepthOnSide then
return MakeSideGrooveByMill( Proc, nFacInd, nRawId, b3Raw, sMilling) return MakeSideGrooveByMill( Proc, nFacInd, nRawId, b3Raw, sMilling)
-- altrimenti sega a catena -- altrimenti sega a catena
else else
return MakeByChainSaw( Proc, nFacInd, nRawId, b3Raw, dElev, dH, dV) return MakeByChainSaw( Proc, nFacInd, nRawId, b3Raw, dElev, dH, dV)
end end
end end
end end
local nFacet = EgtIf( bPckt or vtN:getZ() >= WD.NZ_MINA, nFacInd, nFacInd2) local nFacet = EgtIf( bPckt or vtN:getZ() >= WD.NZ_MINA, nFacInd, nFacInd2)
+3 -2
View File
@@ -1,6 +1,7 @@
-- WProcessMark.lua by Egaltech s.r.l. 2021/04/20 -- WProcessMark.lua by Egaltech s.r.l. 2021/04/20
-- Gestione calcolo marcatura per Pareti -- Gestione calcolo marcatura per Pareti
-- 2023/01/05 Permesse le marcature laterali in presenza di offset Z, tra grezzo e tavola, di almeno 100 mm -- 2023/01/05 Permesse le marcature laterali in presenza di offset Z, tra grezzo e tavola, di almeno 100 mm
-- 2023/05/25 Funzioni EgtAddMachining sostituite da WM.AddMachining in modo da trascrivere le priorità da btl alle lavorazioni.
-- Tabella per definizione modulo -- Tabella per definizione modulo
local WPMK = {} local WPMK = {}
@@ -107,7 +108,7 @@ function WPMK.Make( Proc, nRawId, b3Raw)
end end
-- inserisco la lavorazione di fresatura -- inserisco la lavorazione di fresatura
local sName = 'Decor_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName = 'Decor_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sName, sMilling) local nMchFId = WM.AddMachining( Proc.Id, sName, sMilling)
if not nMchFId then if not nMchFId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -131,7 +132,7 @@ function WPMK.Make( Proc, nRawId, b3Raw)
if AuxId then if AuxId then
-- inserisco la lavorazione di fresatura -- inserisco la lavorazione di fresatura
local sName2 = 'Decor2_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName2 = 'Decor2_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchF2Id = EgtAddMachining( sName, sMilling) local nMchF2Id = WM.AddMachining( Proc.Id, sName, sMilling)
if not nMchF2Id then if not nMchF2Id then
local sErr = 'Error adding machining ' .. sName2 .. '-' .. sMilling local sErr = 'Error adding machining ' .. sName2 .. '-' .. sMilling
EgtOutLog( sErr) EgtOutLog( sErr)
+2 -1
View File
@@ -1,6 +1,7 @@
-- WProcessMortise.lua by Egaltech s.r.l. 2021/07/30 -- WProcessMortise.lua by Egaltech s.r.l. 2021/07/30
-- Gestione calcolo mortase per Pareti -- Gestione calcolo mortase per Pareti
-- 2023/01/05 Permesse le mortase laterali in presenza di offset Z, tra grezzo e tavola, di almeno 100 mm -- 2023/01/05 Permesse le mortase laterali in presenza di offset Z, tra grezzo e tavola, di almeno 100 mm
-- 2023/05/25 Funzioni EgtAddMachining sostituite da WM.AddMachining in modo da trascrivere le priorità da btl alle lavorazioni.
-- Tabella per definizione modulo -- Tabella per definizione modulo
local WPM = {} local WPM = {}
@@ -250,7 +251,7 @@ function WPM.Make( Proc, nRawId, b3Raw)
end end
-- inserisco la lavorazione di svuotatura -- inserisco la lavorazione di svuotatura
local sName = 'Mort_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName = 'Mort_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sName, sPocketing) local nMchFId = WM.AddMachining( Proc.Id, sName, sPocketing)
if not nMchFId then if not nMchFId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing
EgtOutLog( sErr) EgtOutLog( sErr)
+2 -1
View File
@@ -1,5 +1,6 @@
-- WProcessText.lua by Egaltech s.r.l. 2021/04/20 -- WProcessText.lua by Egaltech s.r.l. 2021/04/20
-- Gestione calcolo testi per Travi -- Gestione calcolo testi per Travi
-- 2023/05/25 Funzioni EgtAddMachining sostituite da WM.AddMachining in modo da trascrivere le priorità da btl alle lavorazioni.
-- Tabella per definizione modulo -- Tabella per definizione modulo
local WPT = {} local WPT = {}
@@ -77,7 +78,7 @@ function WPT.Make( Proc, nRawId, b3Raw)
end end
-- inserisco la lavorazione di fresatura -- inserisco la lavorazione di fresatura
local sName = 'Text_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName = 'Text_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sName, sMilling) local nMchFId = WM.AddMachining( Proc.Id, sName, sMilling)
if not nMchFId then if not nMchFId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
EgtOutLog( sErr) EgtOutLog( sErr)
+2 -1
View File
@@ -1,5 +1,6 @@
-- WProcessVariant.lua by Egaltech s.r.l. 2021/08/27 -- WProcessVariant.lua by Egaltech s.r.l. 2021/08/27
-- Gestione calcolo Feature Custom (Variant) per Pareti -- Gestione calcolo Feature Custom (Variant) per Pareti
-- 2023/05/25 Funzioni EgtAddMachining sostituite da WM.AddMachining in modo da trascrivere le priorità da btl alle lavorazioni.
-- Tabella per definizione modulo -- Tabella per definizione modulo
local WPV = {} local WPV = {}
@@ -71,7 +72,7 @@ local function MakeCode_1( Proc, nRawId, b3Raw)
end end
-- inserisco la lavorazione di finitura superficie -- inserisco la lavorazione di finitura superficie
local sName = 'SurfFin_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName = 'SurfFin_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sName, sSurfFin) local nMchFId = WM.AddMachining( Proc.Id, sName, sSurfFin)
if not nMchFId then if not nMchFId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sSurfFin local sErr = 'Error adding machining ' .. sName .. '-' .. sSurfFin
EgtOutLog( sErr) EgtOutLog( sErr)
+61 -25
View File
@@ -1,5 +1,6 @@
-- WallExec.lua by Egaltech s.r.l. 2023/03/06 -- WallExec.lua by Egaltech s.r.l. 2023/03/06
-- Libreria esecuzione lavorazioni per Pareti -- Libreria esecuzione lavorazioni per Pareti
-- 2023/05/25 Aggiunto ordinamento in base a prioritò da btl.
-- Tabella per definizione modulo -- Tabella per definizione modulo
local WallExec = {} local WallExec = {}
@@ -409,7 +410,7 @@ local function ContainsStartName( nOperId, StartNames)
end end
------ Ordinamento dei tagli, delle fresature e delle forature ------- ------ Ordinamento dei tagli, delle fresature e delle forature -------
local function SortMach( nPhase, PrevMch, nPartId, nType, StartNames, bExistName, sInfo, bExistInfo, bOneWay, bByTool, bByToolAngle) local function SortMach( nPhase, PrevMch, nPartId, nType, StartNames, bExistName, sInfo, bExistInfo, bOneWay, bByTool, bByToolAngle, nPriority)
-- dichiarazione tabella -- dichiarazione tabella
local TabCut = {} local TabCut = {}
-- Recupero gli identificativi delle lavorazioni e annullo eventuali allungamenti e Id di altre lavorazioni rappresentate -- Recupero gli identificativi delle lavorazioni e annullo eventuali allungamenti e Id di altre lavorazioni rappresentate
@@ -419,6 +420,7 @@ local function SortMach( nPhase, PrevMch, nPartId, nType, StartNames, bExistName
-- Se appartiene alla fase corrente e taglio con lama non da sopra (sempre su 1 sola entità) -- Se appartiene alla fase corrente e taglio con lama non da sopra (sempre su 1 sola entità)
if EgtGetOperationPhase( nOperId) == nPhase and ( nType & nOperType) == nOperType and if EgtGetOperationPhase( nOperId) == nPhase and ( nType & nOperType) == nOperType and
( not nPartId or EgtGetInfo( nOperId, 'Part', 'i') == nPartId) and ( not nPartId or EgtGetInfo( nOperId, 'Part', 'i') == nPartId) and
( not nPriority or EgtGetInfo( nOperId, 'PRIORITY', 'i') == nPriority ) and
( not StartNames or ( bExistName and ContainsStartName( nOperId, StartNames)) or ( not StartNames or ( bExistName and ContainsStartName( nOperId, StartNames)) or
( not bExistName and not ContainsStartName( nOperId, StartNames))) and ( not bExistName and not ContainsStartName( nOperId, StartNames))) and
( not sInfo or ( bExistInfo and EgtGetInfo( nOperId, sInfo, 'i') == 1) or ( not sInfo or ( bExistInfo and EgtGetInfo( nOperId, sInfo, 'i') == 1) or
@@ -535,17 +537,17 @@ local function SortMach( nPhase, PrevMch, nPartId, nType, StartNames, bExistName
end end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
local function SortMachinings( nPhase, PrevMch, nPartId) local function SortMachinings( nPhase, PrevMch, nPartId, nPriority)
-- Chiodature -- Chiodature
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Nail_'}, true, nil, nil, nil, true) PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Nail_'}, true, nil, nil, nil, true, nil, nPriority)
-- Tagli con sega a catena che sono rifiniture di spigoli -- Tagli con sega a catena che sono rifiniture di spigoli
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MORTISING, { 'Csaw_'}, false) PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MORTISING, { 'Csaw_'}, false, nil, nil, nil, nil, nil, nPriority)
-- Forature orizzontali con punte lunghe -- Forature orizzontali con punte lunghe
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING, { 'LhDrill_'}, true, 'MOVE_AFTER', false, true) PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING, { 'LhDrill_'}, true, 'MOVE_AFTER', false, true, nil, nil, nPriority)
-- Preforature per fori inclinati -- Preforature per fori inclinati
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.POCKETING, { 'PreDrill_'}, true) PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.POCKETING, { 'PreDrill_'}, true, nil, nil, nil, nil, nil, nPriority)
-- Forature e Svuotature -- Forature e Svuotature
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING + MCH_OY.POCKETING + MCH_OY.MILLING, { 'SideMill_', 'Clean_'}, false, 'MOVE_AFTER', false, false, true) PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING + MCH_OY.POCKETING + MCH_OY.MILLING, { 'SideMill_', 'Clean_'}, false, 'MOVE_AFTER', false, false, true, nil, nPriority)
-- -- Forature *** -- -- Forature ***
-- PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING, nil, nil, 'MOVE_AFTER', false) -- PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING, nil, nil, 'MOVE_AFTER', false)
-- -- Svuotature *** -- -- Svuotature ***
@@ -553,30 +555,32 @@ local function SortMachinings( nPhase, PrevMch, nPartId)
-- -- Fresature che sono rifiniture di spigoli -- -- Fresature che sono rifiniture di spigoli
-- PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Clean_'}, false, 'MOVE_AFTER', false, false, true) -- PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Clean_'}, false, 'MOVE_AFTER', false, false, true)
-- Lavorazioni di superficie -- Lavorazioni di superficie
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_MY.SURFFINISHING, nil, nil, 'MOVE_AFTER', false) PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_MY.SURFFINISHING, nil, nil, 'MOVE_AFTER', false, nil, nil, nil, nPriority)
-- Fresature per gole -- Fresature per gole
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Gorge_'}, true, 'MOVE_AFTER', false) PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Gorge_'}, true, 'MOVE_AFTER', false, nil, nil, nil, nPriority)
-- Fresature che sono rifiniture di spigoli -- Fresature che sono rifiniture di spigoli
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'SideMill_'}, true, 'MOVE_AFTER', false, false, true, true) PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'SideMill_'}, true, 'MOVE_AFTER', false, false, true, true, nPriority)
-- Fresature che sono puliture di spigoli -- Fresature che sono puliture di spigoli
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Clean_'}, true, 'MOVE_AFTER', false, false, true) PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Clean_'}, true, 'MOVE_AFTER', false, false, true, nil, nPriority)
-- Tagli per gole -- Tagli per gole
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.SAWING, { 'GorgeCut_'}, true) PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.SAWING, { 'GorgeCut_'}, true, nil, nil, nil, nil, nil, nPriority)
-- Tagli con lama -- Tagli con lama
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.SAWING) PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.SAWING, nil, nil, nil, nil, nil, nil, nil, nPriority)
-- Qui rimozione sfridi (se ci sono lavorazioni successive) -- Qui rimozione sfridi (se ci sono lavorazioni successive)
-- Fresature dei lapjoint che necessitano di gorge if not nPriority then
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'SideMill_'}, true, 'MOVE_AFTER', true, false, true, true) -- Fresature dei lapjoint che necessitano di gorge
-- Tagli con sega a catena che vanno fatti dopo i tagli con lama PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'SideMill_'}, true, 'MOVE_AFTER', true, false, true, true)
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MORTISING, { 'Csaw_'}, true) -- Tagli con sega a catena che vanno fatti dopo i tagli con lama
-- Fresature (puliture di spigoli) che vanno fatte dopo i tagli con lama PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MORTISING, { 'Csaw_'}, true)
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, nil, nil, 'MOVE_AFTER', true) -- Fresature (puliture di spigoli) che vanno fatte dopo i tagli con lama
-- Forature che vanno fatte dopo i tagli con lama PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, nil, nil, 'MOVE_AFTER', true)
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING, nil, nil, 'MOVE_AFTER', true) -- Forature che vanno fatte dopo i tagli con lama
-- Svuotature che vanno fatte dopo i tagli con lama PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING, nil, nil, 'MOVE_AFTER', true)
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.POCKETING, nil, nil, 'MOVE_AFTER', true) -- Svuotature che vanno fatte dopo i tagli con lama
-- Lavorazioni di superficie che vanno fatte dopo i tagli con lama PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.POCKETING, nil, nil, 'MOVE_AFTER', true)
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_MY.SURFFINISHING, nil, nil, 'MOVE_AFTER', true) -- Lavorazioni di superficie che vanno fatte dopo i tagli con lama
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_MY.SURFFINISHING, nil, nil, 'MOVE_AFTER', true)
end
return PrevMch return PrevMch
end end
@@ -641,6 +645,38 @@ function WallExec.ProcessFeatures()
-- riordino le lavorazioni tra tutti i pezzi -- riordino le lavorazioni tra tutti i pezzi
local nPhase = 1 local nPhase = 1
local PrevMch = EgtGetPhaseDisposition( nPhase) local PrevMch = EgtGetPhaseDisposition( nPhase)
-- abilitazione ordinamento con priorità da btl: 0 = no, 1 = ordine crescente, 2 = ordine decrescente
-- le lavorazioni con priorità 0 o senza priorità saranno lasciate per ultime
local nGetPriorityFromBtl = WD.BTL_PRIORITY or 0
if nGetPriorityFromBtl > 0 then
local vPriority = {}
local nOperId = EgtGetNextOperation( PrevMch)
local nCurrentPriorityId = 1
while nOperId do
local nPriority = EgtGetInfo( nOperId or GDB_ID.NULL, 'PRIORITY', 'i')
if nPriority and nPriority ~= 0 then
vPriority[nCurrentPriorityId] = nPriority
nCurrentPriorityId = nCurrentPriorityId + 1
end
nOperId = EgtGetNextOperation( nOperId)
end
-- sorting delle priorità
-- ordine crescente
if nGetPriorityFromBtl == 1 then
table.sort( vPriority)
-- ordine decrescente
else
table.sort( vPriority, function( a, b) return a > b end)
end
-- riordino le lavorazioni per priorità
for i = 1, #vPriority do
if i == 1 or ( vPriority[i] ~= vPriority[i - 1]) then
PrevMch = SortMachinings( nPhase, PrevMch, nil, vPriority[i])
end
end
end
SortMachinings( nPhase, PrevMch) SortMachinings( nPhase, PrevMch)
-- Aggiornamento finale di tutto -- Aggiornamento finale di tutto
EgtSetCurrPhase( 1) EgtSetCurrPhase( 1)
+76 -75
View File
@@ -56,21 +56,22 @@ local Text = require( 'WProcessText')
-- Carico i dati globali -- Carico i dati globali
local WD = require( 'WallData') local WD = require( 'WallData')
-------------------------------------------------------------------
local function ClassifyFlip( vPartProc, b3Part) local function ClassifyFlip( vPartProc, b3Part)
local FlipFeatureStates = {} local FlipFeatureStates = {}
local bLapJoints = false local bLapJoints = false
for nInd = 1, #vPartProc do for nInd = 1, #vPartProc do
if LapJoint.Identify( vPartProc[nInd]) then if LapJoint.Identify( vPartProc[nInd]) then
-- setto parametro Q -- setto parametro Q
if vPartProc[nInd].Prc == 30 then if vPartProc[nInd].Prc == 30 then
EgtSetInfo( vPartProc[nInd].Id, "Q08", 1) EgtSetInfo( vPartProc[nInd].Id, "Q08", 1)
EgtSetInfo( vPartProc[nInd].Id, "Q08A", 1) EgtSetInfo( vPartProc[nInd].Id, "Q08A", 1)
else else
EgtSetInfo( vPartProc[nInd].Id, "Q03", 1) EgtSetInfo( vPartProc[nInd].Id, "Q03", 1)
EgtSetInfo( vPartProc[nInd].Id, "Q03A", 1) EgtSetInfo( vPartProc[nInd].Id, "Q03A", 1)
end end
bLapJoints = true bLapJoints = true
local nFlip0, nFlip1 = LapJoint.FlipClassify(vPartProc[nInd]) local nFlip0, nFlip1 = LapJoint.FlipClassify(vPartProc[nInd])
if nFlip0 and nFlip1 and nFlip0 ~= nFlip1 then if nFlip0 and nFlip1 and nFlip0 ~= nFlip1 then
@@ -80,7 +81,7 @@ local function ClassifyFlip( vPartProc, b3Part)
local nFlip0, nFlip1 = Drill.FlipClassify(vPartProc[nInd], b3Part) local nFlip0, nFlip1 = Drill.FlipClassify(vPartProc[nInd], b3Part)
if nFlip0 and nFlip1 and nFlip0 ~= nFlip1 then if nFlip0 and nFlip1 and nFlip0 ~= nFlip1 then
table.insert( FlipFeatureStates, { Flip0 = nFlip0, Flip1 = nFlip1}) table.insert( FlipFeatureStates, { Flip0 = nFlip0, Flip1 = nFlip1})
end end
elseif Cut.Identify( vPartProc[nInd]) then elseif Cut.Identify( vPartProc[nInd]) then
local nFlip0, nFlip1 = Cut.FlipClassify(vPartProc[nInd], b3Part) local nFlip0, nFlip1 = Cut.FlipClassify(vPartProc[nInd], b3Part)
if nFlip0 and nFlip1 and nFlip0 ~= nFlip1 then if nFlip0 and nFlip1 and nFlip0 ~= nFlip1 then
@@ -90,7 +91,7 @@ local function ClassifyFlip( vPartProc, b3Part)
-- setto parametro Q -- setto parametro Q
if vPartProc[nInd].Prc == 12 then if vPartProc[nInd].Prc == 12 then
EgtSetInfo( vPartProc[nInd].Id, "Q02", 1) EgtSetInfo( vPartProc[nInd].Id, "Q02", 1)
EgtSetInfo( vPartProc[nInd].Id, "Q02A", 1) EgtSetInfo( vPartProc[nInd].Id, "Q02A", 1)
end end
local nFlip0, nFlip1 = DoubleCut.FlipClassify(vPartProc[nInd], b3Part) local nFlip0, nFlip1 = DoubleCut.FlipClassify(vPartProc[nInd], b3Part)
if nFlip0 and nFlip1 and nFlip0 ~= nFlip1 then if nFlip0 and nFlip1 and nFlip0 ~= nFlip1 then
@@ -100,7 +101,7 @@ local function ClassifyFlip( vPartProc, b3Part)
local nFlip0, nFlip1 = SawCut.FlipClassify(vPartProc[nInd], b3Part) local nFlip0, nFlip1 = SawCut.FlipClassify(vPartProc[nInd], b3Part)
if nFlip0 and nFlip1 and nFlip0 ~= nFlip1 then if nFlip0 and nFlip1 and nFlip0 ~= nFlip1 then
table.insert( FlipFeatureStates, { Flip0 = nFlip0, Flip1 = nFlip1}) table.insert( FlipFeatureStates, { Flip0 = nFlip0, Flip1 = nFlip1})
end end
elseif FreeContour.Identify( vPartProc[nInd]) then elseif FreeContour.Identify( vPartProc[nInd]) then
local nFlip0, nFlip1 = FreeContour.FlipClassify(vPartProc[nInd], b3Part) local nFlip0, nFlip1 = FreeContour.FlipClassify(vPartProc[nInd], b3Part)
if nFlip0 and nFlip1 and nFlip0 ~= nFlip1 then if nFlip0 and nFlip1 and nFlip0 ~= nFlip1 then
@@ -120,19 +121,19 @@ local function ClassifyFlip( vPartProc, b3Part)
local nFlip0, nFlip1 = Mark.FlipClassify(vPartProc[nInd], b3Part) local nFlip0, nFlip1 = Mark.FlipClassify(vPartProc[nInd], b3Part)
if nFlip0 and nFlip1 and nFlip0 ~= nFlip1 then if nFlip0 and nFlip1 and nFlip0 ~= nFlip1 then
table.insert( FlipFeatureStates, { Flip0 = nFlip0, Flip1 = nFlip1}) table.insert( FlipFeatureStates, { Flip0 = nFlip0, Flip1 = nFlip1})
end end
elseif Text.Identify( vPartProc[nInd]) then elseif Text.Identify( vPartProc[nInd]) then
local nFlip0, nFlip1 = Text.FlipClassify(vPartProc[nInd], b3Part) local nFlip0, nFlip1 = Text.FlipClassify(vPartProc[nInd], b3Part)
if nFlip0 and nFlip1 and nFlip0 ~= nFlip1 then if nFlip0 and nFlip1 and nFlip0 ~= nFlip1 then
table.insert( FlipFeatureStates, { Flip0 = nFlip0, Flip1 = nFlip1}) table.insert( FlipFeatureStates, { Flip0 = nFlip0, Flip1 = nFlip1})
end end
end end
end end
return FlipFeatureStates, bLapJoints return FlipFeatureStates, bLapJoints
end end
-------------------------------------------------------------------
local function ClassifyRotation( vPartProc) local function ClassifyRotation( vPartProc)
local RotateFeatureStates = {} local RotateFeatureStates = {}
@@ -144,22 +145,21 @@ local function ClassifyRotation( vPartProc)
end end
end end
end end
return RotateFeatureStates
return RotateFeatureStates
end end
--- -------------------------------------------------------------------
-------------------------------------------------------------------
local vPartProc = WE.CollectFeatures( NFAR.PARTID) local vPartProc = WE.CollectFeatures( NFAR.PARTID)
local b3Part = EgtGetBBoxGlob( NFAR.PARTID, GDB_BB.STANDARD) local b3Part = EgtGetBBoxGlob( NFAR.PARTID, GDB_BB.STANDARD)
local bManualFlip = EgtGetInfo( NFAR.PARTID, "MANUALFLIP", 'b') local bManualFlip = EgtGetInfo( NFAR.PARTID, "MANUALFLIP", 'b')
local bManualRot = EgtGetInfo( NFAR.PARTID, "MANUALROT", 'b') local bManualRot = EgtGetInfo( NFAR.PARTID, "MANUALROT", 'b')
-- FLIP -- FLIP
local FlipFeatureStates, bLapJoints = ClassifyFlip( vPartProc, b3Part) local FlipFeatureStates, bLapJoints = ClassifyFlip( vPartProc, b3Part)
if not bManualFlip then if not bManualFlip then
local bFlip local bFlip
-- analizzo stati flip delle feature -- analizzo stati flip delle feature
local nFlip0Min = 100 local nFlip0Min = 100
local nFlip0Cnt = 0 local nFlip0Cnt = 0
@@ -187,16 +187,16 @@ if not bManualFlip then
elseif nFlip0Cnt < nFlip1Cnt then elseif nFlip0Cnt < nFlip1Cnt then
bFlip = false bFlip = false
elseif bLapJoints then elseif bLapJoints then
-- se equivalenti ma ci sono lap joints, fisso il flip per non avere problemi con le aree di lavorazione nel nesting -- se equivalenti ma ci sono lap joints, fisso il flip per non avere problemi con le aree di lavorazione nel nesting
bFlip = false bFlip = false
end end
elseif nFlip0Min < nFlip1Min then elseif nFlip0Min < nFlip1Min then
bFlip = true bFlip = true
else else
bFlip = false bFlip = false
end end
if bFlip ~= nil then if bFlip ~= nil then
-- se una posizione è più conveniente dell'altra setto info nel pezzo -- se una posizione è più conveniente dell'altra setto info nel pezzo
EgtSetInfo( NFAR.PARTID, "NestAllowFlip", false) EgtSetInfo( NFAR.PARTID, "NestAllowFlip", false)
EgtSetInfo( NFAR.PARTID, "NestFlip", bFlip) EgtSetInfo( NFAR.PARTID, "NestFlip", bFlip)
@@ -206,10 +206,10 @@ if not bManualFlip then
if bFlip then if bFlip then
-- flip pezzo -- flip pezzo
EgtRotate( NFAR.PARTID, b3Part:getCenter(), X_AX(), 180, GDB_RT.GLOB) EgtRotate( NFAR.PARTID, b3Part:getCenter(), X_AX(), 180, GDB_RT.GLOB)
-- modifico le info del pezzo -- modifico le info del pezzo
local nPartFlip = EgtGetInfo( NFAR.PARTID, "INVERTED", 'i') or 0 local nPartFlip = EgtGetInfo( NFAR.PARTID, "INVERTED", 'i') or 0
local nTotFlip = EgtIf( nPartFlip == 180, 0, 180) local nTotFlip = EgtIf( nPartFlip == 180, 0, 180)
EgtSetInfo( NFAR.PARTID, "INVERTED", nTotFlip) EgtSetInfo( NFAR.PARTID, "INVERTED", nTotFlip)
EgtSetInfo( NFAR.PARTID, "FLIPROTMODIFIED", 1) EgtSetInfo( NFAR.PARTID, "FLIPROTMODIFIED", 1)
end end
@@ -217,12 +217,12 @@ end
-- rimuovo parametri Q -- rimuovo parametri Q
local b3PartInside = BBox3d( b3Part) local b3PartInside = BBox3d( b3Part)
b3PartInside:expand( - WD.INSIDE_RAW_TOL) b3PartInside:expand( - ( WD.INSIDE_RAW_TOL or 30))
for nInd = 1, #vPartProc do for nInd = 1, #vPartProc do
local Proc = vPartProc[nInd] local Proc = vPartProc[nInd]
if LapJoint.Identify( Proc) then if LapJoint.Identify( Proc) then
-- cerco la faccia rivolta verso l'alto e la faccia rivolta verso il basso -- cerco la faccia rivolta verso l'alto e la faccia rivolta verso il basso
local nFaceInd = -1 local nFaceInd = -1
local nFaceDownInd = -1 local nFaceDownInd = -1
for nIdx = 0, Proc.Fct - 1 do for nIdx = 0, Proc.Fct - 1 do
@@ -231,8 +231,8 @@ for nInd = 1, #vPartProc do
nFaceInd = nIdx nFaceInd = nIdx
elseif vtN:getZ() < - 0.95 then elseif vtN:getZ() < - 0.95 then
nFaceDownInd = nIdx nFaceDownInd = nIdx
end end
end end
-- se è lap joint dall'alto -- se è lap joint dall'alto
if nFaceInd ~= -1 and nFaceDownInd == -1 then if nFaceInd ~= -1 and nFaceDownInd == -1 then
local ptCen = EgtSurfTmFacetCenter( Proc.Id, nFaceInd, GDB_ID.ROOT) local ptCen = EgtSurfTmFacetCenter( Proc.Id, nFaceInd, GDB_ID.ROOT)
@@ -241,11 +241,11 @@ for nInd = 1, #vPartProc do
-- resetto parametro Q -- resetto parametro Q
if Proc.Prc == 30 then if Proc.Prc == 30 then
EgtRemoveInfo( Proc.Id, "Q08") EgtRemoveInfo( Proc.Id, "Q08")
EgtRemoveInfo( Proc.Id, "Q08A") EgtRemoveInfo( Proc.Id, "Q08A")
else else
EgtRemoveInfo( Proc.Id, "Q03") EgtRemoveInfo( Proc.Id, "Q03")
EgtRemoveInfo( Proc.Id, "Q03A") EgtRemoveInfo( Proc.Id, "Q03A")
end end
end end
end end
@@ -264,21 +264,22 @@ for nInd = 1, #vPartProc do
-- resetto parametro Q -- resetto parametro Q
if Proc.Prc == 12 then if Proc.Prc == 12 then
EgtRemoveInfo( Proc.Id, "Q02") EgtRemoveInfo( Proc.Id, "Q02")
EgtRemoveInfo( Proc.Id, "Q02A") EgtRemoveInfo( Proc.Id, "Q02A")
end end
end end
end end
end end
end end
end end
-- ROTATION -- ROTATION
nRotate = 0 nRotate = 0
-- venatura -- venatura
EgtRemoveInfo( NFAR.PARTID, "HasGrainDirection") EgtRemoveInfo( NFAR.PARTID, "HasGrainDirection")
local bGrain = false local bGrain = false
local sGrainInfo = EgtGetInfo( NFAR.PARTID, "GRAINDIRECTION", 's') local sGrainInfo = EgtGetInfo( NFAR.PARTID, "GRAINDIRECTION", 's')
if sGrainInfo then if sGrainInfo then
local sGrainAlign = string.sub( sGrainInfo, 7) local sGrainAlign = string.sub( sGrainInfo, 7)
local sGrainDir = string.sub( sGrainInfo, 1, 5) local sGrainDir = string.sub( sGrainInfo, 1, 5)
@@ -286,21 +287,21 @@ if sGrainInfo then
EgtSetInfo( NFAR.PARTID, "HasGrainDirection", 1) EgtSetInfo( NFAR.PARTID, "HasGrainDirection", 1)
bGrain = true bGrain = true
-- trovo la rotazione ( a meno di 180°) che deve avere il pezzo per essere allineato con la venatura del grezzo -- trovo la rotazione ( a meno di 180°) che deve avere il pezzo per essere allineato con la venatura del grezzo
local nGrainRot = 0 local nGrainRot = 0
if ( sGrainDir == "1,0,0" and not NFAR.RAW_GRAIN_DIR_X) or ( sGrainDir == "0,1,0" and NFAR.RAW_GRAIN_DIR_X) then if ( sGrainDir == "1,0,0" and not NFAR.RAW_GRAIN_DIR_X) or ( sGrainDir == "0,1,0" and NFAR.RAW_GRAIN_DIR_X) then
nGrainRot = 90 nGrainRot = 90
end end
local nPartRot = EgtGetInfo( NFAR.PARTID, "ROTATED", 'i') or 0 local nPartRot = EgtGetInfo( NFAR.PARTID, "ROTATED", 'i') or 0
if ( nGrainRot == 0 and ( nPartRot == 90 or nPartRot == 270)) or ( nGrainRot == 90 and ( nPartRot == 0 or nPartRot == 180)) then if ( nGrainRot == 0 and ( nPartRot == 90 or nPartRot == 270)) or ( nGrainRot == 90 and ( nPartRot == 0 or nPartRot == 180)) then
local b3Part = EgtGetBBoxGlob( NFAR.PARTID, GDB_BB.STANDARD) local b3Part = EgtGetBBoxGlob( NFAR.PARTID, GDB_BB.STANDARD)
EgtRotate( NFAR.PARTID, b3Part:getCenter(), Z_AX(), 90, GDB_RT.GLOB) EgtRotate( NFAR.PARTID, b3Part:getCenter(), Z_AX(), 90, GDB_RT.GLOB)
nRotate = 90 nRotate = 90
end end
end end
end end
if not bManualRot then if not bManualRot then
local RotateFeatureStates = ClassifyRotation( vPartProc) local RotateFeatureStates = ClassifyRotation( vPartProc)
@@ -346,7 +347,7 @@ if not bManualRot then
{ Rot = 90, Score = nRot90Min, ScoreCnt = nRot90Cnt}, { Rot = 90, Score = nRot90Min, ScoreCnt = nRot90Cnt},
{ Rot = 180, Score = nRot180Min, ScoreCnt = nRot180Cnt}, { Rot = 180, Score = nRot180Min, ScoreCnt = nRot180Cnt},
{ Rot = 270, Score = nRot270Min, ScoreCnt = nRot270Cnt}} { Rot = 270, Score = nRot270Min, ScoreCnt = nRot270Cnt}}
local nRotateOpt = 0 local nRotateOpt = 0
if #RotateFeatureStates > 0 then if #RotateFeatureStates > 0 then
-- calcolo lato con punteggio minore o molteplicita' piu' alta -- calcolo lato con punteggio minore o molteplicita' piu' alta
local nRotMax = MinList[1].Rot local nRotMax = MinList[1].Rot
@@ -359,7 +360,7 @@ if not bManualRot then
nScoreCnt = MinList[nInd].ScoreCnt nScoreCnt = MinList[nInd].ScoreCnt
elseif MinList[nInd].Score == nScoreMax then elseif MinList[nInd].Score == nScoreMax then
-- se punteggio > 0 conservo quello con molteplicità più alta, se punteggio = 0 conservo quello con molteplicità più bassa -- se punteggio > 0 conservo quello con molteplicità più alta, se punteggio = 0 conservo quello con molteplicità più bassa
if ( nScoreMax ~= 0 and MinList[nInd].ScoreCnt > nScoreCnt) or ( nScoreMax == 0 and MinList[nInd].ScoreCnt < nScoreCnt) then if ( nScoreMax ~= 0 and MinList[nInd].ScoreCnt > nScoreCnt) or ( nScoreMax == 0 and MinList[nInd].ScoreCnt < nScoreCnt) then
nRotMax = MinList[nInd].Rot nRotMax = MinList[nInd].Rot
nScoreMax = MinList[nInd].Score nScoreMax = MinList[nInd].Score
nScoreCnt = MinList[nInd].ScoreCnt nScoreCnt = MinList[nInd].ScoreCnt
@@ -369,7 +370,7 @@ if not bManualRot then
nRotateOpt = nRotMax nRotateOpt = nRotMax
else else
nRotateOpt = 0 nRotateOpt = 0
end end
local bRotNest = false local bRotNest = false
local nStepRotNest = 0 local nStepRotNest = 0
@@ -387,40 +388,40 @@ if not bManualRot then
-- altrimenti permetto tutto -- altrimenti permetto tutto
bRotNest = true bRotNest = true
nStepRotNest = 90 nStepRotNest = 90
end end
-- verifico se ci sono fori lungo Y che bloccano la rotazione -- verifico se ci sono fori lungo Y che bloccano la rotazione
local bDrillOnY = ( nStepRotNest == 180) local bDrillOnY = ( nStepRotNest == 180)
local b3Part = EgtGetBBoxGlob( NFAR.PARTID, GDB_BB.STANDARD) local b3Part = EgtGetBBoxGlob( NFAR.PARTID, GDB_BB.STANDARD)
if bGrain then if bGrain then
-- se venatura eseguo rotazione solo se è di 180° -- se venatura eseguo rotazione solo se è di 180°
if nRotateOpt == 180 then if nRotateOpt == 180 then
EgtRotate( NFAR.PARTID, b3Part:getCenter(), Z_AX(), nRotateOpt, GDB_RT.GLOB) EgtRotate( NFAR.PARTID, b3Part:getCenter(), Z_AX(), nRotateOpt, GDB_RT.GLOB)
nRotate = nRotate + nRotateOpt nRotate = nRotate + nRotateOpt
end end
nStepRotNest = 180 nStepRotNest = 180
else else
-- eseguo rotazione -- eseguo rotazione
EgtRotate( NFAR.PARTID, b3Part:getCenter(), Z_AX(), nRotateOpt, GDB_RT.GLOB) EgtRotate( NFAR.PARTID, b3Part:getCenter(), Z_AX(), nRotateOpt, GDB_RT.GLOB)
nRotate = nRotate + nRotateOpt nRotate = nRotate + nRotateOpt
end end
-- verifico se rotazione è valida ( pezzo contenuto nel grezzo) solo se no venatura -- verifico se rotazione è valida ( pezzo contenuto nel grezzo) solo se no venatura
if not bGrain then if not bGrain then
b3Part = EgtGetBBoxGlob( NFAR.PARTID, GDB_BB.STANDARD) b3Part = EgtGetBBoxGlob( NFAR.PARTID, GDB_BB.STANDARD)
local bValidRotationForRaw = b3Part:getDimX() < WD.MAX_LENGTH and b3Part:getDimY() < WD.MAX_WIDTH local bValidRotationForRaw = b3Part:getDimX() < WD.MAX_LENGTH and b3Part:getDimY() < WD.MAX_WIDTH
local bRotatedIsValid = b3Part:getDimY() < WD.MAX_LENGTH and b3Part:getDimX() < WD.MAX_WIDTH local bRotatedIsValid = b3Part:getDimY() < WD.MAX_LENGTH and b3Part:getDimX() < WD.MAX_WIDTH
if not bValidRotationForRaw and bRotatedIsValid then if not bValidRotationForRaw and bRotatedIsValid then
EgtRotate( NFAR.PARTID, b3Part:getCenter(), Z_AX(), 90, GDB_RT.GLOB) EgtRotate( NFAR.PARTID, b3Part:getCenter(), Z_AX(), 90, GDB_RT.GLOB)
nRotate = nRotate + 90 nRotate = nRotate + 90
nStepRotNest = 180 nStepRotNest = 180
end end
end end
-- se no venatura e non ci sono fori verifico se il pezzo cade -- se no venatura e non ci sono fori verifico se il pezzo cade
if not bGrain and not bDrillOnY then if not bGrain and not bDrillOnY then
b3Part = EgtGetBBoxGlob( NFAR.PARTID, GDB_BB.STANDARD) b3Part = EgtGetBBoxGlob( NFAR.PARTID, GDB_BB.STANDARD)
local bValidRotation = b3Part:getDimX() > ( WD.INTRULLI or 1200) local bValidRotation = b3Part:getDimX() > ( WD.INTRULLI or 1200)
-- verifico se ruotata resta valida -- verifico se ruotata resta valida
@@ -428,22 +429,22 @@ if not bManualRot then
-- se non è valida ma ruotato lo sarebbe, ruoto -- se non è valida ma ruotato lo sarebbe, ruoto
if not bValidRotation and bRotatedIsValid and nStepRotNest ~= 180 then if not bValidRotation and bRotatedIsValid and nStepRotNest ~= 180 then
EgtRotate( NFAR.PARTID, b3Part:getCenter(), Z_AX(), 90, GDB_RT.GLOB) EgtRotate( NFAR.PARTID, b3Part:getCenter(), Z_AX(), 90, GDB_RT.GLOB)
nRotate = nRotate + 90 nRotate = nRotate + 90
nStepRotNest = 180 nStepRotNest = 180
elseif bValidRotation and not bRotatedIsValid then elseif bValidRotation and not bRotatedIsValid then
-- se fosse valida ma la sua ruotata no, allora blocco lo step nella rotazione del nesting -- se fosse valida ma la sua ruotata no, allora blocco lo step nella rotazione del nesting
nStepRotNest = 180 nStepRotNest = 180
end end
end end
-- setto info nel pezzo -- setto info nel pezzo
if nRotate > 0 then if nRotate > 0 then
local nPartRot = EgtGetInfo( NFAR.PARTID, "ROTATED", 'i') or 0 local nPartRot = EgtGetInfo( NFAR.PARTID, "ROTATED", 'i') or 0
local nTotRot = nPartRot - nRotate local nTotRot = nPartRot - nRotate
nTotRot = EgtIf( nTotRot < 0, nTotRot + 360, nTotRot) nTotRot = EgtIf( nTotRot < 0, nTotRot + 360, nTotRot)
EgtSetInfo( NFAR.PARTID, "ROTATED", nTotRot) EgtSetInfo( NFAR.PARTID, "ROTATED", nTotRot)
EgtSetInfo( NFAR.PARTID, "FLIPROTMODIFIED", 1) EgtSetInfo( NFAR.PARTID, "FLIPROTMODIFIED", 1)
end end
EgtSetInfo( NFAR.PARTID, "NestStepRot", nStepRotNest) EgtSetInfo( NFAR.PARTID, "NestStepRot", nStepRotNest)
EgtSetInfo( NFAR.PARTID, "NestRot", nRotate) EgtSetInfo( NFAR.PARTID, "NestRot", nRotate)
@@ -451,4 +452,4 @@ if not bManualRot then
end end
NFAR.ERR = 0 NFAR.ERR = 0
+360 -545
View File
File diff suppressed because it is too large Load Diff
+13
View File
@@ -0,0 +1,13 @@
==== Wall Update Log ====
Versione 2.5d2 (20/04/2023)
- Added : in TS3v7 aggiunta gestione flag per taglio feature con outline (da parametro macchina WD.CUT_WITH_OUTLINE)
- Added : in TS3v7 aggiunta gestione flag per rotazione grezzo di 180deg (da parametro macchina WD.RAWPART_ROT)
- Modif : in LapJoint con lavorazione di lato se MCH_SCC.ADIR_NEAR fallisce si riprova con MCH_SCC.ADIR_FAR
- Fixed : in FreeContour e assimilati aggiunta pulitura spigoli Q05=1 anche su sole fresature
- Fixed : in LapJoint e assimilati corretta ricerca utensile in lavorazione 'SideGroove'
- Fixed : in FreeContour e LapJoint la lavorazione CleanCorner viene sempre forzata con lato di lavoro in centro
- Fixed : in LapJoint razionalizzata gestione parametri Q ed eliminta gestione forzatura lama non usata.
Versione 2.5d1 (06/04/23)
- Added : in nesting aggiunti valori di default per alcuni parametri letti dal WallData.
+4 -2
View File
@@ -1,4 +1,6 @@
-- Version.lua by Egalware s.r.l. 2023/03/08 -- Version.lua by Egalware s.r.l. 2023/05/04
-- Gestione della versione di Wall -- Gestione della versione di Wall
VERSION = '2.5c4' NAME = 'Wall'
VERSION = '2.5e1'
MIN_EXE = '2.5b3'