From 412d1b15b5a3f7302fc26e2efdfe58d3524d8f4c Mon Sep 17 00:00:00 2001 From: DarioS Date: Thu, 2 Feb 2023 11:54:43 +0100 Subject: [PATCH] 3dPrinting : - in generazione CN aggiunta restituzione stringa di errore (PRINT.MSG). --- LuaLibs/RunGcodeGenerate.lua | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/LuaLibs/RunGcodeGenerate.lua b/LuaLibs/RunGcodeGenerate.lua index 2258340..03c878d 100644 --- a/LuaLibs/RunGcodeGenerate.lua +++ b/LuaLibs/RunGcodeGenerate.lua @@ -1,4 +1,4 @@ --- RunGcodeGenerate.lua by Egaltech s.r.l. 2022/06/14 +-- RunGcodeGenerate.lua by Egaltech s.r.l. 2023/02/02 -- Calcoli prima fase per Stampa 3d -- Tabella per definizione modulo @@ -106,12 +106,23 @@ function RunGcodeGenerate.Exec() if not EgtApplyMachining() then local nErr, sErr = EgtGetLastMachMgrError() - local sMsg = 'Error applying Extrusion' + local sMsg = '' if nErr == 2803 and string.find( sErr, '(3)', 1, true) then - sMsg = sMsg .. ' (missing Feed & Speed)' + sMsg = ' Missing Feed & Speed.' + elseif nErr == 2804 then + sMsg = ' Axes Values not calculable.' + elseif nErr == 2805 then + sMsg = ' Outstroke Axes (see Log File).' + else + sMsg = ' See Log File.' end EgtResetCurrMachGroup() - EgtOutBox( sMsg, 'GcodeGenerate') + if PRINT and PRINT.PROGRAM == 1 then + PRINT.ERR = 1 + PRINT.MSG = sMsg + else + EgtOutBox( 'Error in Machining :'..sMsg, 'GcodeGenerate') + end return end @@ -147,7 +158,7 @@ function RunGcodeGenerate.Exec() if bGenOk then PRINT.ERR = 0 else - PRINT.ERR = 999 + PRINT.ERR = 2 end else if bGenOk then