From f37abb39dc7e38a20830b9593593190d95bd89e2 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 21 May 2018 07:28:16 +0000 Subject: [PATCH] EgtMachKernel 1.9e4 : - in Generator aggiunta variabile per versione (EMT.VER) e variabili per punto medio arco (EMT.M1, EMT.M2, EMT.M3). --- DllMain.h | 1 + EMkDllMain.cpp | 9 +++++++++ EgtMachKernel.rc | Bin 11774 -> 11774 bytes Generator.cpp | 17 ++++++++++++++--- Generator.h | 4 ++-- OutputConst.h | 7 +++++++ 6 files changed, 33 insertions(+), 5 deletions(-) diff --git a/DllMain.h b/DllMain.h index da69e77..1f46ef2 100644 --- a/DllMain.h +++ b/DllMain.h @@ -18,5 +18,6 @@ #include //----------------------------------------------------------------------------- +std::string GetEMkVer( void) ; ILogger* GetEMkLogger( void) ; const std::string& GetEMkKey( void) ; diff --git a/EMkDllMain.cpp b/EMkDllMain.cpp index 76d43c1..ed30544 100644 --- a/EMkDllMain.cpp +++ b/EMkDllMain.cpp @@ -70,6 +70,15 @@ GetEMkVersion( void) return s_szEMkNameVer ; } +//----------------------------------------------------------------------------- +std::string +GetEMkVer( void) +{ + std::string sVer ; + GetModuleVersion( s_hModule, sVer) ; + return sVer ; +} + //----------------------------------------------------------------------------- static ILogger* s_pLogger = nullptr ; diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index c604696686d0fdc2c8b2a7c7960f8e7be6bf2b8b..52c093d12d4dcb6d6c68ad786e11abbdd704fa94 100644 GIT binary patch delta 97 zcmewt{V#gMFE&P#&A-`fnHfzcKa|wnoW?bQ1uSxrY4Qod0+^@}R1`^_2jk{d(jGv4 NK<#LXK~l;gTmUI`BbWdH delta 97 zcmewt{V#gMFE&Qw&A-`fnHh~IKa|wnoW?bQ1uSxrY4Qod0+^@}R1`^_2jk{d(jGv4 NK<#LXK~l;gTmUD-Bai?9 diff --git a/Generator.cpp b/Generator.cpp index d2db987..5c23a48 100644 --- a/Generator.cpp +++ b/Generator.cpp @@ -460,7 +460,9 @@ Generator::ProcessClEnt( int nEntId, int nEntInd, int nClPathId, int nClPathInd, break ; case 2 : // arco CW case 3 : // arco CCW - if ( ! OnArc( nMove, AxesEnd, pCamData->GetAxesCen(), pCamData->GetAxesRad(), pCamData->GetAxesAngCen(), + Point3d ptMid( AxesEnd[0], AxesEnd[1], AxesEnd[2]) ; + ptMid.Rotate( pCamData->GetAxesCen(), pCamData->GetAxesNormDir(), - pCamData->GetAxesAngCen() / 2) ; + if ( ! OnArc( nMove, AxesEnd, pCamData->GetAxesCen(), ptMid, pCamData->GetAxesRad(), pCamData->GetAxesAngCen(), pCamData->GetFeed(), pCamData->GetFlag())) return false ; break ; @@ -524,6 +526,8 @@ Generator::OnStart( void) { // definisco tavola variabili globali bool bOk = m_pMachine->LuaCreateGlobTable( GLOB_VAR) ; + // assegno versione + bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_VER, GetEMkVer()) ; // assegno valori di default bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_USETO1, false) ; bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MODAL, false) ; @@ -534,6 +538,9 @@ Generator::OnStart( void) bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_C1T, "I") ; bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_C2T, "J") ; bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_C3T, "K") ; + bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_M1T, "I") ; + bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_M2T, "J") ; + bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_M3T, "K") ; bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_RRT, "R") ; bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_FT, "F") ; bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_ST, "S") ; @@ -986,8 +993,8 @@ Generator::OnLinear( int nMove, const DBLVECTOR& AxesEnd, double dFeed, int nFla //---------------------------------------------------------------------------- bool -Generator::OnArc( int nMove, const DBLVECTOR& AxesEnd, const Point3d& ptCen, double dRad, double dAngCen, - double dFeed, int nFlag) +Generator::OnArc( int nMove, const DBLVECTOR& AxesEnd, const Point3d& ptCen, const Point3d& ptMid, + double dRad, double dAngCen, double dFeed, int nFlag) { // assegno il tipo di movimento bool bOk = m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MOVE, nMove) ; @@ -1003,6 +1010,10 @@ Generator::OnArc( int nMove, const DBLVECTOR& AxesEnd, const Point3d& ptCen, dou bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_C1, ptCen.x) ; bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_C2, ptCen.y) ; bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_C3, ptCen.z) ; + // assegno le coordinate del punto medio + bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_M1, ptMid.x) ; + bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_M2, ptMid.y) ; + bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_M3, ptMid.z) ; // assegno il valore del raggio bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_RR, dRad) ; // assegno il valore dell'angolo al centro diff --git a/Generator.h b/Generator.h index 1519e10..fc97841 100644 --- a/Generator.h +++ b/Generator.h @@ -59,8 +59,8 @@ class Generator bool OnPathEndAux( int nInd, const std::string& sAE) ; bool OnRapid( int nMove, const DBLVECTOR& AxesEnd, int nAxesMask, int nFlag) ; bool OnLinear( int nMove, const DBLVECTOR& AxesEnd, double dFeed, int nFlag) ; - bool OnArc( int nMove, const DBLVECTOR& AxesEnd, const Point3d& ptCen, double dRad, double dAngCen, - double dFeed, int nFlag) ; + bool OnArc( int nMove, const DBLVECTOR& AxesEnd, const Point3d& ptCen, const Point3d& ptMid, + double dRad, double dAngCen, double dFeed, int nFlag) ; bool ResetArcData( void) ; private : diff --git a/OutputConst.h b/OutputConst.h index 951a6a1..ea74198 100644 --- a/OutputConst.h +++ b/OutputConst.h @@ -20,6 +20,7 @@ static const int MAX_AXES = 7 ; // Variabili static const std::string GLOB_VAR = "EMT" ; // tavola variabili globali +static const std::string GVAR_VER = ".VER" ; // (string) versione della Dll static const std::string GVAR_ERR = ".ERR" ; // (int) codice di errore (0=ok) static const std::string GVAR_USETO1 = ".USETO1" ; // (bool) flag per utilizzo origine tavola static const std::string GVAR_MODAL = ".MODAL" ; // (bool) flag per emissione modale dei valori @@ -96,6 +97,9 @@ static const std::string GVAR_R4 = ".R4" ; // (num) valore del static const std::string GVAR_C1 = ".C1" ; // (num) valore del primo asse lineare per centro arco static const std::string GVAR_C2 = ".C2" ; // (num) valore del secondo asse lineare per centro arco static const std::string GVAR_C3 = ".C3" ; // (num) valore del terzo asse lineare per centro arco +static const std::string GVAR_M1 = ".M1" ; // (num) valore del primo asse lineare per punto medio arco +static const std::string GVAR_M2 = ".M2" ; // (num) valore del secondo asse lineare per punto medio arco +static const std::string GVAR_M3 = ".M3" ; // (num) valore del terzo asse lineare per punto medio arco static const std::string GVAR_RR = ".RR" ; // (num) valore raggio per arco static const std::string GVAR_AC = ".AC" ; // (num) valore angolo al centro per arco static const std::string GVAR_L1P = ".L1p" ; // (num) valore precedente del primo asse lineare @@ -115,6 +119,9 @@ static const std::string GVAR_R4T = ".R4t" ; // (string) token del static const std::string GVAR_C1T = ".C1t" ; // (string) token del primo asse lineare per centro arco static const std::string GVAR_C2T = ".C2t" ; // (string) token del secondo asse lineare per centro arco static const std::string GVAR_C3T = ".C3t" ; // (string) token del terzo asse lineare per centro arco +static const std::string GVAR_M1T = ".M1t" ; // (string) token del primo asse lineare per punto medio arco +static const std::string GVAR_M2T = ".M2t" ; // (string) token del secondo asse lineare per punto medio arco +static const std::string GVAR_M3T = ".M3t" ; // (string) token del terzo asse lineare per punto medio arco static const std::string GVAR_RRT = ".RRt" ; // (string) token del raggio per arco static const std::string GVAR_L1N = ".L1n" ; // (string) nome del primo asse lineare static const std::string GVAR_L2N = ".L2n" ; // (string) nome del secondo asse lineare