From 5a6ac3ac8da21f49161ef8c51a19a1044aa51fe8 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Tue, 16 Sep 2025 17:08:17 +0200 Subject: [PATCH 1/5] - in PanelSaw rimossa l'estensione dal nome della cutting list generata --- LuaLibs/PanelSaw.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/LuaLibs/PanelSaw.lua b/LuaLibs/PanelSaw.lua index 052a79d..4ba1145 100644 --- a/LuaLibs/PanelSaw.lua +++ b/LuaLibs/PanelSaw.lua @@ -321,7 +321,8 @@ function PanelSaw.GenerateCuttingList( sOutputType) local LinesToWrite = BuildCuttingList( PanelListSingleMaterial, sOutputType) -- scrittura file - local sFilename = sCurrentNgePath .. 'CutList-' .. sCurrentNgeName .. '-' .. key .. '.' .. sOutputType + local sFilename = sCurrentNgePath .. 'CutList-' .. sCurrentNgeName .. '-' .. key .. '-' .. sOutputType + sFilename = sFilename:gsub( '%.', '_') local hFile, nFileErr = io.open( sFilename, 'w') if not hFile then EgtOutLog( 'Error creating cutting list : IO error ' .. tostring( nFileErr)) From 036c782671f9ff14469a316935453d12d89e96cd Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Wed, 17 Sep 2025 15:49:54 +0200 Subject: [PATCH 2/5] =?UTF-8?q?-=20Aggiunto=20campo=20descrizione=20su=20p?= =?UTF-8?q?ezzo=20-=20Aggiunto=20materiale=20su=20Master-Panel=20-=20Possi?= =?UTF-8?q?bilit=C3=A0=20di=20indicare=20il=20numero=20di=20caratteri=20di?= =?UTF-8?q?=20un=20campo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/PanelSaw.lua | 62 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 49 insertions(+), 13 deletions(-) diff --git a/LuaLibs/PanelSaw.lua b/LuaLibs/PanelSaw.lua index 4ba1145..f5c72d2 100644 --- a/LuaLibs/PanelSaw.lua +++ b/LuaLibs/PanelSaw.lua @@ -3,6 +3,7 @@ -- Intestazioni require( 'EgtBase') +EgtEnableDebug( true) local PanelSaw = {} @@ -35,6 +36,7 @@ local function GetPanelList() PanelList[i].idPatt = EgtGetInfo( idMachGroup, 'PATTID', 'i') PanelList[i].nPdn = EgtGetInfo( idPart, 'PDN', 'i') PanelList[i].sName = EgtGetInfo( idPart, 'NAM', 's') + PanelList[i].sDescription = '' -- in questa modalità ogni MachGroup è 1 pezzo, non esistono multipli -- TODO valutare se raggruppare i pannelli uguali per la cutting list PanelList[i].nQuantity = 1 @@ -53,12 +55,14 @@ local function GetSheetList() { dLength = 2800, dWidth = 2070, - dThickness = 8 + dThickness = 8, + sMaterial = '' }, { dLength = 2800, dWidth = 2070, - dThickness = 18 + dThickness = 18, + sMaterial = '' } } @@ -76,6 +80,37 @@ local function GetProjectInfo() return ProjectInfo end +local function GetFormattedLine( Table, LineToPrint) + local sLine = '' + local Values = Table.ValuesList[LineToPrint] + local nPos = 1 -- posizione partenza linea + + for j, Value in ipairs( Values) do + local Placeholder = Table.ValuesPlaceholders[j] + local sFormatted = string.format( Placeholder, Value) + + -- se il campo ha lunghezza fissa, si aggiungono spazi + if Table.FieldFixLength and Table.FieldFixLength[j] then + local sFieldLength = Table.FieldFixLength[j] + -- troncamento se troppo lungo + if #sFormatted > sFieldLength then + sFormatted = string.sub( sFormatted, 1, sFieldLength) + end + sFormatted = sFormatted .. string.rep(" ", sFieldLength - #sFormatted) + end + + sLine = sLine .. sFormatted + nPos = nPos + #sFormatted + + -- Aggiungi spazio solo se non è l'ultimo campo + if j < #Values then + sLine = sLine .. " " + nPos = nPos + 1 + end + end + return sLine +end + local function BuildCuttingList_Cutty( PanelList, SheetList, ProjectInfo) @@ -97,20 +132,22 @@ local function BuildCuttingList_Cutty( PanelList, SheetList, ProjectInfo) Header = { 'F1', PanelList[1].dThickness, 0, 0, 0}, HeaderPlaceholders = { '%s', '%.3f', '%.3f', '%.3f', '%.3f'}, ValuesList = {}, - ValuesPlaceholders = { '%.3f', '%.3f', '%d', '%d', '%d', '%d', '%d', '%.3f', '%d', '%d', '%d', '%d'} + ValuesPlaceholders = { '%.3f', '%.3f', '%d', '%d', '%d', '%d', '%s', '%d', '%.3f', '%d', '%d', '%d', '%d'}, + FieldFixLength = { [6] = 29, [7] = 50} } for i = 1, #SheetList do - F1.ValuesList[i] = { SheetList[i].dLength, SheetList[i].dWidth, 99, 200, 1, 1, 0, 1, 0, 0, 0, 0} + F1.ValuesList[i] = { SheetList[i].dLength, SheetList[i].dWidth, 99, 200, 1, 1, SheetList[i].sMaterial, 0, 1, 0, 0, 0, 0} end local F2 = { Header = { 'F2', 0, 0, 0}, HeaderPlaceholders = { '%s', '%d', '%d', '%d'}, ValuesList = {}, - ValuesPlaceholders = { '%.3f', '%.3f', '%d', '%d', '%d', '%d', '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%.3f', '%d', '%d', '%d', '%.3f', '%.3f'} + ValuesPlaceholders = { '%.3f', '%.3f', '%d', '%d', '%d', '%d', '%d', '%s', '%d', '%d', '%d', '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%.3f', '%d', '%d', '%d', '%.3f', '%.3f'}, + FieldFixLength = { [8] = 20, [13] = 50, [23] = 85} } for i = 1, #PanelList do - F2.ValuesList[i] = { PanelList[i].dLength, PanelList[i].dWidth, PanelList[i].nQuantity, 0, 0, 0, 0, PanelList[i].nPdn, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1500, 0, 0, 0, 0, 0} + F2.ValuesList[i] = { PanelList[i].dLength, PanelList[i].dWidth, PanelList[i].nQuantity, 0, 0, 0, 0, PanelList[i].nPdn, 0, 0, 0, 0, PanelList[i].sDescription, 0, 0, 0, 0, 1, 0, 1500, 0, 0, 0, 0, 0} end local F7 = { @@ -187,9 +224,8 @@ local function BuildCuttingList_Cutty( PanelList, SheetList, ProjectInfo) -- F1 - sheets table.insert( Lines, string.format( table.concat( F1.HeaderPlaceholders, ' '), table.unpack( F1.Header))) for i = 1, #F1.ValuesList do - local Values = F1.ValuesList[i] - local Placeholders = F1.ValuesPlaceholders - table.insert( Lines, string.format( table.concat( Placeholders, ' '), table.unpack( Values))) + local sLine = GetFormattedLine( F1, i) + table.insert( Lines, sLine) end -- linea vuota @@ -198,9 +234,8 @@ local function BuildCuttingList_Cutty( PanelList, SheetList, ProjectInfo) -- F2 - panels table.insert( Lines, string.format( table.concat( F2.HeaderPlaceholders, ' '), table.unpack( F2.Header))) for i = 1, #F2.ValuesList do - local Values = F2.ValuesList[i] - local Placeholders = F2.ValuesPlaceholders - table.insert( Lines, string.format( table.concat( Placeholders, ' '), table.unpack( Values))) + local sLine = GetFormattedLine( F2, i) + table.insert( Lines, sLine) end -- linea vuota @@ -262,7 +297,8 @@ local function BuildCuttingList( PanelList, sOutputType) ActualSheetList[#ActualSheetList+1] = { dLength = SheetList[i].dLength, dWidth = SheetList[i].dWidth, - dThickness = SheetList[i].dThickness + dThickness = SheetList[i].dThickness, + sMaterial = SheetList[i].sMaterial } end end From fc5071a9ae98fa972bc949f3c46cf02c252d2cbd Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Wed, 17 Sep 2025 15:50:54 +0200 Subject: [PATCH 3/5] In PanelSaw, tolto debug --- LuaLibs/PanelSaw.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LuaLibs/PanelSaw.lua b/LuaLibs/PanelSaw.lua index f5c72d2..74ef71d 100644 --- a/LuaLibs/PanelSaw.lua +++ b/LuaLibs/PanelSaw.lua @@ -3,7 +3,7 @@ -- Intestazioni require( 'EgtBase') -EgtEnableDebug( true) +EgtEnableDebug( false) local PanelSaw = {} From bc467fc784ec43a7ce1bc3141b52b9d6f9c02cda Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Thu, 18 Sep 2025 11:30:16 +0200 Subject: [PATCH 4/5] In PanelSaw migliorata gestione scrittura dati. Dato F7 uniformato a F1 e F2. Versione funzionante, testata in macchina. --- LuaLibs/PanelSaw.lua | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/LuaLibs/PanelSaw.lua b/LuaLibs/PanelSaw.lua index 74ef71d..c61fbef 100644 --- a/LuaLibs/PanelSaw.lua +++ b/LuaLibs/PanelSaw.lua @@ -80,18 +80,18 @@ local function GetProjectInfo() return ProjectInfo end -local function GetFormattedLine( Table, LineToPrint) +local function GetFormattedLine( ValuesList, ValuesPlaceholders, FieldFixLength) local sLine = '' - local Values = Table.ValuesList[LineToPrint] + local Values = ValuesList local nPos = 1 -- posizione partenza linea for j, Value in ipairs( Values) do - local Placeholder = Table.ValuesPlaceholders[j] + local Placeholder = ValuesPlaceholders[j] local sFormatted = string.format( Placeholder, Value) -- se il campo ha lunghezza fissa, si aggiungono spazi - if Table.FieldFixLength and Table.FieldFixLength[j] then - local sFieldLength = Table.FieldFixLength[j] + if FieldFixLength and FieldFixLength[j] then + local sFieldLength = FieldFixLength[j] -- troncamento se troppo lungo if #sFormatted > sFieldLength then sFormatted = string.sub( sFormatted, 1, sFieldLength) @@ -166,19 +166,7 @@ local function BuildCuttingList_Cutty( PanelList, SheetList, ProjectInfo) { 164, 164}, { 150, 150} }, - ValuesPlaceholders = { - { '%s', '%s'}, - { '%s', '%s'}, - { '%s', '%s'}, - { '%s', '%s'}, - { '%s', '%s'}, - { '%s', '%s'}, - { '%s', '%s'}, - { '%s', '%s'}, - { '%s', '%s'}, - { '%s', '%s'}, - { '%s', '%s'} - } + ValuesPlaceholders = { '%s', '%s'} } local F7b = { @@ -224,7 +212,7 @@ local function BuildCuttingList_Cutty( PanelList, SheetList, ProjectInfo) -- F1 - sheets table.insert( Lines, string.format( table.concat( F1.HeaderPlaceholders, ' '), table.unpack( F1.Header))) for i = 1, #F1.ValuesList do - local sLine = GetFormattedLine( F1, i) + local sLine = GetFormattedLine( F1.ValuesList[i], F1.ValuesPlaceholders, F1.FieldFixLength) table.insert( Lines, sLine) end @@ -234,7 +222,7 @@ local function BuildCuttingList_Cutty( PanelList, SheetList, ProjectInfo) -- F2 - panels table.insert( Lines, string.format( table.concat( F2.HeaderPlaceholders, ' '), table.unpack( F2.Header))) for i = 1, #F2.ValuesList do - local sLine = GetFormattedLine( F2, i) + local sLine = GetFormattedLine( F2.ValuesList[i], F2.ValuesPlaceholders, F2.FieldFixLength) table.insert( Lines, sLine) end @@ -244,9 +232,8 @@ local function BuildCuttingList_Cutty( PanelList, SheetList, ProjectInfo) -- F7 table.insert( Lines, string.format( table.concat( F7.HeaderPlaceholders, ' '), table.unpack( F7.Header))) for i = 1, #F7.ValuesList do - local Values = F7.ValuesList[i] - local Placeholders = F7.ValuesPlaceholders[i] - table.insert( Lines, string.format( table.concat( Placeholders, ' '), table.unpack( Values))) + local sLine = GetFormattedLine( F7.ValuesList[i], F7.ValuesPlaceholders, F7.FieldFixLength) + table.insert( Lines, sLine) end -- linea vuota From 2bde93681fd56ff1369fb0ce6b079a9f6032891f Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Thu, 18 Sep 2025 11:32:28 +0200 Subject: [PATCH 5/5] update version e log --- UpdateLog.txt | 3 +++ Version.lua | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/UpdateLog.txt b/UpdateLog.txt index 6934276..5119bea 100644 --- a/UpdateLog.txt +++ b/UpdateLog.txt @@ -1,5 +1,8 @@ ==== Wall Update Log ==== +Versione 2.7i2 (18/09/2025) +- Modif : in PanelSaw gestione campi a lunghezza fissa + Versione 2.7i1 (16/09/2025) - Added : per cabinet aggiunta esportazione cutting list e modalità nesting semplice diff --git a/Version.lua b/Version.lua index 344c6fb..549fd94 100644 --- a/Version.lua +++ b/Version.lua @@ -2,5 +2,5 @@ -- Gestione della versione di Wall NAME = 'Wall' -VERSION = '2.7i1' +VERSION = '2.7i2' MIN_EXE = '2.7f2'