From a21be79df894ee20783b4dbe8adc5833d6e89bce Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Thu, 25 Jan 2024 08:35:26 +0100 Subject: [PATCH 1/2] EgtMachKernel 2.6a2 : - modificato controllo parametri in LuaEmtMoveAxes per evitare crash in R64 - piccole migliorie. --- EgtMachKernel.rc | Bin 11774 -> 11774 bytes MachMgrSimulation.cpp | 2 +- MachineLua.cpp | 15 ++++----------- Simulator.cpp | 2 +- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index e055e40431448c66f631f5cfc6405f0fd0ae6dfe..aff92b1f42c439a4a4d2613dcfdb7a494a407061 100644 GIT binary patch delta 97 zcmewt{V#gMFE&P_&A-`fnHh~HKa|wnoW?bQ1uSxrY4Qod0+^@}R1`^_2jk{d(jGv4 NK<#LXK~l;gTmU8!BZvS1 delta 97 zcmewt{V#gMFE&QQ&A-`fnHdcyKa|wnoW?bQ1uSxrY4Qod0+^@}R1`^_2jk{d(jGv4 NK<#LXK~l;gTmU3rBY*$^ diff --git a/MachMgrSimulation.cpp b/MachMgrSimulation.cpp index d2b75b1..af36e9d 100644 --- a/MachMgrSimulation.cpp +++ b/MachMgrSimulation.cpp @@ -198,7 +198,7 @@ MachMgr::SimMoveAxes( int nMoveType, const SAMVECTOR& vAxNaEpSt) { // verifico simulatore if ( m_pSimul == nullptr) - return false ; + return SIM_AXMV_RES_ERR ; // lancio movimento assi return m_pSimul->MoveAxes( nMoveType, vAxNaEpSt) ; } diff --git a/MachineLua.cpp b/MachineLua.cpp index 4699442..0117a62 100644 --- a/MachineLua.cpp +++ b/MachineLua.cpp @@ -1483,18 +1483,11 @@ int Machine::LuaEmtMoveAxes( lua_State* L) { // 4, ..., 31 parametri : nMoveType, sAx1, dPos1, dStep1 [, sAx2, dPos2, dStep2] ... [, sAx10, dPos10, dStep10] - int nMoveType ; - LuaCheckParam( L, 1, nMoveType) - string sAx1 ; - LuaCheckParam( L, 2, sAx1) ; - double dEnd1 ; - LuaCheckParam( L, 3, dEnd1) ; - double dStep1 ; - LuaCheckParam( L, 4, dStep1) ; + int nMoveType = 0 ; + LuaGetParam( L, 1, nMoveType) ; SAMVECTOR vAxNaEpSt ; - vAxNaEpSt.emplace_back( sAx1, dEnd1, dStep1) ; - for ( int i = 0 ; i < 9 ; ++ i) { - int nInd = 5 + 3 * i ; + for ( int i = 0 ; i < 10 ; ++ i) { + int nInd = 2 + 3 * i ; string sAxN ; double dEndN ; double dStepN ; diff --git a/Simulator.cpp b/Simulator.cpp index c1558aa..4a17e19 100644 --- a/Simulator.cpp +++ b/Simulator.cpp @@ -2237,7 +2237,7 @@ Simulator::MoveAxes( int nMoveType, const SAMVECTOR& vAxNaEpSt) } } // Aggiorno visualizzazione - if ( bViewAllFrames || ( i % 2) == 0 || i == nStep) + if ( bViewAllFrames || ( i % 4) == 0 || i == nStep) ExeDraw() ; // Verifico collisioni int nCdInd, nObjInd ; From d8c5fe0ea751afacaf031f6029b0ce07b22b1547 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 29 Jan 2024 19:54:17 +0100 Subject: [PATCH 2/2] EgtMachkernel : - ora vengono restituiti ThDiam e ThLength anche per le mortasatrici/seghe a catena (ovviamente vanno considerati nella direzione dell'utensile). --- ToolsMgr.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ToolsMgr.cpp b/ToolsMgr.cpp index 006f749..f89c84b 100644 --- a/ToolsMgr.cpp +++ b/ToolsMgr.cpp @@ -738,10 +738,11 @@ ToolsMgr::GetCurrToolThDiam( double& dThDiam) const if ( ! m_bCurrTool) return false ; - // se punta a forare, lama, fresa o scalpello + // se punta a forare, lama, fresa, mortasatrice/sega a catena o scalpello if ( ( m_tdCurrTool.m_nType & TF_DRILLBIT) != 0 || ( m_tdCurrTool.m_nType & TF_SAWBLADE) != 0 || ( m_tdCurrTool.m_nType & TF_MILL) != 0 || + ( m_tdCurrTool.m_nType & TF_MORTISE) != 0 || ( m_tdCurrTool.m_nType & TF_CHISEL) != 0) { // recupero le dimensioni del porta utensili double dTHoldBase = 0 ; @@ -761,9 +762,8 @@ ToolsMgr::GetCurrToolThDiam( double& dThDiam) const dThDiam = dTHoldDiam ; return true ; } - // se mortasatrice/sega a catena o waterjet - else if ( ( m_tdCurrTool.m_nType & TF_MORTISE) != 0 || - ( m_tdCurrTool.m_nType & TF_WATERJET) != 0) { + // se waterjet + else if ( ( m_tdCurrTool.m_nType & TF_WATERJET) != 0) { dThDiam = 0 ; return true ; } @@ -779,10 +779,11 @@ ToolsMgr::GetCurrToolThLength( double& dThLen) const if ( ! m_bCurrTool) return false ; - // se punta a forare, lama, fresa o scalpello + // se punta a forare, lama, fresa, mortasatrice/sega a catena o scalpello if ( ( m_tdCurrTool.m_nType & TF_DRILLBIT) != 0 || ( m_tdCurrTool.m_nType & TF_SAWBLADE) != 0 || ( m_tdCurrTool.m_nType & TF_MILL) != 0 || + ( m_tdCurrTool.m_nType & TF_MORTISE) != 0 || ( m_tdCurrTool.m_nType & TF_CHISEL) != 0) { // recupero le dimensioni del porta utensili double dTHoldBase = 0 ; @@ -802,9 +803,8 @@ ToolsMgr::GetCurrToolThLength( double& dThLen) const dThLen = dTHoldLen ; return true ; } - // se mortasatrice/sega a catena o waterjet - else if ( ( m_tdCurrTool.m_nType & TF_MORTISE) != 0 || - ( m_tdCurrTool.m_nType & TF_WATERJET) != 0) { + // se waterjet + else if ( ( m_tdCurrTool.m_nType & TF_WATERJET) != 0) { dThLen = 0 ; return true ; }